Half-Life for Dreamcast has some functional multiplayer components

Discussion in 'Sega Dreamcast Development and Research' started by TerdFerguson, Jul 13, 2015.

  1. americandad

    americandad Familiar Face

    Joined:
    Jul 4, 2011
    Messages:
    1,439
    Likes Received:
    275
    I am. If you gimme the cable, another dc and a keyboard lol :p
     
  2. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    If i had the cable i could test. They seem to be pretty rare
     
  3. cyrusmaintea

    cyrusmaintea Rising Member

    Joined:
    Feb 13, 2014
    Messages:
    66
    Likes Received:
    39
    you looking for someone with a serial to pc connection? i have that but no dc keyboard, let me know. im willing to help figure this out with ya
     
  4. wombat

    wombat SEGA!

    Joined:
    Mar 14, 2004
    Messages:
    2,671
    Likes Received:
    319
    I have two Dreamcasts and a VS-cable, so I can definitely test this out. However I will first need to acquire a blank CD-R to make an additional copy of the game to try this out. Will keep you posted.
     
    Anthony817 and americandad like this.
  5. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Its kinda impossible to test without a keyboard. But it would be helpful to test that connection

    DreamcastTM over at OC tested, but i'm unsure what exactly he tested. There's a few things to try. Like changing the ip of each system from localhost to whatever by typing 'ip <ip>' in console. Then using 'setmaster', you could add a master to one of the Dreamcasts, then use 'slist' and 'list' to see if the other game is visible. And using 'slist' and 'list' before and after running 'exec server.cfg'. But there's a bunch more of stuff to try with that config, i couldn't list all of them unless i boot the game



    But what I'm trying to do now with this, is try to boot the halflife_dc.exe or ip.bin via Dreamshell CMD. There's a few things like 'writeip' that adds ip's to a list of blocked ip's and such. But obviously you can't write to files on a CD. So running from the SD card would allow those few features possibly. Along with being able to connect to the internet before loading the game without programming. Or minimal programming since i'm not sure if the connection will stay once i boot the game

    Dreamshell RC4 is supposed to have Windows CE compatibility. If i can't get it to boot on RC3 then maybe RC4 will prove useful. The game would essentially run like a PC version if i can get it to load
     
    Anthony817 likes this.
  6. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    But a few things i'm trying when i get some CD-Rs or figure out SD boot, is seeing if 'connect' can be run via valve.rc file when the game boots, what happens running 'exec' on .bin and other types files, and if the .sav, .wad, and .hl1 files can be edited to run 'connect' upon loading a level

    A few other notes; After running 'exec server.cfg' some commands like 'motd' crash the game. The game is Half-Life: Version 1.0.1.3; Dreamcast build 1672. 'Logaddress' cannot be changed, is 'loopback' by default. After running 'exec server.cfg' then typing 'dropclient' and typing 'logaddress <ip> <port>' then 'getsv' it says "Requesting server list from loopback". Doing the same when in local game crashes the game

    If anyone knows how to run the game via raw files on SD card it'd be a big help
     
  7. cyrusmaintea

    cyrusmaintea Rising Member

    Joined:
    Feb 13, 2014
    Messages:
    66
    Likes Received:
    39
    to run a game in extracted format would be a challenge imho, it might require reworking the sdloader to look for and direct the game to run in extracted format.
     
  8. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Well what could work is making an app that again dials and boots from raw files. What i was going for is make a netloader that for example lets call it netload.bin, instead of the dc seeing 'halflife_dc.exe' it would see 'netload.bin' as the running app. Instead of connecting then launching, have netload.bin act as a wrapper for the game; Connecting then running the game from raw files and allowing writing of misc files. As long as the application that connects doesn't close, the connection wont be dropped

    But if it somehow ends up working, the online; Then making a disc would be necessary since there's likely not enough bandwidth running from SD. If ram or cpu resources become an issue the original PC models and slightly downscaled textures is possible. I'm going to test that when i can



    I'm farily confident that this has a good chance of working. Or more likely than anything else on the system. I'm not sure of this but the PC version didn't have the handling of the TCP/IP or PPP built into the game/engine. It ran off the host computers internet. So as said before with things being leftover from PC version, I think if internet was established on the host computer (DC) it should handle it like a PC

    Hopefully someone wants to help test this hypothesis. I have quite the hunch with this
     
  9. SiZiOUS

    SiZiOUS Spirited Member

    Joined:
    Mar 26, 2009
    Messages:
    118
    Likes Received:
    166
    Hello there,

    Just a quick message to notify you all that I made some tests on this.

    I'll post later some details but I afraid the news aren't really great.

    Stay tuned.

    Mike.
     
    Anthony817 and TerdFerguson like this.
  10. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Wow cool, looking forward to hearing
     
  11. SiZiOUS

    SiZiOUS Spirited Member

    Joined:
    Mar 26, 2009
    Messages:
    118
    Likes Received:
    166
    Hello there,

    As I promised, here is the result details of my research at this time.

    FamilyGuy told me about that very interesting thread so I decided to figure out what's the possibility to do netplay with that game, which I loved so much on PC.

    First of all, my configuration environment: My Dreamcast is directly connected to my computer, with Serial connection (RS232) and Broadband Adapter (with a cross-cable, 192.168.1.1 for DC and 192.168.1.2 for PC, setup by Broadband Passport), Joypad, Keyboard and Mouse.

    I made primary my tests on demul, but I tested everything on the real hardware by burning CD-R to be sure (by the way I have another Dreamcast with GDEMU but I was too lazy to use it, because it's in my living room).

    OK, first of all, I download your package TerdFerguson to have your modified PAK0.PAK file, I modified the server.cfg file to match my network configuration then I patched the connect / reconnect commands in order to run them through the console. Now it's possible to use them from console (see the attached picture).

    The thing is, as everyone knows, HL doesn't initialize anything for network-related stuffs. I tested my patched executable on real hardware and saw the BBA is never trying to get an IP, so it seems to be never used at all (I saw this on PC side, I can't ping the 192.168.1.1 IP when HL is running, and I'm sure my configuration is OK since I use dcload-ip a lot).

    The major reason on this, for me, the network DLL, DPLAYX.DLL, responsible of netplay code (at least?) isn't referenced and/or bind to the game executable. This file is part of the WinCE kernel, so you'll be able to find it in the WinCE SDK. The thing is, I don't know if that DLL is compatible with the BBA or Modem only, I need to investigate a bit more on this (in that case, we have a little hope).

    I knows some technics for injecting custom code into compiled things (see hooking for more details), so I think I'll able to inject that DPLAYX.DLL directly in the game executable process. But wait, I don't think the thing will be solved like that. I'm pretty sure, the socket I will open in my custom code, will not be used in the game. Of course not, because the game executable doesn't have any reference at all of that socket. To summarize, my custom code will able to open a net socket, at the same time of the game is running, but the game itself doesn't know anything about it. So in addition of that first step (opening the net socket at the same time of running HL), I think that we need to perform functions hooking in really deep way (i.e. doing big modifications into the game executable for every net-related function!) so it's going to be a nightmare.

    Maybe Gearbox did some custom netplay code (reference to the network/net_ws.c file in the game executable) but I don't think so. I think the explication is more simple. According to that blog:

    Well, the thing is, even for a solo game instance, the game itself is developed to handle multiplay. So that's why we have so much reference to netplay features. Probably with the technic I described above (making hooks for every net-game game functions) maybe it would be possible. But trust me, it's going to take really a lot of time with little chances to success.

    I have some ideas on my mind that I'd test, before closing definitely the case, but please, don't expect too much.

    Mike.
     

    Attached Files:

  12. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Thanks for looking into this, that's really great you enabled the connect commands. Very impressive

    I was thinking the only way to hope to get net communication from the game would be to run the game in some form of wrapper. Almost like a network emulator that could run the game, and the network functions together in one process. Simulating what the PC version of half life would see and use to interact with the host PC's network. Instead of trying to inject the DLL into the game, run all of it in a sub process of the overall wrapper. That too would be really difficult, but maybe not as difficult as the means you mentioned before. Again if RAM or CPU becomes an issue the game can be slimmed down by downscaling the textures and using PC models. You can enable the RAM monitor by typing 'profilemeter 1' if you need to

    Could you share your files with the re-enabled connect commands on the sizious site?

    Windows CE by default is modem only, but FuzzyFish was talking of implementing a bba driver into 4x4 evo. I'm not 100% sure if he's actually doing it but it was mentioned here
    If he does maybe he can help getting the bba to work with a then working Windows CE driver

    Keep us updated. And let me know your thoughts on what i mentioned above

    It will probably be really difficult and technical. But its not just half life, its the possibility of cs, dod, tfc and other multiplayer mods

    Triple bump but that's really cool to see my cfg working with the neuwon masters. I hope you can share that
     
    Last edited by a moderator: Oct 7, 2015
    Anthony817 likes this.
  13. Anthony817

    Anthony817 Familiar Face

    Joined:
    May 12, 2010
    Messages:
    1,078
    Likes Received:
    535
    I had Dreammatrix port over the assets for DOD to HLDC and there were some levels in a mod called Operations 1942 or something like that, but to get to the point, he was going to try and make a WW2 mod for DC with the assets from that and have a nice little WW2 singleplayer mod. Anyways I would love to see all the classic MP mods as well but there is a long road to get to that point.

    Regardless thanks for doing the research you guys are doing so far. Really great to see the community pull together like this.

    Also a few years back I believe Moi was trying to do something to get .dll's working with the game by compiling the HL-SDK .dlls for DC using the WinCE Devkit. It might shed some light on methods he tried to mod the engine? I know it isn't the same as getting MP working but it might prove useful?

    http://web.archive.org/web/20110914...iling-hl-sdk-dlls-dc-using-wince-devkit-3567/
     
    sa1 likes this.
  14. SiZiOUS

    SiZiOUS Spirited Member

    Joined:
    Mar 26, 2009
    Messages:
    118
    Likes Received:
    166
    I'm sorry but I disagree. In my opinion, the game source code was modified a lot in order to be run on the DC. You think it could be done like this because you're referring to the PC version. But WinCE is not Windows. Yeah WinCE allow to port Windows game easier instead of rewriting them from scratch, but you still need to do some modification on your source code in order to run the game under Dreamcast.

    To prove that, just open the HALFLIFE_DC.EXE binary in your Hex Editor. you can see in the binary a lot of source code reference, like D:\proj\halflifedc\<whatever>. As you can see there, the folder name is halflifedc. It means that source code of HLDC is another branch from the PC version. In addition, you don't have any HL DLL in that DC version: because everything is self-contained in the same binary. That means, Half-Life was, I think, really modified (in deep?) to be run on DC.

    No problem. The patch is here.
    To use it, it's really simple:
    • Download the patch (don't pay attention to the Chrome warning, because it contains a batch file and Chrome doesn't like that when it's embedded in ZIP file)
    • Unzip the patch somewhere
    • Copy the original HALFLIFE_DC.EXE file in the same folder where the patch is located
    • Grab xdelta3 binary here, rename it to xdelta3.exe and place it on the patch folder
    • Run the patch.cmd batch file.
    • You'll get a patch HALFLIFE_DC.EXE binary with connect/reconnect commands allowed from console.
    But please note, that patch is only enabling the connect/reconnect commands to be usable in the console, nothing more! Maybe it'll help someone, maybe not. I don't know at least for now. So in clear, this patch is pretty useless at the moment.

    I see. But I'm curious to check the SDK version I have (v2.1, I think it was the latest one). But I have no much time yet.

    I don't know if your cfg is really working or not, since the connect/reconnect commands are pretty inactive :)

    That means recompiling everything. Like I said, client/server DLL are pretty useless on that version because HALFLIFE_DC.EXE won't use them at all. But maybe it would work with xash3d. Maybe the only option there, is to port Half-Life from the HL SDK + xash3d. Like these guys done in fact.

    Of course all of this is my opinion. :)
     
    TerdFerguson and Anthony817 like this.
  15. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Yes the code was likely heavily modified to run on DC. But it seems to be a complete port. It does say somewhere that its a release build, and after 1672 of them that seems likely. The fact that it says 'failed after 4 retries' seems likely that the connect commands do work as they should, there's just no internet. Maybe net_ws.c is all the engine network functions, not the added network handling. Those references are from the compiler meaning its highly likely that it was compiled with the build we have

    If it is a complete port of the PC branch, but without the added code for the network handling; Then the engine see's the dreamcast as another PC, whether its running on Windows x86 or CE. The game to begin with was never programmed to handle the networking within the game, it ran off of the host PC internet. So network interaction could be possible if you make the DC version see the network as it would on a regular PC

    It seems alot of the CE client is in the ROM. With many of the DLLs, but not all of them. Here's what is in ROM

    [​IMG]

    [​IMG]

    Even though Windows CE is not Windows x86. It is still an operating system, even if it is a very thin operating system. So in a way the DC is a PC. There must be a way to emulate networking as the x86 version of half-life would see on an x86 Windows PC

    But like you said this is all my opinion


    Thanks a whole ton for that patch, it will be cool to mess with that
     
    Anthony817 and SiZiOUS like this.
  16. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    891
    The connect command could fail because the network adapter is not initialized/supported.
    I like you enthousiasm, but you should not take hopes for facts. Sizious knows what he's doing, trust me, so we should wait for his input.
     
    Anthony817 likes this.
  17. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Something i forgot to mention was there are a few empty commands in the game, or seem to do nothing. One of them is 'customsrclist'. If you plan on trying anything with the hooking you mentioned, it would be useful to hook a few of the inert commands. Like sending the modem info from flashrom down the line and blind dialing a pc-dc or netopia. You can blind dial the netopia by switching a teltone tls2 to 'on/ring' two times for three seconds. The connection probably wont do anything, but its something to try

    I'll bump this with a list of empty commands later on
     
  18. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    The connect command is not to connect to the network its how you join a server on pc version. So with internet, as difficult or perhaps impossible as that may be, the connect command would not fail. My hopes are based on the facts which look like this could be pulled off. Sizious does know what he's doing and i think he could figure something out

    Edit: I don't mean to sound retaliatory lol
     
    Last edited: Oct 7, 2015
  19. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    891
    But you might not have internet because, as far as the game knows, there's no network adapter.
     
  20. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    That is true because the game/engine to begin with was never programmed to detect and handle the network hardware. That was taken care of by the operating system
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page