How to add a Science and technologies

Adding a Science and Technologies; support/discussion/questions

Moderator: thunderchero

User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

How to add a Science and technologies

Post by Peter1981 »

PART 1:- Chaging the number of technologies per science area:

techtree.tec entry example:-

Code: Select all

S  i  l  i  c  o  b  i  o  l  o  g  y  .  .  . 
53 69 6c 69 63 6f 62 69 6f 6c 6f 67 79 00 00 00
.  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
.  .  .  .  .  .  .  .
00 00 00 00 00 00 00 00

11th techtree.tec index (little endian)
0b 00                                              *this column must be in order 00 01 02...

b  i  o  .  .  .  .  .  .  .  .  .  .
62 69 6f 00 00 00 00 00 00 00 00 00 00

Biotech     Science area:- 
00            00=biotech,
              01=computer,
              02=construction,
              03=energy,
              04=propulsion,
              05=weapons,
              06=sociology
11th science area index
0b

Always the same for every entry (unknown)
17 40 00

28580 RP's research points cost (8byte long little endian)
a4 6f 00 00 00 00 00 00

0x810c techdesc.tec address (4byte little endian)
0c 81 00 00

Trek.exe changes needed:

the following is an example for an extra 5 technologies in each science area. ie. techs 0-15
if you want to have a differing number choose the following appropriately

09 is one less than highest technology level requires
0A is the highest technology level requires
0B is the start of Future Technology or one more than the highest technology level required
ie if you want 12 technology levels then 09->0B, 0A->0C & 0B->0D

The following changes are assuming an extra 5 technologies (NOTE: You must add all techs to all fields for this to work)

Code: Select all

0x23816	replace	66 83 FA 0B    with 66 83 FA 10 
0x239c5	replace	80 FB 0B       with 80 FB 10 
0x51bf0	replace	66 83 FB 0B    with 66 83 FB 10
0x51f9f	replace	83 FD 0B       with 83 FD 10
0x5202a	replace	66 83 FE 0B    with 66 83 FE 10 
0x520f8	replace	66 83 FB 0B    with 66 83 FB 10 
0x521a7	replace	BA 0A 00 00 00 with BA 0F 00 00 00
0x521b3	replace	8D 45 F6       with 8D 45 F1 
0x521b6	replace	83 ED 09       with 83 ED 0E 
0x52267	replace	83 E9 0A       with 83 E9 0F
0x522b7	replace	83 E9 0A       with 83 E9 0F
0x52427	replace	66 83 FA 0A    with 66 83 FA 0F
0x5242d	replace	BA 09 00 00 00 with BA 0E 00 00 00
0x5268a	replace	83 F8 0B       with 83 F8 10
0x526e7	replace	BA 0A 00 00 00 with BA 0F 00 00 00
0x526F7	replace	8D 41 F6       with 8D 41 F1
0x526FA	replace	83 E9 09       with 83 E9 0E
0x529e7	replace	83 FA 0B       with 83 FA 10
0x52bce	replace	80 FB 0B       with 80 FB 10
0x52dbf	replace	80 FB 0B       with 80 FB 10
0x530A3	replace	4D             with 71		   *this is the total number of technologies
0x534ac	replace	88 C2 8D 04    with 0F B6 C0 6B 
						  95 00 00 00    with C0 10 90 90    *use 10 for 15 technology levels
						  00 29 D0 C1    with 90 90 90 90 
						  E0 02 29 D0    with 90 90 90 90 
0x54608	replace	66 83 FB 0B    with 66 83 FB 10
0xd1e17	replace	66 83 FA 0A    with 66 83 FA 0F
0xd1e27	replace	83 E8 09       with 83  E8 0E
0xd1e46	replace	BA 0A 00 00 00 with BA 0F 00 00 00
0xd5778	replace	80 FB 0B       with 80 FB 10
The following changes are assuming an extra 10 technologies (0-21 or 20 total Tech levels)

Code: Select all

0x23816	replace	66 83 FA 0B    with 66 83 FA 15 
0x239c5	replace	80 FB 0B       with 80 FB 15 
0x51bf0	replace	66 83 FB 0B    with 66 83 FB 15
0x51f9f	replace	83 FD 0B       with 83 FD 15
0x5202a	replace	66 83 FE 0B    with 66 83 FE 15 
0x520f8	replace	66 83 FB 0B    with 66 83 FB 15 
0x521a7	replace	BA 0A 00 00 00 with BA 14 00 00 00
0x521b3	replace	8D 45 F6       with 8D 45 F1 
0x521b6	replace	83 ED 09       with 83 ED 13 
0x52267	replace	83 E9 0A       with 83 E9 14
0x522b7	replace	83 E9 0A       with 83 E9 14
0x52427	replace	66 83 FA 0A    with 66 83 FA 14
0x5242d	replace	BA 09 00 00 00 with BA 13 00 00 00
0x5268a	replace	83 F8 0B       with 83 F8 15
0x526e7	replace	BA 0A 00 00 00 with BA 14 00 00 00
0x526F7	replace	8D 41 F6       with 8D 41 F1
0x526FA	replace	83 E9 09       with 83 E9 13
0x529e7	replace	83 FA 0B       with 83 FA 15
0x52bce	replace	80 FB 0B       with 80 FB 15
0x52dbf	replace	80 FB 0B       with 80 FB 15
0x530A3	replace	4D             with 7F		   *(might also be unknown, as 7F does NOT = total Techs)
0x534ac	replace	88 C2 8D 04    with 0F B6 C0 6B 
						  95 00 00 00    with C0 15 90 90    *use 15 for 20 technology levels
						  00 29 D0 C1    with 90 90 90 90 
						  E0 02 29 D0    with 90 90 90 90 
0x54608	replace	66 83 FB 0B    with 66 83 FB 15
0xd1e17	replace	66 83 FA 0A    with 66 83 FA 14
0xd1e27	replace	83 E8 09       with 83  E8 13
0xd1e46	replace	BA 0A 00 00 00 with BA 14 00 00 00
0xd5778	replace	80 FB 0B       with 80 FB 15

EDIT: wrt map range see HERE.
Last edited by Peter1981 on Mon Jul 19, 2010 1:32 pm, edited 1 time in total.
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Post by Peter1981 »

footnote
1. the F4 science screen will show the incorrect progress status for future technologies (sorry this is still to be found and modded.)
2. 0x530A3 needs more consideration on it functionality as current (max.?) 0x71 = 113 is just 16*7 = 112 or 18*6 =108
EDIT1
3. Technology Level 16 (Future Technology 1) seems to be an instant jump i.e. only requires 1 RP to be completed. RESOLVED
Last edited by Peter1981 on Mon Jul 19, 2010 1:36 pm, edited 1 time in total.
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Post by Peter1981 »

Correction for Instant-Future-Tech 1 (tech 16) ebp-10h and ecx-10h should have been ebp-0fh and ech-0fh

Code: Select all

.452DB3		0x521b3		8D 45 F0      	lea eax, [ebp-10h]	8D 45 F1
.4532F7		0x526F7		8D 41 F0      	lea eax, [ecx-10h]	8D 41 F1
sorry this took so long to post but i'm still trying to learn asm :) hope this helps
Last edited by Peter1981 on Mon Jul 19, 2010 4:53 pm, edited 1 time in total.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Post by Tethys »

It does very much thanks Peter for finding it :D
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: How to add a Science and technologies

Post by thunderchero »

well I took a look at building tech limit no luck.

But I did find a cosmetic fix. At tech 11 (first new tech) it would have popup after for future tech 1. to start future tech at correct tech level (if 15 techs than tech 16 would be first future tech 1).

0x520fb 0B -> 10
0x522b9 0A -> 0F

I thought it might have been future tech as building limit but I was wrong.

thunderchero
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: How to add a Science and technologies

Post by Tethys »

The following changes are assuming an extra 10 technologies (0-21 or 20 total Tech levels)

Code: Select all

0x23816	replace	66 83 FA 0B    with 66 83 FA 15 
0x239c5	replace	80 FB 0B       with 80 FB 15 
0x51bf0	replace	66 83 FB 0B    with 66 83 FB 15
0x51f9f	replace	83 FD 0B       with 83 FD 15
0x5202a	replace	66 83 FE 0B    with 66 83 FE 15 
0x520f8	replace	66 83 FB 0B    with 66 83 FB 15 
0x521a7	replace	BA 0A 00 00 00 with BA 14 00 00 00
0x521b3	replace	8D 45 F6       with 8D 45 F1 
0x521b6	replace	83 ED 09       with 83 ED 13 
0x52267	replace	83 E9 0A       with 83 E9 14
0x522b7	replace	83 E9 0A       with 83 E9 14
0x52427	replace	66 83 FA 0A    with 66 83 FA 14
0x5242d	replace	BA 09 00 00 00 with BA 13 00 00 00
0x5268a	replace	83 F8 0B       with 83 F8 15
0x526e7	replace	BA 0A 00 00 00 with BA 14 00 00 00
0x526F7	replace	8D 41 F6       with 8D 41 F1
0x526FA	replace	83 E9 09       with 83 E9 13
0x529e7	replace	83 FA 0B       with 83 FA 15
0x52bce	replace	80 FB 0B       with 80 FB 15
0x52dbf	replace	80 FB 0B       with 80 FB 15
0x530A3	replace	4D             with 7F		   *(might also be unknown, as 7F does NOT = total Techs)
0x534ac	replace	88 C2 8D 04    with 0F B6 C0 6B 
						  95 00 00 00    with C0 15 90 90    *use 15 for 20 technology levels
						  00 29 D0 C1    with 90 90 90 90 
						  E0 02 29 D0    with 90 90 90 90 
0x54608	replace	66 83 FB 0B    with 66 83 FB 15
0xd1e17	replace	66 83 FA 0A    with 66 83 FA 14
0xd1e27	replace	83 E8 09       with 83  E8 13
0xd1e46	replace	BA 0A 00 00 00 with BA 14 00 00 00
0xd5778	replace	80 FB 0B       with 80 FB 15
INFO ADDED TO FIRST POST
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: How to add a Science and technologies

Post by QuasarDonkey »

Thanks tethys, that sames me some time.

However, I tried using this code with the bof patcher, and it shows an error -- the last two patches:

Code: Select all

0x520fb   replace   0B             with 10
0x522b9   replace   0A             with 0F
each conflict with the last bytes of:

Code: Select all

0x520f8   replace   66 83 FB 0B    with 66 83 FB 15
0x522b7   replace   83 E9 0A       with 83 E9 14
which makes the patch conflict with itself :eek:

The last patches were thunderchero's modifications to the original patch, which you've already patched, so you don't want those last two (0x520fb and 0x522b9).
Last edited by QuasarDonkey on Thu Jan 17, 2013 2:47 pm, edited 1 time in total.
User avatar
adi
Commander
Commander
Posts: 442
Joined: Sun Aug 12, 2012 6:53 pm
Location: US East Coast

Re: How to add a Science and technologies

Post by adi »

i guess yes; the 10 value was a copy paste from he's original example where he added 5 extra technologies; you could remove the short edit since the value will be written by the long one.
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: How to add a Science and technologies

Post by QuasarDonkey »

Hmm. I applied the patch to trek.exe and added the additional tech levels with UE (up to level 20). The game crashes while reading in the techfields. Are there any additional modifications needed?
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: How to add a Science and technologies

Post by Tethys »

hmm, that is odd... As far as i can tell, its working for me with 21 tech levels. Very strange, perhaps you must have the techs already set up via UE. I can link you the tech file with the test techs if you want?

EDIT: Last 2 patches are supposed to be 15 and 14 resp, Ive updated the code.

EDIT 2: Try at 0x530A3 value 71 instead of 7F then test for crash (you should see tech screen and the techs will "run off" into the next field). Might be your version of trek.exe is still under Tech limitation, but I dont see how?.. It may be that UE somehow 'fixes' the Tech limiter to be hex edited to over 71 (113 techs total), I did try with 1 additional tech (level 16) and updated all Peter1981 locations with provisions for 1 tech: 0E to 0F, 0F to 10, 10 to 11, then used value 78 at 0x530A3. This was AFTER adding the additional tech in UE. Hope this helps.

PS: You have to add and account for Sociology Techs
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: How to add a Science and technologies

Post by QuasarDonkey »

My bad. I had only added levels for biotech. *facepalm*

Now it's works fine. :grin:
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: How to add a Science and technologies

Post by QuasarDonkey »

I'd like to point out a mistake in the patches in the original post:

Code: Select all

0x51f9f   replace   83 FD 0B       with 66 83 FE 10
should read:

Code: Select all

0x51f9f   replace   83 FD 0B       with 83 FD 10
for 16 tech levels (original), and:

Code: Select all

0x51f9f   replace   83 FD 0B       with 83 FD 15
for 21 tech levels.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: How to add a Science and technologies

Post by Tethys »

Thanks, sorry I missed that. I saw it, and thought I corrected it yesterday, must have hit preview instead of submit lol.

UPDATED.
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
adi
Commander
Commander
Posts: 442
Joined: Sun Aug 12, 2012 6:53 pm
Location: US East Coast

Re: How to add a Science and technologies

Post by adi »

So, to put 20 tech levels into my game i need to create the pach file for the patcher tool according to Tethys updated code post and then define the tech levels up to 20 in UE. Anything else?
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: How to add a Science and technologies

Post by QuasarDonkey »

I have it here if you want (it will be in the new bof patcher release real soon):

Code: Select all

NAME: Additional tech levels (21 tech levels per field)
AUTHOR: Peter1981
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?f=9&t=1531
DESC: This patch sets 21 tech levels per science field (tech levels 0-20).
DESC: NOTE: tech descriptions in stbof.res must also be edited (e.g. using Ultimate Editor).

>> 0x23816   66 83 FA 0B
<< 0x23816   66 83 FA 15
>> 0x239c5   80 FB 0B
<< 0x239c5   80 FB 15
>> 0x51bf0   66 83 FB 0B
<< 0x51bf0   66 83 FB 15
>> 0x51f9f   83 FD 0B
<< 0x51f9f   83 FD 15
>> 0x5202a   66 83 FE 0B
<< 0x5202a   66 83 FE 15
>> 0x520f8   66 83 FB 0B
<< 0x520f8   66 83 FB 15
>> 0x521a7   BA 0A 00 00 00
<< 0x521a7   BA 14 00 00 00
>> 0x521b3   8D 45 F6
<< 0x521b3   8D 45 F1
>> 0x521b6   83 ED 09
<< 0x521b6   83 ED 13
>> 0x52267   83 E9 0A
<< 0x52267   83 E9 14
>> 0x522b7   83 E9 0A
<< 0x522b7   83 E9 14
>> 0x52427   66 83 FA 0A
<< 0x52427   66 83 FA 14
>> 0x5242d   BA 09 00 00 00
<< 0x5242d   BA 13 00 00 00
>> 0x5268a   83 F8 0B
<< 0x5268a   83 F8 15
>> 0x526e7   BA 0A 00 00 00
<< 0x526e7   BA 14 00 00 00
>> 0x526F7   8D 41 F6
<< 0x526F7   8D 41 F1
>> 0x526FA   83 E9 09
<< 0x526FA   83 E9 13
>> 0x529e7   83 FA 0B
<< 0x529e7   83 FA 15
>> 0x52bce   80 FB 0B
<< 0x52bce   80 FB 15
>> 0x52dbf   80 FB 0B
<< 0x52dbf   80 FB 15
>> 0x530A3   4D
<< 0x530A3   7F
>> 0x534ac   88 C2 8D 04 95 00 00 00 00 29 D0 C1 E0 02 29 D0
<< 0x534ac   0F B6 C0 6B C0 15 90 90 90 90 90 90 90 90 90 90
>> 0x54608   66 83 FB 0B
<< 0x54608   66 83 FB 15
>> 0xd1e17   66 83 FA 0A
<< 0xd1e17   66 83 FA 14
>> 0xd1e27   83 E8 09
<< 0xd1e27   83 E8 13
>> 0xd1e46   BA 0A 00 00 00
<< 0xd1e46   BA 14 00 00 00
>> 0xd5778   80 FB 0B
<< 0xd5778   80 FB 15
Just paste this code in a new .patch file in the patches/ folder in the Bof Patcher folder, e.g. "Bof_Patcher\patches\more_tech_levels.patch".

This will allow for 21 tech levels, 0-20. You'll need to use UE to add descriptions of the new tech levels in each tech field (up to level 20). Otherwise it will crash.

There is one caveat: setting build requirements for any buildings at these new levels won't work properly. The patch is really just cosmetic, for now.
Post Reply

Return to “Adding a Science and Technologies”