Jump to content

Change sides during gameplay


Recommended Posts

I finished the first version of the menu, it lets you switch between each house as well as letting you choose the difficulty while you play. Select the "Debug" button from the options menu in game to access the new features.

Rar Archive Download
Self Extracting Download

(NEW) Installer Download

If you choose to use the installer, it will automatically create a backup to your game directory and restore the original menu files when the uninstaller is run.

Screenshots of the new menu:

Debug1.pngDebug2.png

Debug3.png

Debug4.png

  • Upvote 5
Link to post
Share on other sites

Probably, I just haven't seen the command in a UIL file yet.

I found: GetValueU1Init gNetTechLevel and SetValueU1Special gNetTechLevel in Skirmish.uil, but changing them did not have effect during gameplay.

I finished the first version of the menu, it lets you switch between each house as well as letting you choose the difficulty while you play. Select the "Debug" button from the options menu in game to access the new features.

Rar Archive Download

Self Extracting Download

Nice! But changing the difficulty crashed Dune 2000.

Link to post
Share on other sites

I found: GetValueU1Init gNetTechLevel and SetValueU1Special gNetTechLevel in Skirmish.uil, but changing them did not have effect during gameplay.

Nice! But changing the difficulty crashed Dune 2000.

It's iffy. I had it work numerous times but once or twice it crashed the game.

The values used in skirmish seem to rely on the slider values.

Link to post
Share on other sites

I tried the patch out yesterday and I have a question, if the AI is enabled on the same side as you are on, will you only be able to select one unit at a time, or is that because the sides are being swiched during the game?

Link to post
Share on other sites

I tried the patch out yesterday and I have a question, if the AI is enabled on the same side as you are on, will you only be able to select one unit at a time, or is that because the sides are being swiched during the game?

If a side has AI, while a human controls that side he can only select one unit.

Link to post
Share on other sites

If a side has AI, while a human controls that side he can only select one unit.

Yup, doesn't matter how it happens, the AI actively restricts your control (changing unit groups, allowing you only 1 unit at a time etc). It obviously wasn't intended to allow control by the AI and a player at the same time.

  • Upvote 1
Link to post
Share on other sites

In Red Alert 1 the tech level value for every player is a data member of the HouseClass they are. The multiplayer menus have a global variable used to set the tech level for multiplayer games. In SINGLEPLAYER  the tech level for every house is read in from the level file, defaulting the to the internal mission number.

 

Code for single player. For every house section of the map INI, e.g. [spain] or [badGuy]:

 

AUTO:004DDD36 028                 mov     [ebp+var_24], eax
AUTO:004DDD39 028                 mov     ebx, offset aTechlevel ; "TechLevel"
AUTO:004DDD3E 028                 mov     eax, [ebp+lpScenario] ; INIClass for current scenario
AUTO:004DDD41 028                 mov     ecx, dword ptr ds:ScenarioNumber ; Default value if INI key missing
AUTO:004DDD47 028                 mov     edx, edi ; House name, e.g. Spain or badGuy
AUTO:004DDD49 028                 mov     esi, [ebp+var_24]
AUTO:004DDD4C 028                 call    const INIClass::Get_Int(char *,char *,int)
AUTO:004DDD51 028                 mov     ebx, offset aMaxbuilding ; "MaxBuilding"
AUTO:004DDD56 028                 mov     edx, edi
AUTO:004DDD58 028                 mov     ecx, [esi+2Ch]
AUTO:004DDD5B 028                 mov     [esi+20h], eax
AUTO:004DDD5E 028                 mov     eax, [ebp+lpScenario]
Link to post
Share on other sites

 

In Red Alert 1 the tech level value for every player is a data member of the HouseClass they are. The multiplayer menus have a global variable used to set the tech level for multiplayer games. In SINGLEPLAYER  the tech level for every house is read in from the level file, defaulting the to the internal mission number.

 

Code for single player. For every house section of the map INI, e.g. [spain] or [badGuy]:

 

AUTO:004DDD36 028                 mov     [ebp+var_24], eax
AUTO:004DDD39 028                 mov     ebx, offset aTechlevel ; "TechLevel"
AUTO:004DDD3E 028                 mov     eax, [ebp+lpScenario] ; INIClass for current scenario
AUTO:004DDD41 028                 mov     ecx, dword ptr ds:ScenarioNumber ; Default value if INI key missing
AUTO:004DDD47 028                 mov     edx, edi ; House name, e.g. Spain or badGuy
AUTO:004DDD49 028                 mov     esi, [ebp+var_24]
AUTO:004DDD4C 028                 call    const INIClass::Get_Int(char *,char *,int)
AUTO:004DDD51 028                 mov     ebx, offset aMaxbuilding ; "MaxBuilding"
AUTO:004DDD56 028                 mov     edx, edi
AUTO:004DDD58 028                 mov     ecx, [esi+2Ch]
AUTO:004DDD5B 028                 mov     [esi+20h], eax
AUTO:004DDD5E 028                 mov     eax, [ebp+lpScenario]

 

In Dune 2000 there is no INI file for single player, but there is the mission file (.MIS) that contains the tech levels. I could not find code that looks similar, but I did however, thanks to you, find this by accident:

 

Image debug info:

post-2251-0-78603200-1390475934_thumb.pn

 

It's VA is 004494A7 (change jz to jnz) and it's file offset (DUNE2000.DAT) is 488A7 (hex) where you change 74 to 75 (with for example XVI32 software).

 

edit: More stuff (I believe CCHyper found this one before):

post-2251-0-51578400-1390477146_thumb.pn

 

It are the VA 5178C4 for debug info and 5178C8 for funny blocks, lol. (0 = off, 1 = on)

  • Upvote 3
Link to post
Share on other sites

In Dune 2000 there is no INI file for single player, but there is the mission file (.MIS) that contains the tech levels. I could not find code that looks similar, but I did however, thanks to you, find this by accident:

 

Image debug info:

attachicon.gifinfo2.png

 

It's VA is 004494A7 (change jz to jnz) and it's file offset (DUNE2000.DAT) is 488A7 (hex) where you change 74 to 75 (with for example XVI32 software).

 

edit: More stuff (I believe CCHyper found this one before):

attachicon.gifinfo3.png

 

It are the VA 5178C4 for debug info and 5178C8 for funny blocks, lol. (0 = off, 1 = on)

How did you find these?

Link to post
Share on other sites

How did you find these?

With IDA doing string search on techlevel, accidentally got wrong one but followed the code graph to see it that in the code the game wanted to "print" more stuff. Then I changed a jump from 'if true' to 'if not true' to see what happens. It showed debug info. After that I saw it does this on a if-statement based on static virtual address (5178C4) and then I looked in IDA to see if there are more of these VA closely around this location and so it happened that the next one (4 bytes further = 5178C8) is debug for the funny blocks.

 

I didn't know that these static virtual address in IDA are rather useful, so I'm gonna experiment some more with it. I also found a different VA that gives some more unit info, but it also speeds the game massively up (fps>400). Perhaps this was used to test the AI on longer games. Perhaps I can find the value to slow it down again.

Link to post
Share on other sites

Nothing happens + i need to kill dune process cause nothing else is working after that.

menu added in menus.uib??

This error happens when you don't add..

Trust me i've crash like this a lot of times till I understood it..

Link to post
Share on other sites

Same question, what happens when you click the button?

 

I added an installer to the downloads if you want to try it that way.

There was no button at all, I copied all the files though. 

Link to post
Share on other sites

There was no button at all, I copied all the files though. 

 

 

Nothing happens + i need to kill dune process cause nothing else is working after that.

 

 

menu added in menus.uib??

This error happens when you don't add..

Trust me i've crash like this a lot of times till I understood it..

Try using the installer I added to the other post. 

Edit: is this for the debug menu itself? or for the change difficulty button? I found an issue if you were using the vanilla game with the difficulty menu, and I have updated the files posted to fix it. Please try redownloading and running the installer or extract the fix yourself from the archives.

  • Upvote 1
Link to post
Share on other sites

Try using the installer I added to the other post. 

Edit: is this for the debug menu itself? or for the change difficulty button? I found an issue if you were using the vanilla game with the difficulty menu, and I have updated the files posted to fix it. Please try redownloading and running the installer or extract the fix yourself from the archives.

OK, that new installer is working now. For me, there was no debug button. 

Edited by Shai-Gel98
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...