Half-Life for Dreamcast has some functional multiplayer components

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

  1. Trident6

    Trident6 Spirited Member

    Joined:
    Oct 17, 2015
    Messages:
    119
    Likes Received:
    55
    vec_t is typedef'd as a float, it should be fine.
     
    -=FamilyGuy=- likes this.
  2. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    The other .c files built fine. I'm not sure if VC++6.0 auto changes the compiler between C/C++. But those changes didn't do anything. And changing vec_t to vec3_t didn't do anything either. I tried going into settings for pm_math.c and checking custom build step. But it just gives a bunch of errors for all the "Vector" references. Leading me to believe this will compile after it's fixed

    If I go in freenode saying "Hey I can't code at all but help me compile GoldSRC source code for a foreign CPU" I'll probably be told to GTFO
     
  3. Trident6

    Trident6 Spirited Member

    Joined:
    Oct 17, 2015
    Messages:
    119
    Likes Received:
    55
    Create a new project in Visual Studio as a Win32 console application. Copy pm_math.c into this directory, and everything that is in the 'common' folder one directory up from pm_math.c. Add the following to the very end of pm_math.c:

    Code:
    int main(int argc, char** argv)
    {
    printf("test\n");
    return 0;
    }
    
    You may need to add the math library to the list of linked libraries. Compile this and see if it runs. If you get the same error, you have a compiler issue. If not, you probably have an issue with a C header being exported as a C++ header and need to add 'extern C' guards. That is about all the help I can give you.
     
  4. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Well I tried what you suggested and I get a bunch of other errors in addition to the syntax errors from before. So it may be a compiler issue but all the other .c files compiled fine. So it may actually be a syntax error. I was hoping the syntax errors would be a quick easy fix. It's a pity this stumps you guys also

    [​IMG]

    If all the parts arrive, tomorrow night may be spent making a line voltage inducer for my DreamPi setup. Then Wednesday/Thursday night will probably consist of getting a bunch of games redirected to DreamPipe. But if someone has another idea/suggestion I'll move back over to this

    This weekend I'll be able to get more CDs to test the hopefully then compiled DLL and the CS/TFC/CF3/DOD sources compiled in place of standard sources. Hopefully this can be figured out by then
     
  5. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    That is good that it's complicated. That's kind of all I wanted to hear

    Edit: Tried getting a new pm_math.c from Valve's GitHub with no change in result
     
    Last edited: Jan 19, 2016
  6. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    @Trident6 What was that freenode channel you mentioned?

    Can anyone else recommend a forum or IRC to get help with these last 3 errors?
     
  7. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    893
  8. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Would VC++6.0 for Windows CE on SH-4 be the version of the compiler?
     
  9. Trident6

    Trident6 Spirited Member

    Joined:
    Oct 17, 2015
    Messages:
    119
    Likes Received:
    55
    In what sense? The docs say you need VS enterprise with VC++ 6.0 iirc.
     
  10. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    There's a kit you can download with VC++6.0 and the Dreamcast Windows CE toolkit installer. I didn't need enterprise, everything is in the kit

    If that is not the compiler version how do I find that out? Noob questions but again I've never went this deep in coding before. I was not going to ask for help here if I could not figure it out. But i'm 3 syntax errors away from testing this for sure

    I just hope the changes Moi made for the start health at 10 are still there. I may try finding out how to change the HUD color to white

    Edit: found this, this is probably in my sources too. I'll boot up my linux machine tomorrow. I should just be able to edit the values https://github.com/alliedmodders/hlsdk/blob/master/cl_dll/hud.cpp
     
  11. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Well I think i've found my issue, quoting the answer and bolding the topic of my next question

    Renaming gives me more errors. So can I set command line options for pm_math.c exclusively without compiling the entire workspace as C, and while remaining in GUI? Do I need to edit the makefile?

    I can probably figure this out myself by spending another few hours doing trial and error experiments/researching. But I was wondering if anyone had a quick answer on how to go about doing this before I do that. Off to sleep soon so that would not be tonight anyhow

    Edit: Am I better off renaming and fixing the errors? Because after re-reading I see I would be forcing c++ compile anyway rather than compiling that one file as C


    -----
    Edit2: When renaming, the only two different errors are "Length is an undeclared identifier" ( I can probably figure that one out, most of the other errors were undeclared identifiers )

    The others are for that same string, it say's " missing ' ; ' before ' { " and still says the function header is missing. I tried adding ; after the line before the brackets, but nothing changed. So the function header must be missing anyway, and that should be fixed instead of renaming

    Any ideas on fixing the function header or elaborations on what that means and what I must research?
     
  12. Trident6

    Trident6 Spirited Member

    Joined:
    Oct 17, 2015
    Messages:
    119
    Likes Received:
    55
  13. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Well "VectorScale" has been called in a bunch of other source files that did not have this error after doing a search through all the code in VS. This problem would have been encountered earlier if it was due to calling a C function in C++ or vice versa

    So I really have no idea. I'm not going to keep bumping this unless someone has an answer of how to fix this. I'll try to figure it out myself until then
     
    sa1 likes this.
  14. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Update: I've gotten respawning to work after making a server on PC Steam version, running 'cvarlist', copying the output and splitting it up into 4 CFG files on the Dreamcast disc. Having them all in one gives the error "Cbuf_AddText Overflow"

    This is cool because I previously thought it was not possible. And the localserver is essentially multiplayer ready
     
  15. Trident6

    Trident6 Spirited Member

    Joined:
    Oct 17, 2015
    Messages:
    119
    Likes Received:
    55
    The issue is that you have C and C++ compilation units, and both languages have different namespace resolution techniques. If you have C files that are getting linked against C++ files they have to explicit have extern guards on the exported symbols, otherwise the C++ o assumes it is a C++ object and fails to link against it. This will happen if you errantly send a C files to the C++ compiler, or vice versa (actually different problems if you send a C++ file to a C compiler, but its beside the point). I am about 99% sure that your build process is where the problem is.
     
  16. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    That is probably the case. But my real issue is I have no idea what I'm doing

    From looking at it myself, it would probably take an advanced programmer 1-2 days to setup a Windows XP virtual machine and compile it. I'll probably just wait until there is someone interested in this enough to compile it. Then I can spend a week or two experimenting with different ways to load it

    I tried removing all of the files except the DLLs and liblist.gam file from one of the mods that gave me the "customization" crash when the "startgame" command was run. It did not give me the error. But still, it shows the engine is trying to load the mod files. It is still possible that it attempts to load the extension DLLs, but discards it because it is for Win32 and not WinCE. My next task is trying to pinpoint the file that gives me the "customization" crash

    ------

    Is there any conceivable way to run the half-life binary with command line parameters like PC? For example if you wanted to run the game in 1024x768 you would make a shortcut and add " -w 1024 -h 768 " to the end of the shortcut string. There is a few command line parameter strings in the exe that are not in the PC version pertaining to a client dll file that I wanted to try. But it is possible these are run elsewhere
     
  17. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Update pertaining to this:
    I think I have figured out why this is. In the EXE there's a string "+client.dll" ( command line parameter like I mentioned in the previous post ). I figured this must have been run elsewhere other than before running the binary

    So using the CS 1.5 files I ran "startgame cstrike" then 'map de_nuke +client.dll /CD-ROM/cstrike/cl_dlls/client.dll' and I got the same loading screen crash in the same area as Team Fortress Classic. Running just 'map de_nuke' loads the level

    I tried this on the Chicken Fortress 3 files since that is the only other mod that does not give me the "customization" crash. The dev map is called "movewith". Which loads up fine without the +client.dll parameter. But when I run 'map movewith +client.dll /CD-ROM/ckf3/cl_dlls/client.dll' I get the same crash

    The crash is in the last 80% of loading. On PC, this is where the game parses the client.dll file between the server and client (sending client info is what it says on both GoldSRC multiplayer games and Source Engine multiplayer games in the last 80%)

    I'm going to try this with a bogus file path for the client dll, and with half-life itself to see if I still get the same crash. Hopefully I do not. I will update this post in a minute with those results

    -------

    Running with a bogus file path gives the same results. Both in half-life and CS 1.5. I think this crash is due to it trying to parse a client.dll from a bogus file path. Because 'startgame' changes the search path to whatever follows the command. So in actuality I'm telling the game look for cstrike/CD-ROM/cstrike/cl_dlls/client.dll and it crashes because there is nothing to parse. Thus the game halts loading and all together halts

    However, running a command line parameter that does not exist (at least as a visible string in the binary) +dll followed by the path of the game dll (/CD-ROM/cstrike/dlls/mp.dll) does not yeild the same result. Which is somewhat conclusive proof that the +client.dll is trying to parse a dll when used. Considering it crashes where the PC version parses one, rather than in the beginning of loading

    --------

    I tried messing with different file paths for the +client.dll parameter for TFC. But the result stays the same. But it seems the cause of this crash is in fact because it is trying to parse the PC client.dll

    -----

    One more update on this:

    It looks like this crash happens when there is more than four subfolders after +client.dll. I tried 'map de_nuke +client.dll /bogus/bogus/bogus' and the level loaded. But
    'map de_nuke +client.dll /bogus/bogus/bogus/bogus' yeilds the crash. Though again, I think this proves the functionality of the +client.dll parameter

    So perhaps it is the case that both the mp.dll/hl.dll and client.dll get discarded due to being for Win32 and not WinCE. I know that for TFC, the mp.dll/tfc.dll (depending on the version) is encrypted. Maybe it seems that attempt of parsing TFCs dll is made because the engine already knows how to decrypt it, but crashes at some point during that because it is Win32. But that is pure speculation. I did read somewhere that half-life was also going to be bundled with TFC and HLDM on a seperate multiplayer disc. Maybe that is the case

    -----

    Okay actualy last update for this post

    Just to make sure the crash was not because of too much text after the 'map' command, I ran 'map de_nuke +bogus /bogus/bogus/bogus/bogus' and the level loaded fine

    Again I think this does prove the functionality of +client.dll

    ----

    There is another parameter '+serverside'. But I have no idea what that might be. That seems to be the only other one besides '+client.dll'
     
    Last edited: Feb 10, 2016
    sa1 and Anthony817 like this.
  18. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Great update:

    I've found that the command 'cmd' will not run any standard command after it, so I searched the binary strings for 'cmd' and found
    'cmd prespawn %i %i'
    'cmd resourcelist %i %i'

    So in the auto loading VMU configuration file I made the first few strings
    Code:
    startgame cstrike
    name dan12343
    cmd prespawn dan12343
    cmd resourcelist liblist.gam
    map de_nuke
    cmd prespawn dan12343
    cmd resourcelist liblist.gam
    When I tried it prior to doing that it says 'resourcelist not valid -- already spawned'. So when the level loaded and I spawned regularly I assumed it did not work. Tasos from the Dreamcast Online Skype group compiled a DLL for me for Dreamcast Windows CE. He changed the HUD color to white. But I forgot to remove the DLLs and liblist.gam from the PAK0.PAK file

    Just to see if it worked I ran 'impulse 101' and I was flabbergasted
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]

    I loaded the HUD from Counter-Strike. I think because the DLLs and liblist.gam were left in the PAK file, it used those instead. I'm going to try removing them now and trying with the new liblist.gam and proper WinCE DLL

    That is really exciting my heart was racing. Completely unexpected
     
    Anthony817 likes this.
  19. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Well after experimenting a little bit, the HUD did not change to white. I'm not sure if the wrong value was changed for the color or not. But I do not know if I did load the DLL before or not. I tried with Chicken Fortress 3 and it had the CS HUD. But CF3 is derived from "Counter-Strike Breathrough Edition". So I may be loading it and the HUD elements are the only thing that loads. The only way to know for sure is if I make another disc without the DLLs and see if I get the same result

    Either way, I'm sure it loads the resource list. Without that VMU config I posted above, it will not work

    It may take a while before I find a way to load it. It took me over a month to figure out getting the HUD for CS to load. And at this point again I do not know if I loaded the DLL or not. But from the previous post, I'm convinced there is still more things I have not found yet

    I'll put the DLL download link here tomorrow/later, almost 5:30am here I should get to sleep
     
    sa1 likes this.
  20. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Okay so I think I've figured out how to run command line parameters. I've finally found information about stuffcmds

    This will explain why when I try using stuffcmds in console, the output is always "stuffcmds : execute command line parameters". It is supposed to be run exclusively from the valve.rc file

    Unfortunately, I have no more CD-Rs. So testing this will have to wait until tomorrow night. But at least we can see if the '+client.dll' and '+serverside' parameters do anything

    I did find more command line parameters
    Code:
    -nosound
    -nodcaudio
    -nojoy
    -dibonly
    -safe
    -nomouse
    -stdvid
    -rouge
    -hipnotic
    -basedir
    -cachedir
    -game
    -path
    -proghack
    -maxplayers
    -comm
    -minmemory
    -protocol
    -zone
    -condebug
    
    There may be more I have not found

    The problem with those is they are - parameters instead of + which valve developer community specifies for stuffcmds. But they may run with stuffcmds ( if that does end up working). Or this means there is another place where these are run that I have not figured out yet

    I will update this thread tomorrow night when I test that stuff. Hopefully there is some good results
     
    Last edited: Feb 12, 2016
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page