Jump to content

Historical RT2 Mod


Recommended Posts

Hello, thanks for your answer.

I use "Neo". As a bonus, I can set it to display each byte in decimal (0..255) so my brain can know what the numbers are.

 

It's probably just as well that we don't have too many people modding. Although everyone should be able to fix a bug or two, we might want some configuration management on any "deep" lines of modding like mine. It would be better for me to combine new suggestions into what I've already done than for a dozen branches to break off (except as tests).

 

I wonder how open-source projects manage...

Yes, I can understand that. I, myself, do not try to mod the game but just correct some obvious bugs (like demand for milk in cities and the like). So far, I prefer to keep the game as it is until I really know what I'd like to change...that's the reason why I still do not use your modded EXE file I downloaded with the rest of the docs.

 

 

Oh, I'm not sure that's the rule. The farm's own industrial data should place a date on when fertilizer will be demanded. Aside from that, fertilizer might have a date set in a cargo table. See if those aren't the actual constraints.

Sorry to contradict you here, but I was well aware of the dates problem and took great care of testing this behavior when fertiilizer should be available and demanded by all the farms....even in 1950 I still couldn't get a demand for fertilizer in any farm without a plant on the map.

 

I know that can't be right. I have a map with zero rubber plantations, but rubber is still demanded.

 

Never said it was a general rule! I know that rubber, or coffee and many other stuff can be supplied through ports only without the need for a plantation...so far, only fertilizer reacted like that, that's why I wrote about it since it seems like a strange bug. will run some more tests this afternoon... maybe this is only true for transformed goods (like goods, food, fertilizer...) but not for raw materials like logs, rubber, Iron or wool?

 

EDIT: Just ran some more tests....only fertilizer shows this strange bug. If you click on a farm it will still display the text saying that production will be boosted if you deliver fertilizer, but no demand at the station and they pay peanuts for fertilizer deliveries! However, I found a way around it : If, while working in the editor, you put a fertilizer plant on the map and save, then, you can go back to the map and erase the plant, save again, and this time everything works as intended (as if the plant was still there). 

That was obvious from the address. It's way to low to be in the EXE.

Ok, just wanted to make sure you got it right.

 

I think that most of us are Americans, not English, so we're dialectically flexible. If we can understand Texans, then we can understand you too.

All right, good to know.

 

 

Bye,

 

JC

Link to comment
Share on other sites

that's the reason why I still do not use your modded EXE file

 

Being a power user, you should be able to swap between your own patch and my mod as desired (just change some file extensions). My mod becomes valuable for playing my US History scenario.

 

only fertilizer reacted like that

 

Aha, I misunderstood. Something is missing somewhere else then. It may well be some byte of data that the editor is supposed to copy into the port's data table, and that might be hard-coded.

 

For another very strange bug (see page 2 of this thread), try modding the intro date for (if I recall correctly) the TGV prototype. Any other engine in the game can be modded, but that one refuses to accept an alternate intro date. A scenario can rule it out and then bring it in by event, but the default schedule seems to be hard-coded. Even weirder, I can't find a candidate "09 63" (1955) anywhere in the EXE that could be the "hard code".

 

EDIT: Just ran some more tests....only fertilizer shows this strange bug. If you click on a farm it will still display the text saying that production will be boosted if you deliver fertilizer, but no demand at the station and they pay peanuts for fertilizer deliveries!

 

Maybe fertilizer is the only "booster" commodity not available from the beginning of the game. The programmer might have hard-coded grain to be on and fertilizer to start with a factory trigger, forgetting the possibility of a port. My own test would have been to combine the map's "allowed cargoes" flag with the cargo table's intro year.

Link to comment
Share on other sites

Being a power user, you should be able to swap between your own patch and my mod as desired (just change some file extensions). My mod becomes valuable for playing my US History scenario.

True. At the moment though, I'm in the middle of creating a new map to be used with Vanilla RRT2 (so that everybody can play it), and I want first to correct the most annoying bugs in the EXE file. I will try your historical US scenario as soon as I'm done with it and will use your modded EXE file (with some corrections that are needed like 2nd input demand in factories).

 

By the way, I just found where some of the data blocks for the bridges were located. I think this might be of interest to you. Saddly, the data for bridgrs seem to be spread all over the EXE file and so far I can only mod the starting date for Steel/Stone bridges as well as the cost of all the bridges.

 

 at 0x69EF7 you will find the starting date for the steel bridges 58 07 (1880) and 16 bytes further the starting date for stone bridges 30 07 (1840). There doesn't seem to be a starting date for the wooden bridges in the same area (maybe wooden bridges are on by default). I tried it and it works. I was able to get steel bridges in 1820. I quickly looked at the other blocks of data around but did not find anything of use.

 

starting at 0x13CE78 you will find a block of data containing all the prices for the different types of bridges. Each is stored in a block of four bytes and there are four types of bridges (Wood, steel, stone, over the sea) each with double and single track version (YES! Even the wooden bridge has a cost for double track which is 90 000 but I haven't yet found how to enable it in the game....must be a flag somewhere. So the whole  block is 32 bytes long (4bytes x 4bridges x2 track versions)

 

It goes Wood/double , wood/simple, steel/double, steel/simple, stone/double, stone/simple, sea/double and sea/simple.

 

EDIT: I might have inverted the order between the steel and stone bridges (can't remember and do not have the EXE file opened just now) but you get the Idea.

 

Hope this will help you,

 

bye,

 

JC

Link to comment
Share on other sites

I want first to correct the most annoying bugs in the EXE file.

 

Please log your fixes and paste a list here. I will probably want to fix most of the same things in my own mod (and will then upload a revision).

 

I will try your historical US scenario as soon as I'm done with it and will use your modded EXE

 

Very cool. Be aware that US History is equivalent to a full campaign in a single map. Also, there are four starting positions: North US, South US, Canada or Mexico. You must choose when you start your company.

 

By the way, I just found where some of the data blocks for the bridges...

 

Wow, I was never able to be sure of those.

 

Even the wooden bridge has a cost for double track

 

Ah, but is there a graphic image? If you turn it on, then it might just crash the game. Worth a try though. Even more exciting would be double sea-crossing.

Link to comment
Share on other sites

Please log your fixes and paste a list here. I will probably want to fix most of the same things in my own mod (and will then upload a revision).

Ok, I'll do that.

 

Very cool. Be aware that US History is equivalent to a full campaign in a single map. Also, there are four starting positions: North US, South US, Canada or Mexico. You must choose when you start your company.

Sounds very interesting. 

Wow, I was never able to be sure of those.

it was not very difficult : only 8 occurrences of the date 1880 in the whole EXE and only one occurrence for 225 000 (cost of double tracked steel bridge)

 

 

Ah, but is there a graphic image? If you turn it on, then it might just crash the game. Worth a try though. Even more exciting would be double sea-crossing.

I just don't know. I did not even find the flag to enable the double tracked wooden bridge. All i know is the fact that there is a cost associated with it. Bridges data seem to be scattered all around the EXE file.

 

 

 

You're absolutely right, it does also depend on game year.  I did some of my own experimenting and observed similar things, especially that the underlying formula was 'extremely complex.'  However, I did NOT notice that the rate of the value change depended on the distance.  In my experiments, I used lumber.  You used passengers.  Could it be that this effect changes depending on what is being hauled?  I'd be curious to have your thoughts on another thread where these things were explored:  http://forum.dune2k.com/index.php?showtopic=23978

Hello Akuenzi, I just had some time yesterday to look closely at the data you collected about lumber. It matches closely what I found for coal (this is not very surprising since their distance factor is nearly the same: 0.21 for coal and 0.25 for lumber). Indeed, even in your own data there IS a DROP in the rate at which the value increase with distance after 20 cell.

 

Here is what I get using some of your data points:

 

What follows is the value for one single car of lumber, starting at 5, 10, 20 and 30 cells from its destination, at 2 different dates ( I chose 1820 and 1900).

 

 - 1820:  5/7k   10/17k    20/47k    30/65k

 - 1900:  5/6k   10/14k    20/33k    30/39k

 

Here we can see that, in 1820, going from 5 cells to 10 cells (100% increase in distance) the value went up from 7k to 17k ( 142% increase in value). and from 10 to 20 cells (again a 100% increase) the value went up from 17k to 47k (176% increase). All in all, going from 5 to 20 cells, the distance travelled increased 4 times while the value increased roughly 6.5 times.

 

we can make the same calculation for the year 1900 : from 5 to 20 cells, the value increases 5.5 times.

 

This is consistent with what I had found: from 0 to 20 cells, whatever the cargo hauled, the value increases steeply.

 

However look at what happens after 20 cells:

 

In 1820, the value of lumber goes up from 47k to 65k (38% increase) while the distance increases 50% from 20 to 30 cells! It's even worse in 1900 with the value increasing only 18% while the distance is increased by 50%. To put it in another way, in 1900, you get 19k for traveling  10 cells between 10 and 20, but only 6k for traveling 10 more cells up to 30 cells!

 

This is what I call a drop in the rate of increase of the value with distance. You only tested up to 30 cells but I went as far as 450 cells in increments of 50 cells. I found the exact same behavior for coal, that, after 20 cells, the increase in value is much slower than the increase in distance and the rate of increase gets worse as the distance increases (though it quickly tends toward an asymptotic value). Bottom line is: don't haul coal or lumber on the other side of the map it's not worth the trouble!

 

Note that this is not true for all cargo. As I said, early on, value for PAX and mail increases much faster than distance. After 100 cells it rises exponentially. Example: in 1820, value for one car of mail is 344k at 100 cells and 3.766k at 450 cells....more than 10 times the value for only slightly more than 4 times the distance!

 

However, whatever the cargo hauled, as time passes there will be a point when all cargo shows the same behavior as coal or lumber. the higher the distance factor, the later this will happen but it will eventually happen. For example, in 2000, even the value for mail increases slower than the distance travelled, though, by this time engines are so fast that you'll still benefit from long distance runs ....but this time it's not because of the increased value but rather because by keeping distance long enough demand level will not drop as fast.

 

Will post more about this later.

 

BYE,

 

JC

Link to comment
Share on other sites

Did you separate distance-value from time value by using teleportation? If "playing fair" and running a train overland, then some of what you're seeing might be the time needed to accelerate to full speed (i.e. a very short distance is slow, paying poorly because the train never reaches full speed).

Link to comment
Share on other sites

Did you separate distance-value from time value by using teleportation? If "playing fair" and running a train overland, then some of what you're seeing might be the time needed to accelerate to full speed (i.e. a very short distance is slow, paying poorly because the train never reaches full speed).

These were data collected by Akuenzi but I used the same method as he did to ISOLATE the distance factor: I looked at the theoretical value of the cargo as the train was just leaving the station. Of course, in a real game you'd have to take into account acceleration and time it takes to go from one station to the other to correctly evaluate your profit/unit of time. (though, for very long distance, acceleration would not change the result by too much).

 

But in these tests, we just wanted to understand the influence of distance on the value of a given cargo. Since the value was checked immediately as the train started on its destination, speed, acceleration, even the rot factor of the given cargo was irrelevant. These data just show you that, in 1820 for example, a car of lumber leaving its station at 20 cells from its destination is valued 6.5 times more than the same cargo starting from 5 cells.....what you actually get on train ariival might be different of course, since it will depend on train average speed and rot factor of the given cargo for the time period. But, that's not the point here.

 

EDIT: And also, before you ask, I only checked the value of freshly created cargo immediately picked up by a train before it had time to rot at the station. And since Akuenzi's data is quite consistent with mine, I guess he did the same.

 

 

By the way, I just started playing your US History scenario. I'm having a lot of fun with it. Date is now 1846 and I'm the only railway left in northern US after I merged Cleveland/Columbus. I have no more room for expansion at the moment (I'm waiting for some territory to open). my PNW is 12M after 11 years playing and I'm in the black (I no longer risk a margin call from now) so I'm not doing too bad. I started very boldly by creating a company with a minimum of outside investment ( I don't do that usually) but I wanted to own as much of my company as I could from the start....It paid off in the end, since with only 700 000 in cash at the begining I was still able to create an extremely lucrative line between Chicago and St Louis, with enough left to plop a depot in NY and Boston to keep the AI away for further expansion on the East coast, which happened 2 years later.

 

St Louis is now the largest city on the map and has outgrown NY. Boston is still a village of only 3 houses, but Baltimore has grown quite big as well. I still need to connect the coast to my main line which extend from Kansas City to Pittsburg and Buffalo, via St Louis, Chicago, Cincinnati, Indianapolis, Cleveland and so on.

 

Bye,

JC

Link to comment
Share on other sites

Jean-Christophe,

 

Thanks so much for the 'primer' on Hex editing.  I downloaded the program and figured out how to find addresses and the like.  I also was able to see what you are describing, how the digits are in reverse, etc.  Wow -- still looks quite over my head, so I don't imagine I'll be making too many forays into hex editing.  I'll be doing good if I can figure out how to make the changes you mentioned above.  Still, thanks for taking time to help me get started!

Link to comment
Share on other sites

First, Industries : Some of you may have noticed that, with the exception of steel mill, all the industries in the game using more than one input cargo (cannery, auto factory, munition factory etc..) had a demand for the second input that immediately dropped to zero after the first delivery and never recovered. This is because, the floating number for demand of the second input is in the WRONG place!

 

Look at the EXE Data.ods provided by Jeffryfisher in the OP and open the CONVERSIONS table. The column N which is labeled as "Demand?" of input 2 is in fact the "BOOST" factor of input2! Demand for input2 should go in column P (look at the steel mill)! In fact, Datas for input 2 match exactly datas for input 1, that is, columns L to P for input 2 works exactly the same as columns G to K for input 1.

 

So, for exemple,  if you take the auto factory, the demand for tires (which is 2.5) should be moved into column P, that is 5 bytes further.....As it is now, tires would provide a production boost of 250% more autos, if only the auto factory was set as a raw producer (with a 1 in column D) wihich it is not, hence this number has currently no effect.

Jean-Christophe,

 

Okay, I want to make sure I’m doing this correctly.  Begging your patience with a novice at this, could you please let me know if I’m on the right track in fixing these things?  Following up on your auto factory example, you said the “2.5” needs to move over five bytes to have its proper impact, similar to how things work with the steel mill.  Here is what I see in the exe file for the auto factory, if I’m at the correct address:

 

0x141C19 = 20

0x141C1A = 40

 

The 20 is a ‘32’ and the 40 is a ‘64.’  In Jeff’s spreadsheet, the 32,64 equates to 2.5… if I’m reading it correctly.  So… now I need to move this ‘2.5’ five bytes over to the right.  That would put these same items at the following addresses:

 

0x141C1E = 20

0x141C1F = 40

 

Do I have this correct?  Do I replace the original values at 0x141C19 and 0x141C1A with zeroes?

 

EDIT: And also, before you ask, I only checked the value of freshly created cargo immediately picked up by a train before it had time to rot at the station. And since Akuenzi's data is quite consistent with mine, I guess he did the same.

That is what I did as well.  I set up my tests to make sure the train would be immediately full right at the start, so that no time elapsed before it left the station.  It also involved restarting the scenario each time I ran a different test.

Link to comment
Share on other sites

You got me curious so I did some more tests today and just solved the problem you had with house not recovering their demand for goods! I discovered that, for all the industries (houses included), demand will drop to 0 and never recover if demand value is less than 1.00 !! you had set the demand for goods at 0.5 and that was the problem....I changed it to 1.00 and several other values over 1.00 and it worked perfectly....mail production was boosted and even villages with only one or two houses would demand goods and the demand would recover with time.....So, demand just need to be set at 1 or over, not 0.5. However, the cure might be worse than the illness here because with a demand value of 1.00 even the smallest village will crave for goods so much that the demand is very hard to quell !! with cities and metropolises it is even worse since the overall global city demand is added to all the demands from all the houses!! Might be a balance breaker!

 

This also led me to discover that some industries like produce farms or rubber plantations shared the same problem. Demand for fertilizer was set at 0.5....I ran some test and discovered, as I suspected, that demand for fertilizer also stayed tanked at 0 after the first delivery (must confess that I had never noticed this before, but all  tests proved it was the case! ). I changed the demand to 1.00 (like grain farms) and now it works perfectly.  I then proceeded to change all demand value of less than 1.00 into the minimum of 1.00 (was the case for rubber in weapon factory, sugar plantation etc...)

Pardon my ignorance, but where are the 'demand' factors in Jeff's spreadsheet?  I see the 0.5 amounts (and others, such as 0.4, 0.2, etc.) in columns F, I, and N.  I think these are titled 'boost' or 'output,' and they are found on the 'Conversion' tab.  Are these demand?  Also, where do you fix the demand for goods?  When I look at the 'House' items on the 'Conversion' tab, I see labels for 'early pax, mail, mid pax, and late pax.'  I don't see anything about goods.  Or am I on the wrong tab?

Link to comment
Share on other sites

In my spreadsheet, I created some "alt" tabs so I could record my modded values without clobbering (any more of) the values from patch 1.56. Those alt tabs are way to the right in a long chain of tabs, so you may not be able to see them without scrolling right.

 

House (not village) demand for goods is one of my mods, so it appears only on the "AltConv" tab.

 

BTW, In case it's not clear: I used the word "conversion" to refer to the conversion of one type of cargo to another in a building. I could probably think of a better name now, but I hadn't decrypted all of what it contained when I first named it.

Link to comment
Share on other sites

I think I'm going to have to re-download your spreadsheets, as I don't see the tabs you're referring to.  These are the ones I have in there currently:

 

- Bldg Sched

- Locos

- Cars

- Cargo

- 140AA0

- Conversions

- Bldg Prices

- 14F9F0

- 14FC64

- StaBuilds

 

EDIT:  Yep -- that was it.  Now I see your modification for 'goods.'

Link to comment
Share on other sites

Jeff,

 

Have you ever found anything in the EXE file that impacts the passage of time (ie, either to slow down or speed up how quickly one year passes to the next)?

 

One other question:  How does one convert between decimals and hex?  For example, in your 'AltCargo' tab, the 'demand' for milk is 0.12.  In the exe file, this somehow equates to '8F C2 F5 3D'.  How does that work?  In your 'AltConv' tab, you indicate a key to determine boost levels.  The numbers 64,64 equates to 3.0.  In hex this would be '40 40.'  Can you explain how this works?

Link to comment
Share on other sites

The 20 is a ‘32’ and the 40 is a ‘64.’  In Jeff’s spreadsheet, the 32,64 equates to 2.5… if I’m reading it correctly.  So… now I need to move this ‘2.5’ five bytes over to the right.  That would put these same items at the following addresses:

 

0x141C1E = 20

0x141C1F = 40

Do I have this correct?  Do I replace the original values at 0x141C19 and 0x141C1A with zeroes?

usually, when hex-editing, you do not move values within the file. you just change them. for example, you could replace the 32,64 by 48,64. but it stays at the same place. for learning it would probably be easier to start with editing full numbers, like the entry years for engines or some price values. it's more obvious then, that you just change the data.

Link to comment
Share on other sites

Jeff,

 

Have you ever found anything in the EXE file that impacts the passage of time (ie, either to slow down or speed up how quickly one year passes to the next)?

No. The scaling factor is probably in there somewhere (or tucked into the saved game file after a scenario starts). I only found tables of data where I could recognize repeating patterns of meaningful numbers (such as dates).

One other question:  How does one convert between decimals and hex?

I recommend downloading a hex editor that lets you change its display from hex numbers (base 16) to decimal numbers (base 10)

  For example, in your 'AltCargo' tab, the 'demand' for milk is 0.12.  In the exe file, this somehow equates to '8F C2 F5 3D'.  How does that work?  In your 'AltConv' tab, you indicate a key to determine boost levels.  The numbers 64,64 equates to 3.0.  In hex this would be '40 40.'  Can you explain how this works?

0.12 is a floating point number. It took me a long time to discover how to recognize them. Each is four bytes. I don't completely understand the structure, but there's a mantissa and an exponent. My hex editor has a tool in which I can type any four byte sequence and have it show me what its float interpretation looks like. I can't do them in my head, but there's one tab where I listed several common ones (located just to the right of my column headers).

 

For numbers near 1, the last byte in a float will be in the vicinity of decimal 63. Therefore, if you see a lot of four-byte entities ending with values like 62, 63, or 64, then you probably have floats. The x3D you cite equates to 61.

Link to comment
Share on other sites

usually, when hex-editing, you do not move values within the file. you just change them. for example, you could replace the 32,64 by 48,64. but it stays at the same place. for learning it would probably be easier to start with editing full numbers, like the entry years for engines or some price values. it's more obvious then, that you just change the data.

Correct, but if a number has been entered in the wrong field (where it's unused or misinterpreted), then one may replace it with zeroes and then paste a copy of it in another field where it belongs (where it will have its desired effect).

 

In this case, the original game seems to have misplaced some of the demand recovery numbers for some of the secondary industrial inputs. The numbers landed in a field that the program uses for commodities that boost production (such as the grain that boosts cattle). The field that actually controls the demand for a second process input was all zeroes for each two-input process except steel. By "moving" the numbers (actually swapping values between fields), the intended behavior can be introduced to the game.

 

It feels good to be able to debug a program that has been making an error (albeit a small one) all this time.

Link to comment
Share on other sites

0.12 is a floating point number. It took me a long time to discover how to recognize them. Each is four bytes. I don't completely understand the structure, but there's a mantissa and an exponent. My hex editor has a tool in which I can type any four byte sequence and have it show me what its float interpretation looks like. I can't do them in my head, but there's one tab where I listed several common ones (located just to the right of my column headers).

 

For numbers near 1, the last byte in a float will be in the vicinity of decimal 63. Therefore, if you see a lot of four-byte entities ending with values like 62, 63, or 64, then you probably have floats. The x3D you cite equates to 61.

You can't do them in your head... :)  Wow, you're not kidding!  I did a couple web searches on this and it's all I can do to understand it.  However, I did find a couple web sites that might help us convert the decimals.  This one gives us the hexadecimal conversion for a decimal value entered:

 

http://babbage.cs.qc.cuny.edu/IEEE-754.old/Decimal.html

 

This site attemps to explain how to convert from decimal to hexadecimal:

 

http://tfinley.net/notes/cps104/floating.html

 

It's kind of cool stuff to somebody that barely has to use base 10 numbers on a daily basis (I'm an accountant).

Link to comment
Share on other sites

Another addition was made to Jeff's mod spreadsheet this past week, which I'm assuming he'll post when he's ready.  The addition involves a table for the managers in the EXE file.  The table has their salaries and their various costs (such as reduced stock prices by X%) and benefits (such as reduced fuel costs by X%).  I had some discussion with him via email today.  With his permission, I'm posting part of our exchange in the event any would be interested.  For me it's a learning experience since I don't know much about computers and hex codes, etc.  In the off chance that I'm not the only 'dummy,' maybe someone else might benefit from it as well.  :) In the email correspondence below, my text is in red, and Jeff's responses are in blue.

 

1/2/2013 Email - 12:00am (to Jeff)

Just wanted to pass along something I've been working on.  I've had a lot of fun looking over your EXE mod file.  The past few days as I've had some time off, I tried my own hand at poking around the EXE file.  Attached is a tab you might want to add to your spreadsheet.

 

However, I'm a novice when it comes to proper terminology on things like 'bytes' or 'floating' this-or-that.  So, I thought I'd send it to you the way I put it together, and you can modify it as you see fit to get the appropriate terminology.  I also used a lot of color coding in there to help me figure out what each code meant, which you can remove if you'd like.  Finally, I cross-compared the codes and related impacts to the strategy guide and two FAQ guides, noting differences between them in the cell notes.

 

The spreadsheet tab is basically the table of managers used in the game, with the listing of their salaries, and related 'talents' or 'impacts' by their hiring.  I learned that the table doesn't have their signing bonus, which must be a 'programmed' function that's basically 1/2 of their regular annual salary (rounded down).  I haven't tested any mods to this particular area, but I think I was able to decipher most of the codes and impacts listed in here.

 

If we truly can modify the managers, and if more impact codes could be deciphered, it could be a lot of fun modding this particular area.  Somewhere we can probably also change their names (maybe that's in the .LNG file?)  Please let me know what you think!

 

1/2/2013 Email - 12:16pm (from Jeff)

> I tried my own hand at poking around the EXE file.  Attached is a tab

> you might want to add to your spreadsheet...

 

Indeed! This is good stuff. Your talent code key is very valuable as is. Led by what you have, I'll dig the bytes out myself so I can lay them out in the same format (and as decimal values) as on my other tabs.

 

However, your sheet with all of its colors can still stand on its own.

 

> Finally, I cross-compared the codes and related impacts to the

> strategy guide and two FAQ guides, noting differences between them in

> the cell notes.

 

Daniel Willard has quite a discrepancy! Did you mod him long ago to make him available in the end game? I'll have to look him up in my own EXE to see what's happening.

 

The amount of impact is just a signed integer (-50 .. +50), usually used as a percent. As such, it's not really a code, just an arithmetic number.

 

The leading 5 bytes are puzzling. The 5th byte is obviously counting the managers from 0 up (probably to decimal 39). The first 4 bytes look like a pair of 2-byte values. With decimal values ~1285, they might be indexes into the LNG file (e.g. Name and Bio).

 

1/2/2013 Email - 3:24pm (to Jeff)

> Indeed! This is good stuff. Your talent code key is very valuable as is.

 

Thanks!... assuming it's accurate.  Like I said, I didn't test any of these.  Everything was pretty much determined by inference, based on what the strategy guide and FAQs said each manager did.

 

I'm reasonably certain the talent code key could be expanded (by inference) in a few areas, especially in the area of revenues, based on the order in which they are presented in the strategy guide and other places (including one of the tabs in your spreadsheet).  Even of the order of items above the revenues follow the same order that I found in the .LNG file.  I'm not certain what code # 21 is, but based on the order in the .LNG file, perhaps it is "stock liquidity."  But what in the world is that?  I don't remember seeing anything in any of the documentation I have that talks about this.  And it's definitely separate from stock prices, credit rating, prime rate, or merger premium, all of which have their own terms.

 

Makes me wonder just how many codes might be available for these managers to impact.  Do you suppose that most of the functions available in the event editor are available?  Probably needs some experimentation to figure it out.

 

> Led by what you have, I'll dig the bytes out myself so I can lay them

> out in the same format (and as decimal

> values) as on my other tabs.

 

Cool -- thanks!  I didn't know enough about 'hexes' to do this part.

 

> Daniel Willard has quite a discrepancy! Did you mod him long ago to

> make him available in the end game? I'll have to look him up in my own EXE to see what's happening.

 

Mr. Willard isn't the only one with discrepancies.  There were a surprising number of discrepancies, some of them even going in the opposite direction as to what was intended.  As for 'modding him,' the answer is no.  I'm too new at this to be doing any modding, though I did make a couple tweaks based on what was posted on the forum recently by jcco.

 

> The amount of impact is just a signed integer (-50 .. +50), usually

> used as a percent. As such, it's not really a code, just an arithmetic number.

 

A 'signed' integer.  Okay, I understand the front end of that, and know how to get the hex to become a +25 or +30 or +50, etc.  It's the negative part I didn't understand.  It seems to start at the opposite end.  I don't know much about hex, but it appears that only up to 255 fits within the byte, based on how the letters and numbers work together.  The negative number appears to be a count backwards from 256.  If the hex number works out to a decimal of 246, then it apparently means for it to be -10 (or -10%).  Is this how a 'signed integer' is supposed to work?

 

> The leading 5 bytes are puzzling. The 5th byte is obviously counting

> the managers from 0 up (probably to decimal 39). The first 4 bytes

> look like a pair of 2-byte values. With decimal values ~1285, they might be indexes into the LNG file (e.g. Name and Bio).

 

I was puzzled by that, too.  There's obviously a pattern, and I too wondered if they weren't intended to somehow 'link' or 'reference' these to some other file in some fashion.  Maybe it does go to the LNG file, but if '1285' is one of them you came up with, the LNG file might not be it.  Line 1285 in the LNG file reads, "Assuming chairmanship of another company." -- Not exactly the name of one of these fellows!  The manager names and bios seem to start around line # 1456 in the LNG file.

 

Have you ever tried to unpack some of the other files with the game other than the EXE file?  I'm thinking of the PK2 files.  Not knowing enough about computers, I don't know if these files are of the type that they'd even have anything that could be modded in them.

 

Maybe rather than emailing I should be doing this on the forum so that others have the benefit of your response.  If you reply via email, I can cut and paste everything into the forum if you'd like.

 

Fun stuff!  I'm thinking I probably should have taken up computer science rather than accounting.  :)

 

1/2/2013 Email - 6:58pm (from Jeff)

> I'm reasonably certain the talent code key could be expanded (by

> inference) in a few areas... Do you suppose that most of the functions

> available in the event editor are available?

 

I think it's probable that all editor effects are accessible via manager codes. Not only that, but if we look in map files, we may find the same codes used in events.

 

> I understand the front end of that, and know how to get the hex to

> become a +25 or +30 or +50, etc.  It's the negative part I didn't

> understand.  It seems to start at the opposite end.

 

You're catching on. Google "twos compliment".

 

> I was puzzled by that, too... Maybe it does go to the LNG file, but if '1285'

> is one of them you came up with, the LNG file might not be it.  Line

> 1285 in the LNG file reads, "Assuming chairmanship of another

> company." -- Not exactly the name of one of these fellows!  The

> manager names and bios seem to start around line # 1456 in the LNG file.

 

Hmmm... Maybe my head-arithmetic was off. If we play with these numbers, then we'll see what changes (name, bio, picture, or something unexpected).

 

> Have you ever tried to unpack some of the other files with the game

> other than the EXE file?  I'm thinking of the PK2 files.

 

No, I've only found meaning in the EXE and LNG files. I've looked into some DLLs, but found no joy there.

 

> Maybe rather than emailing I should be doing this on the forum so that

> others have the benefit of your response. If you reply via email, I

> can cut and paste everything into the forum if you'd like.

 

That would be fine.

Link to comment
Share on other sites

I actually worked through this over the christmas holidays but didn't post it until now.

 

The first 5 bytes in the manager table are references to the .lng file. The first two bytes are the manager name (1456 for Ames Oakes). The second two bytes are for the "description" (1457 for Ames Oakes). The 5th bytes is a reference to the image for that manager. All of this can be tested by switching the numbers around.

 

Likewise, all of the featurs available in the editor seem to be manager skills. Switching an ability to "0D" gives a reduction in building buying and it does work! Though the game lists the price the same, when you actually buy it, the amount of money spent is reduced. I'm not sure the significance of some of these abilities though and how they relate to managers. I tested several. Indeed you can set it so a certain manager makes a train immediately available (or not at all)... but this doesn't seem to be useful.

 

There is another table starting at offset 0x150550 that is 16 bytes wide and 350 entries long that also has something to do with manager abilities and editor functions. I added my own tab to the spread sheet and will share it with everyone once my account is approved. :)

 

Other things I found was the table of the tycoon abilities starting at offset 0x151E88. It is 35 bytes wide and has 41 entries (1 for the generic unassigned player and 40 for the tycoons in the game). It contains a reference to the tycoon's image, their tendencies, location (us,euro,world) and references to the .lng file with their names and descriptions.

 

There is also a table at offset 0x152421 that relates to the campaigns (the maps to use, the text, the choices, etc...)

 

I also found where the version number is stored (as text near offset 0x15B0F8) and how to reassign some of the graphics (for example taking ONE of the commerical buildings and making it into a specific type of factory), but I am still testing that. I'll post more later when things are more well sorted and tested.

Link to comment
Share on other sites

I've zipped and uploaded an updated modding spreadsheet containing a new managers tab (see the OP on page 1).

 

For the most part, the order of the ability codes follows the order of editor effects. However, there's some irregularity around security, prime rate etc. It will take some in-game testing to sort those out.

Link to comment
Share on other sites

Thanks Skyfire!  It looks like our minds were on similar wavelengths over Christmas.  :)  The next area I wanted to look at was the tycoons, so what you provided is very helpful.

 

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!

 

As for the discrepancies, you could be right.  I just went through both FAQs and the strategy guide, and a few things seemed different from what I could observe in the EXE file.  Maybe when Jeff looks it over he'll see what I missed.

 

Thanks!

Link to comment
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...