Jump to content
jeffryfisher

Historical RT2 Mod

Recommended Posts

You mentioned the building cost as being 0D and that most of the editor functions were available to managers. Do you happen to have a list of these functions as they might be used by the managers in this table? I think some of it can be pulled out based on inference and the order in which things are presented in the strategy manual and other places, but if you compiled a list, please do share!

I have compiled a partial list (I tested some and inferred others) and I will upload it tomorrow when I am at home. I'll also upload the tables I mentioned, as well as some other tables I have found but can't identify their function. I could not find the "Stock Liquidity" ability. I guess the developpers originally meant to include it but never did or took it our during testing. Where I would have expected to appear on the list is actually the "fewer robberies" ability that Bat Masterson has... and the .lng reference is significantly out of synch with the others.

 

I actually found that searching for numbers from the .lng file to be very useful in identifying the tables. At the end of the EXE file there is a list of .lng reference numbers. I assume this list is when you use the /D2 switch to test the file (this is described in the header of the .lng file).

Share this post


Link to post
Share on other sites

Ok, here is a spreadsheet with the extra tables I have found (and only the extra tables or those that I have added to significantly). There are about 10 of them and I identified some of them (about half). If jeffryfisher wants to add this to his spreadsheet, go for it (I would do it myself, but since this is your thread it's best if you keep everything coordinated). I hope some of this is useful to you.

 

The list of manager abilities is in the "ed,man" table. I tested some of these and that is also shown in the table by colour coding.

 

There is also a table related to bridge costs that someone posted about earlier in this thread. I found tables related to station graphics, tycoons, (managers, but I wasn't the only one to find this!), the campaigns, and the verification list for the .lng file when using the /D2 switch as outlined in the header of the .lng file.

 

As I said above, the version number is stored as plain text at offset 0x15B0F8. This would be useful to identify your modified version of the game. Maybe call it version 1.57jf or something. That way it will be obvious when you start up the game which version you are using. It will help keep track of any modified version of the game. Perhaps we could work on an unofficial patch that fixes some of the glaring errors like the misplaced numbers in the conversion table, the ridiculously incorrect availabilities of the Class 232 and TGVx, and the insane speed of the F9 and reliability of the GG1. Whatever the community can agree upon as mistakes maybe? I'm just throwing the idea out there.

Other notes regarding various small things I found in jeffryfisher's tables (additions mostly):
in the “cars” tab the string seems to imply graphics to use
in the “bldg prices” tab the string refers to graphics while the 1 byte integer that follows refers to a thumbnail
in the “managers” tab, the first integer refers to the image of the manager
in the “stabuilds” tab the string refers to the thumbnail
 

In playing around withthese graphics it seems that they are stored as .imb files, but since I am not a computer programmer I do not know how to decode the .pk2 files. I took a look in the hex editor but couldn't see anything that I could identify.

 

If anyone could identify anything else, we'll really be making progress!

EXE Data Skyfire.zip

Share this post


Link to post
Share on other sites

Oh, and I also tried to look into that really annoying bug where the AI begins to replace all trains over the age of 25 and continues to replace them every year (eventually resulting in bankruptcy). This is really annoying in really long games.

 

In the save games there is a table near the end of the file with the trains in (333 bytes long... you can identify it by searching for the names of any named trains you have). It seems trains have three dates associated with them. One is the age of the train (given by a year that it first came into being) and one is the age of the locomotive (given by a year that it first came into service)... the other, I have no idea (also a year). These must be mixed up somewhere in the code and not likely something we can fix. However, it is easy to identify the two columns that are the age of the train and the age of the locomotive. When the AI replaces trains it must look at either the wrong one or update the wrong one because when it updates trains only one of these values changes. If you set the two values equal to each other, it will not replace the same train the following year. So at the very least, every year in january, you can save the game, fix the dates and play for another year. This does work and the AI won't just die after 25-30 years. Kind of annoying though...

 

Now if only someone could actually fix this! Or write a program to do it in a single click even! If there's any programmers reading this, there's your challenge. :)

Share this post


Link to post
Share on other sites
Oh, and I also tried to look into that really annoying bug where the AI begins to replace all trains over the age of 25...

 

In the save games there is a table near the end of the file with the trains... trains have three dates associated with them. One is the age of the train (given by a year that it first came into being) and one is the age of the locomotive (given by a year that it first came into service)... the other, I have no idea (also a year). These must be mixed up somewhere in the code...

Indeed, this has been my theory for several years (that the AI looks at the wrong year). I don't think we can ever track down the code that accesses the wrong offset in some array or record (it would take a fancy debugger and some some pretty ingenious sleuthing to ferret that out of an EXE that was not compiled for debugging).

 

If you set the two values equal to each other, it will not replace the same train the following year. So at the very least, every year in january, you can save the game, fix the dates and play for another year.

 

Actually, you could probably get away with changing the older of the two dates once every 20 years.

 

Now if only someone could actually fix this! Or write a program to do it in a single click even!

 

If the rule for finding the start of the data section can be codified, then a program can be written. I did a program like that to raise all of the rents in SimTower. However, I am too lazy to do this one.

 

BTW, If someone has the energy, I'd also want the program to avoid changing any dates for human-company trains/locomotives. Only the AI should be tricked.

Share this post


Link to post
Share on other sites
Ok, here is a spreadsheet with the extra tables I have found (and only the extra tables or those that I have added to significantly). There are about 10 of them and I identified some of them (about half). If jeffryfisher wants to add this to his spreadsheet, go for it

 

I'll hang onto them until somebody sees an opportunity in one before I incorporate them into my sheets.

 

As I said above, the version number is stored as plain text at offset 0x15B0F8. This would be useful to identify your modified version of the game.

 

I like that idea. I'll have to think on what number to choose. Whatever it is, I don't think I can change the length of the string.

 

Perhaps we could work on an unofficial patch that fixes some of the glaring errors like the misplaced numbers in the conversion table, the ridiculously incorrect availabilities of the Class 232 and TGVx, and the insane speed of the F9 and reliability of the GG1.

 

I've already done all of those except the date of the TGVx.Unfortunately, the TGVx does not obey its data table entry. Instead, it seems to be hard coded.

Share this post


Link to post
Share on other sites
I like that idea. I'll have to think on what number to choose. Whatever it is, I don't think I can change the length of the string.

The version number supports at least two extra characters. I tested that... 1.5601 worked fine. I do not know how many more digits it can handle though. There are quite a few blanks after the 1.56.

 

 

I've already done all of those except the date of the TGVx.Unfortunately, the TGVx does not obey its data table entry. Instead, it seems to be hard coded.

Someone else posted in this thread on how to fix this. I'll repeat it here since I do not know which post it was and do not feel like looking through the whole thread to find it. The relevant offsets are 0x79602 – 0x79609, which are indeed in the middle of the EXE file. I tested it and, yes, it does work. I set it to 1973 and everything worked fine. I have no idea why the dates are there.

 

 

Share this post


Link to post
Share on other sites

Has anyone tried to understand and possible modify the patch before adding it to the game engine?  Just a thought.

Share this post


Link to post
Share on other sites
Has anyone tried to understand and possible modify the patch before adding it to the game engine?  Just a thought.

I don't understand your question. Could you ask it again in different words?

Share this post


Link to post
Share on other sites

Maybe he means to open up the patch in the hex editor to see if it indicates what is being changed... and maybe something could be added to the patch file so that other items (such as the things you discovered and put in your spreadsheet) could get fixed in the process.

Share this post


Link to post
Share on other sites

That was my reasoning as akuenzi stated.  The last patch for RRT2 was done in a hurry and may have less potection built into it.

Share this post


Link to post
Share on other sites
Maybe he means to open up the patch in the hex editor to see if it indicates what is being changed... and maybe something could be added to the patch file so that other items (such as the things you discovered and put in your spreadsheet) could get fixed in the process.

Oh, I just assumed that the patch replaced some files. Maybe I'm wrong.

Share this post


Link to post
Share on other sites

I've just uploaded a revised US History scenario including a new mod and various spreadsheets in the zip file. In particular, I messed with manager salaries, some of them radically. The biggest mover: Siemens. His big electric engine discount belongs in the late game (because electric engines come late to most maps, and because his discount is the biggest engine discount in the game).

 

Anyway, please try it (and my map), and please let me know what you like and what I could do better (and if I missed anything that I screwed up).

Share this post


Link to post
Share on other sites
PORTS: ok, we solved the problems with all factories, however ports as well have their demands dropping to 0 on first delivery and never recovering afterwards and THIS cannot be solved by editing the EXE file... However, I found another way around this problem. The thing is that production and demand for ports is determined through the editor as you create a new Map....That means that the table governing production and demand for ports must be written somewhere in the MAP files. I searched a little and BINGO: On each MAP file there is a data block, starting at 0x8703, which looks exactly like the data blocks for other industries. And, as I suspected, I discovered that the editor failed to write anything where there should be a floating number governing the demand for input cargoes! If you want ports to work properly you then need to open the MAP file before playing the scenario and enter the demand level for each goods manually.....tried it and it WORKS.

 

Best thing is you can do stuff that would otherwise be impossible with the editor: You can for example set your ports to behave like other transforming industries, for example producing 2 goods out of one cotton and one wool, or set your ports to produce a set amount of goods (let's say 2) and at the same time demand other stuff that acts like production boosters (like grain for cattle ranch) etc...

 

I've just verified something else: If I mod the port and then edit the map or other settings (without changing port), then the mod values stay in place. However, I suspect that if I ever messed with imports or exports, then I would need to go back in with a hex-editor to reinstate my demand float.

 

Something else I saw: Port slot #1 looked as if demand was in the correct column.

Share this post


Link to post
Share on other sites

Hello!  I just discovered this thread and am very interested in trying your patch and map, but I can't seem to download the patch from the first page of this thread.  I was able to download your map from the "downloads" section of the site, however, but just wondered about the patch since you say the two are somewhat interconnected.

Share this post


Link to post
Share on other sites
Posted (edited)
On 8/12/2018 at 10:54 AM, jeffryfisher said:

Very cool! If you could also change the introduction dates on military factories, loads and cars, then they could appear in time to be used in the Civil War. Then players could use your patch in place of mine (doing without my other meddling).

If you look at my spreadsheets, the red values are things I changed.

I did this in a non-interference manner. The modifications are in a new exe file which must be put into your installation directory so it finds all the necessary data files. This will allow people to run the regular version for standard games, and run this version for the USHistory map or others if someone else chooses to target the civil war period. I also made the new exe point to a different language file. Since the exe file extends the use of some station buildings, the language file properly reports which cargos are affected in game. Beyond the exe and lng files the zip file contains a comprehensive readme file listing all changes in reasonable detail.

As compared to the EXE provided in the USHistory map collection, this file does not have changes to the housing & townhouses, changes to the locomotives, nor changes to the managers.
 

RT2_Civil.zip for standard CD installations of Railroad Tycoon II - Platinum

RT2_Civil GoG.zip for Gog.com installations of Railroad Tycoon II - Platinum

If I've missed something important for play of the map, let me know.

Edited by htp_rr
  • Like 1

Share this post


Link to post
Share on other sites

Oh yes, the managers. You might enjoy reading the thread where we discussed them. Siemens was what hooked me: He helps with electrics, but his salary was so low that he appeared only early when he couldn't do much. By raising his salary to the top-tier, he appears later when he can be very valuable.

Going forward, I think your patches to the GoG executable will be very valuable since GoG is still selling the game (and the CD is becoming obsolete).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×