Half-Life for Dreamcast has some functional multiplayer components

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

  1. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    It would be really amazing if you were to try developing something. BBA would be a plus, but with stuff like the DreamPi for modem, i'd say try getting modem support in there too. It would be kind of lame to get this working, only to have a very limited amount of people with the ability to play. But a working BBA driver for Windows CE could be implemented into 4x4 Evo if that were done. A user here named FuzzyFish has the source though he can't distribute

    Out of curiosity what could a dev box do that the CE development software and an emulator/retail console couldn't do? The marketplace here would probably be one of your better options for finding one
     
  2. Trident6

    Trident6 Spirited Member

    Joined:
    Oct 17, 2015
    Messages:
    119
    Likes Received:
    55
    Mostly I need a native (gdb preferably) debugging interface if I am going to hack the WinCE kernel and add BBA/network stack support. It could conceivably be done with an emulator but there are too may variables to say for sure whether it would work on real hardware or not. I have a ton of respect for the homebrew community but when it comes to developing, their toolchains don't really hold a candle to the official vendor-supplied solutions.

    I'm not sure what the 01xx series kits go for, but if a working one came up in the $300 range I would buy it in a heartbeat.
     
  3. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    You'd be pretty lucky to get one for $300 to my knowledge. If someone knew that you wanted to get half-life online with it someone would probably negotiate with you. But the prices I was just looking at were 700-1500 euros so thats about $900-$1800 USD I think
     
  4. Trident6

    Trident6 Spirited Member

    Joined:
    Oct 17, 2015
    Messages:
    119
    Likes Received:
    55
    That is about the range I assumed they would go for. The value of something to me as a development tool is usually a lot lower than its value to the collector community.
     
  5. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    891
    In 2007 they were being sold for around 400$, but they weren't really rare at that point. Nowadays it's harder to come by so the price is quite higher. Also, greed and avidity.
     
  6. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    If you wanted to try something without a dev box, you could try compiling a DLL in the CE dev software with some new dummy commands. That 'startgame' command has me intrigued. It's used to start either blueshift or halflife. 'valve' is the halflife folder and 'barney' is the blueshift folder, so in the exe theres references to 'startgame barney' and 'startgame valve'. I just got some CDs so i'm going to try to make a folder called 'mod' and use 'startgame mod' to see if I can load anything

    Having another DLL compiled for DC would help me know if the command loads anything. I'm going to try PC DLLs hoping for errors. Sizious was going to compile one but he didn't due to no obvious way of loading it. But i'm not convinced yet

    Edit: I'm going to message you the link to the SH4 sources
     
  7. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Well I put all the files for counter-strike 1.5 into a folder named 'cstrike' like on pc and make a pak file with similar structure to the pak file in half-life dc. Then typed 'startgame cstrike' which brings me to console. When I type 'path' it shows /CD-ROM/cstrike and recognized the .pak file

    The only problem is I can't change to a map on console while not in-game. So I'll have to figure out how to rcon the 'server' from console or figure out how to make one from console. I doubt loading an unmodified PC game/maps will work but i'm looking to see if it loads it by errors. All I have now is proof it recognizes the path and pak file
    Edit: I also made 'startgame cstrike' the first command in the auto-load config file on memory card but the half-life main menu loaded anyway

    [​IMG]

    Just a note, you can type 'startgame anything' then 'path' and '/CD-ROM/anything' will show as a search path but not the pak obviously unless it's present in the path
     
    Last edited: Jan 10, 2016
  8. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Alright so very cool stuff

    I realized for whatever reason, my pak file i initially made was corrupt. 1045 blank files were in it. So i fixed that. I also realized the command for changing a map at console should be 'map' instead of 'changelevel' ( 'map de_dust2' ).

    I set the first two commands in the auto-load config on memory card to 'startgame cstrike' and 'map de_dust2'. It crashed which was what I wanted. But to be sure it wasn't due to the PC map file, I changed the config to 'map undertow' and again it crashed. This is very significant because this means it's trying to load the counter-strike mod, possibly the DLL. But that is exactly the result I wanted, i'm glad it crashes

    Crash error when loading undertow (half life multiplayer level)
    [​IMG]

    Crash error when loading de_dust2 (counter-strike level)
    [​IMG]

    I'm going to try this without auto-load and see if the result is any different. I'll edit this post after
     
    fate6 likes this.
  9. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    de_nuke running on Dreamcast without modification which is kind of neat
    [​IMG]
    [​IMG]

    But it does not seem to load the counter-strike DLL. Obviously and probably because it was not compiled for SH4, and the engine discards it rather than crashing. However I did get a load bar to show after running 'startgame cstrike'. And the load time to do so is longer than not having a corresponding folder. So I'm fairly certain something is attempted to be loaded. Just because there is no reference to DLLs other than one i'll link a picture below, doesn't mean loading one wasn't coded into the source of the 'startgame' function. We should try compiling a DLL with new commands to flicker the screen or some function to know it is working. But I'm still not convinced it will not work
    Edit: 'startgame' is not in any command lists for half-life that i've come across. This seems to be Dreamcast build exclusive

    [​IMG]

    When I switched back to half-life it crashed, but only once. Not sure if anyone will need this as debug info
    [​IMG]

    In the pak file for half-life, there is player.mdl, player01.mdl, player02.mdl, and player03.mdl. I'm going to see what these are now. The fact that there's four of them is significant because quake 3 only had 4 player multiplayer likely due to bandwidth. This may have been planned to be the case for half-life DC

    Edit2: As stated before, I'm trying to get a DLL to load because any engine changes can likely be made there. Rather than needing high skill hacks. Along with being able to play pretty much every mod online

    Edit3: The Dreamcast models wont work with any half-life model viewer I've found
     
    Last edited: Jan 10, 2016
  10. Trident6

    Trident6 Spirited Member

    Joined:
    Oct 17, 2015
    Messages:
    119
    Likes Received:
    55
    The last shot is a null pointer dereference. WinCE supports virtual memory addressing in much the same way 32 bit windows did on x86.

    I don't really see any need to write a DLL personally since I can inject code directly into the executable. However DLL injection is a pretty well documented and shouldn't be too difficult. I'm not sure you totally understand how DLL loading works; typically the OS handles the loading and unloading of shared libraries, the application has no concept of them. You can load them manually (on Unix anyway, no idea about Windows) but this is very rare to see.

    'startgame' is a very simple function, it does a string compare against 'barney' and loads map ba_tram1 or c0a0 depending on the result. It does call a few complex functions after that that I didn't really dive into, but they appear to be loading the resources for the map.

    Also in hindsight I realized I missed quite a few console commands (I was a bit drunk...), but I don't have time to list them all out at this point.
     
  11. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Half-Life mods have their own client.dll and mp.dll with all of the new engine functions/vgui etc. It's not the same as DLL dependancies/imports/exports in the executable as far as I understand, but I might be wrong. If we can load a mod dll, then we can play games like counter-strike or team fortress. Along with adding the network functions in the DLL (and having the sources for others to compile in the mods I mentioned before)

    From my findings before, it's not just limited to blue-shift or vanilla half-life. It's how the new pak file is loaded, in the case before for counter-strike. Actually while typing this there's a liblist.gam file (the file that tells the engine what game DLL to load on PC, like I mentioned before) in the blue shift folder (barney)
    Code:
    // Blue Shift resource listing file
    //
    game "Blue Shift"
    startmap "ba_tram1"
    url_info "www.gearboxsoftware.com"
    url_dl ""
    version "1"
    size "82814602"
    svonly "0"
    cldll "0"
    type "SP Mission"
    mpentity "info_player_deathmatch"
    gamedll "dlls\hl.dll"
    // gamedll_linux "dlls/tfc_i386.so"
    Actually after finding that i'm pretty convinced we can load one

    So yes you can inject networking code into the binary, which would be incredible and amazing. But what i'm going for here is playing the wide array of mods in addition to online. So if you were going to inject code, make it so we can load the game DLL like PC. That way we can append the network functions (probably a lot cleaner) there and allow others to port the hundreds of other multiplayer mods. That would be a far greater output to the effort put into this than just playing half-life deathmatch (while that would still be great). So we have a fully featured, fully functional GoldSRC engine up to par with PC

    Counter-Strike
    Team Fortress
    Sven Coop
    Richocet
    Day of Defeat
    Chicken Fortress 3
    Zombie Panic
    many many more, 692 mods on moddb and opens the gates for others to make DC exclusive stuff

    I don't mean to rant, but that's why i've spent so much time on this. Not just for HLDM
     
    Last edited: Jan 11, 2016
  12. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Look at the 'resourcelist' command. I can't run that after spawning or at console ("can't "resourcelist" already spawned" & "can't "resourcelist" not connected")

    Edit: To reiterate, (i'm tired of the word DLL) a half-life mod is loaded on PC by the binary looking at the liblist.game file (resource list) and that tells it what new extension DLL file to load. Typically called hl.dll, mp.dll (multiplayer) or client.dll. This is not the same as a dependency such as wininet.dll, which then yes the binary would have no references to it. I'm not sure how familiar you are with half-life mods but its completely different from a dependency DLL in the binary

    The sources I sent you are the standard sources in the HLSDK for someone to make a new hl.dll/mp.dll for their mod, pre-ported (for the most part) to Windows CE on the SH4 CPU
     
    Last edited: Jan 11, 2016
  13. americandad

    americandad Familiar Face

    Joined:
    Jul 4, 2011
    Messages:
    1,439
    Likes Received:
    275
    Why don't you talk to the guys who ported all those mods to Dreamcast like Counter-Strike DC, Opposing Force, They Hunger and 10 to 15 other mods? I'm sure they have most of it figured out by now.

    http://www.dcfan.net.ru/forum/thread-144.html

    Here's an example of what they've done
    http://www.theisozone.com/downloads/dreamcast/dreamcast-isos/half-life-mod-counter-strike-dc-final/
     
    Last edited: Jan 11, 2016
    SILENT_Pavel and TerdFerguson like this.
  14. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    The sources I have are from a user on theisozone who got them from another user named Moi on dcemulation, one of the main HLDC modders. My problem is I can't code thus can't properly compile the DLL file

    I posted an archive link of dcfan.ru from the guy Moi who compiled it, I have those exact sources I think

    I'm pretty sure those mods were just a replacement of the HLDC models and maps.Half-Life itself was just a linear chain of maps with scripted sequences. So mod making can really just be reskinning the enemies, guns etc. And making new maps with scripted sequences. To port something like that you'd just have to convert all the texutres to pvr, drag and drop all the maps and models, make a new pak file then change the first level name to c0a0.bsp and compile the CDI. It'd take someone like 2-3 days. As you saw with de_nuke running without modification


    Moi compiled it, but gave up after there was no obvious way to load it. He probably just put an edited liblist.gam file and expected it to load (like pc). Nobody has taken the time to really go through everything. Most of the stuff I've found is not documented

    This thread I think is the best resource for the HLDC GoldSRC engine on the internet. We've gotten farther than a thread on OC back in 04. If someone can compile the sources with a new command, then I can find out for sure if there's some way to load it. I can't experiment without one



    @Trident6 Do you know how Sizious made that xdelta3 patch to enable the connect commands? I'd like to try that prespawn command since I can't run 'resourcelist' after spawning or at console. But the 'prespawn' output is "prespawn is not valid from the console"
     
  15. americandad

    americandad Familiar Face

    Joined:
    Jul 4, 2011
    Messages:
    1,439
    Likes Received:
    275
    You're probably right. But, I still think you should download that CHM archive and have a read. There's probably a nugget or two there.
     
  16. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    I downloaded last night, i'll have a look later tonight. Thanks for the link
     
  17. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    I found Moi's old thread in that CHM file

    It doesn't seem Moi went that far with it. I'm pretty certain the DLL has to be in the pak file. Since that's where the engine looks when you use 'startgame'. He didn't mention 'startgame' either. We need someone to compile one, if they need the sources PM me. But it's imperative that is tested, I have 9 CDs ready to test

    There's reason enough to believe that it can be loaded. He probably put the DLL in valve\dlls\hl.dll and barney\dlls\hl.dll when it should've went in the pak file. Because that's where the liblist.gam file is for blue-shift
     
    Anthony817 and americandad like this.
  18. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Not really progress for getting an extension to load or anything, but I had nothing to do after work today and ported what I could for CF3/made custom menus


    [​IMG]
    [​IMG]
    [​IMG]
    Transparency didn't work when converting the image to PVR texture
    [​IMG]


    It was cool to see the test map working, the other map didn't but I may try to fix that and port some TF2 maps for kicks. I already converted all the textures to CF3 to PVR. And I know a good amount of hammer editor already from my CS mapping days
    [​IMG]
    [​IMG]
    [​IMG]

    We should really try to compile and figure out the loading of mod extensions. This would be superb
     
    Anthony817 likes this.
  19. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    More cool developments. I put Team Fortress Classic and Decay on a disc. TFC let's me run 'startgame tfc' but when I change the map it stops loading without an error message

    When I load Decay by running 'startgame decay', the engine crashes and says "Customization". This is very significant because I think this proves the engine is doing more than changing the search path to whatever is put in front of the startgame command
    (I previously tried putting modem.elf from KOS in the game and running it via the auto-config VMU file)
    [​IMG]

    So I made another disc, I figured TFC stopped loading due to a lack of a player.mdl file in the models folder. And I put the files for Day of Defeat on-disc instead of Decay. I got the same result for TFC. Which is interesting because if it's a texture error that is displayed and the engine crashes.

    And for DOD I also got the same "Customization" crash, which imo is a better result than loading a map in the base engine
    [​IMG]
    As I said, I'm pretty sure this crash is due to something attempting to be loaded, but crashes due to PC files. The only thing I can think of that would load when that command is run, is the client.dll or the dll from the liblist.gam file (decay.dll or dod.dll). But at the least, I think this shows the command does more than change the game directory. I can send the image to someone if they wanted to do some investigative debugging in an emulator



    Side note: I found this today http://aluigi.altervista.org/papers.htm#hl
    It's a half-life dll decrypter and rebuilder. It crashed on every dll I tried running it on, but it includes source. It may be useful for anyone that wants to look into this. Perhaps TFC doesn't crash, because as stated in the program the tfc.dll is encrypted but that is speculation

    I have one CD left, I'm going to try more mods that have dlls and are multiplayer to see if I get more errors when loading. Else, we need a dll to test further
     
    Last edited: Jan 16, 2016
    Anthony817 and sa1 like this.
  20. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Made another disc with WON versions of DOD and TFC with the same results. I had DOD, TFC and CF3 with Half-Life on-disc. Meaning if we got this working, we could have as many mods as 700mb would allow. Furthering the similarities between the Dreamcast and PC versions

    I'm near certain at this point if we typed 'startgame dll_test' it would load. Unless someone has an explanation for the "Customization" crash. Even so, code can be injected into the startgame command to load the extensions
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page