Hallo everbody,
I have read most of the posts here, and I would like to ask a few questions about the process of modding the game.
Firstly, I assume that the exe allocates a chunk of memory for the game status, and this chunk is what gets saved out when you save your game. Under this assumption, that chunk of memory has to be initialised when a new game starts, and gets filled in with further data as the game progresses. The values must come from the executable. So this imples some basic correspondence between known patterns of values (from the save file format) and patterns of values buried in the exe.
How do you go about identifying the bytes in the exe which control the factors you want to change? Dmitry's OCL made finding table entries for various data points (techs, buildings, equipment etc) very easy, but you seem to have moved well beyond that.
How do you handle the switches? Is it a jump to a command line parser which then modifies the exe in memory? Or have you actually got source code for the v1.40 build?
I can read through the disassembly of the exe (although my x86 is very rusty) but without a symbol table it's extremely hard to trace which procedures are responsible for which calculations. If you are not working from source code, how are you modifying the game's procedures?
And finally, can I help? I'm not sure what skills I could offer, but I would like to try. What are the main issues waiting to be resolved? (OK, I expect that's a BIG question...)
I reinstalled MoO2 a few days ago after my son asked me what the best game ever was. No contest there! I Googled around, and was delighted to find that it still has an active and intelligent following. Siron helpfully pointed me here from his blog. I still have all the stuff I downloaded years ago - I'm checking through it (my filing was a bit chaotic back then) to see if any of it has relevance today. Once that's out of the way, I'll start looking more seriously at the correspondences between the codespec and the disassembly.
Questions about modding the exe
- Lord Brazen
- Site Admin
- Posts:162
- Joined:Mon Jul 18, 2005 10:16 pm
- Location:Toronto, Canada
- Contact:
Re: Questions about modding the exe
Hi Flenser,
Welcome to our forum.
I'll answer a couple of your questions.
Welcome to our forum.
I'll answer a couple of your questions.
Yes the game allocates chunks of memory for various data that is used by the game. For the most part this data is copied byte for byte to the save game file when you save.Firstly, I assume that the exe allocates a chunk of memory for the game status, and this chunk is what gets saved out when you save your game. Under this assumption, that chunk of memory has to be initialised when a new game starts, and gets filled in with further data as the game progresses.
Most of the values in the save game file are generated by the code in the exe. For the most part there is no correspondence. Its not simple at all.The values must come from the executable. So this imples some basic correspondence between known patterns of values (from the save file format) and patterns of values buried in the exe.
I use a debugger to locate the code related to some aspect of the game I want to modify. Once I find the code the rest is simple.How do you go about identifying the bytes in the exe which control the factors you want to change?
I modified the exe file to add some more code blocks. I altered the command line parser to jump to some code in the new code blocks where it processes the switches and jumps back to continue processing normally.How do you handle the switches? Is it a jump to a command line parser which then modifies the exe in memory?
Nope. No source code for orion2. I only have an understanding of small parts of the exe.Or have you actually got source code for the v1.40 build?
I dont use a symbol table (although there seems to be one in the exe). I modify the procedures the same way I added the switches (see above answer).I can read through the disassembly of the exe (although my x86 is very rusty) but without a symbol table it's extremely hard to trace which procedures are responsible for which calculations. If you are not working from source code, how are you modifying the game's procedures?
You certainly can help. I dont know if there are any issues to resolve. I'm just doing this as a hobby. Progress is slow and I have no real plans or direction.And finally, can I help? I'm not sure what skills I could offer, but I would like to try. What are the main issues waiting to be resolved? (OK, I expect that's a BIG question...)
"Stars are holes in the sky from which the light of the Infinite shine through." - Confucius.
Most of the things you have done so far were related to MP. How about something like an AI-Taskforce? I think you have some clues how to alter the strategy of the AI (you prolly detected the passage in the exe), but I assume that this is not your priority. Other players might be more interested to fix this part of the game....and it seems a lot of work where many players could help to document several test runs of modified AIs....You certainly can help. I dont know if there are any issues to resolve. I'm just doing this as a hobby. Progress is slow and I have no real plans or direction.
I would appreciate any assistance that can be given to get me started editing the ORION2v1.40 exe. I downloaded OCLplus v0.3 and unzipped it into C:\MPS\ORION2, but I'm not sure what to do next. I assumed that I should simply execute OCLplus but nothing seems to happen. I get the following in my DOS box:
OCLplus 'Orion2v140' editor, v0.3 Oct 2005.
Built from original code (c) Dmitry Yulmukhametov, Feb. 2000.
Format: ocl_v021.exe [-e] <filename>
I thought maybe I needed to change <filename> to equal <Orion2v140> or <Orion2v140.exe> but I didn't see a way to do this, and at this point I realize I am just speculating.
OCLplus 'Orion2v140' editor, v0.3 Oct 2005.
Built from original code (c) Dmitry Yulmukhametov, Feb. 2000.
Format: ocl_v021.exe [-e] <filename>
I thought maybe I needed to change <filename> to equal <Orion2v140> or <Orion2v140.exe> but I didn't see a way to do this, and at this point I realize I am just speculating.
Here is a small description how I use it:
1. You should use a different folder when you use it quite often. My folder name is ORIONOCL
2. Copy OCLplus.exe into this folder
3. Generate 2 shortcuts of this OCLplus.exe. I have called them
oclplus extract.exe
and
oclplus modify
4. Edit the command line of these 2 shortcuts
My command lines are:
oclplus extract.exe:
C:\MPS\ORIONOCL\OCLPLUS.EXE -e orb21.txt
and
oclplus modify:
C:\MPS\ORIONOCL\OCLPLUS.EXE mod.txt
5. Hit oclplus extract.exe shortcut and the data is extracted to a textfile called orb21.txt
Edit the txt file and rename it to mod.txt and hit the oclplus modify shortcut.
6. Enjoy
1. You should use a different folder when you use it quite often. My folder name is ORIONOCL
2. Copy OCLplus.exe into this folder
3. Generate 2 shortcuts of this OCLplus.exe. I have called them
oclplus extract.exe
and
oclplus modify
4. Edit the command line of these 2 shortcuts
My command lines are:
oclplus extract.exe:
C:\MPS\ORIONOCL\OCLPLUS.EXE -e orb21.txt
and
oclplus modify:
C:\MPS\ORIONOCL\OCLPLUS.EXE mod.txt
5. Hit oclplus extract.exe shortcut and the data is extracted to a textfile called orb21.txt
Edit the txt file and rename it to mod.txt and hit the oclplus modify shortcut.
6. Enjoy
- Green_Knight
- Posts:61
- Joined:Wed Jul 18, 2007 3:10 am
- Contact:
Return to “Game Modifications”
Who is online
Users browsing this forum: No registered users and 11 guests