The Minimum Industry Value

The Minimum Industry Value; support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

The Minimum Industry Value

Post by Gowron » Sat May 03, 2008 8:12 am

A big topic about a small value ;)


--------------------------------------------------------------------
--------------------------------------------------------------------


One big step closer to resolving the ship scrapping issue :)

As most of you probably know, be default BotF will set a system's industry output to 5 if it's lower than 5.

Formally, this can be written as

IF ( [industry output] < [value1] )
THEN { set [industry output] to [value2] }

with
[value1] = [value2] = 5
by default


Since the game allows relatively large industry outputs, I assumed that [value2] would be stored as 05000000 in trek.exe.
I finally found it after I had checked about 670 out of 691 occurences of "05000000" in trek.exe (Murphy :?)

Fortunately the position of [value1] was very close to that of [value2], else it would have been virtually impossible to find [value1], which is stored as a single byte!

Note that the "remaining turns" prediction above the build queue cannot handle industry outputs smaller than 5 and will treat them as 5. But both the "needed turns" display on the middle screen and the actual incremental will both be correct :)

[Edit]
This issue has been solved, see below :)
[/Edit]


For example, if you build something with a construction cost of 100 in a system with an industry output of 1, then the game will correctly display the number of turns as 100, but if you add it to the build queue (and there's no other building in the build queue), then the build queue will display "20 turns remaining". However, it WILL take 100 turns.


The data:

[value1]
position: 0x411C7
type: integer
length: 1 byte
signed: yes
default value: 5
NOTE: If you set this to a negative value, then the industry outputs of all systems will always be replaced by [value2].


[value2]
position: 0x411D1
type: integer
length: 4 bytes
signed: yes
default value: 5



UPDATE:

Finally I've found the "counterpart" of [value1] with respect to the build queue.

location: 0xF213F
type: integer
length: 4 bytes
default value: 5

Change this value to whatever you change [value1] to, and the remaining turns will be displayed correctly :)




edit: spelling
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 723
Joined: Sun Apr 27, 2008 2:00 am

Re: The Minimum Industry Value

Post by Spocks-cuddly-tribble » Sun Dec 11, 2011 7:09 am

An addition for the Sumary -> Systems list "X Turn(s)" display:

Code: Select all

004418E1                 cmp     edx, 5
004418EA                 mov     dword ptr [esp+400h], 5
My older note wrt the build queue:

0xF1FBE (1byte) seems to be counterpart of [value1] and 0xF213F that of [value2] with respect to the build queue.


EDIT:

AI industry output check (ignores morale)

Code: Select all

00441861                 cmp     ax, 5
00441867                 mov     eax, 5
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

Post Reply

Return to “The Minimum Industry Value”

Who is online

Users browsing this forum: No registered users