Main buildings and AI
Moderator: thunderchero
Main buildings and AI
This will be a quick one
We all know there are major problems if you turn main buildings into special ones.
One symptom I've seen in my borg mod is that the Borg kept upgrading their research building mark 1 into implant recycle centers because the centers were occupying the spot of main research building mark 2. As a result their home planet was busy building research buildings and upgrading them all the time. Setting the right group in edifice.bst and changing bonus type didn't help.
This is now fixed in UE version 0.6.8dev12. It will set the correct values in trek.exe, thus solving those symptoms.
But before you try it, here's what you should know:
The values in trek.exe are first and last id of main building group, so:
Main buildings of a specific group and race need to be grouped together in edifice.bst. This means Cardassian main food buildings need to be placed one after the other. Same goes for the other groups of main buildings.
Main industry and food buildings of a race also need to be grouped together (industry first, food second).
UE does not yet test for these things so be careful. It takes the first group it finds (test for empire, pop req and group).
UE will now allow you to set building group yourself. It'll then translate that into race specific group code. I haven't tested if two empires can share main buildings, but UE was made to allow this - no idea how it affects botf.
The relevant values (too many to list them all) were found in these subroutines:
545008, // 0x000850F0 - main research buildings
545952, // 0x000854A0 - main intel buildings
547152, // 0x00085950 - main ind/food and en buildings
548944, // 0x00086050 - main research buildings
549824 // 0x000863C0 - main intel buildings
Have fun
EDIT:
The relevant values are moved to ecx in those subroutines.
EDIT2:
Cardassian main industry, food, energy and intel buildings have a maximum limit of 127 on last ID.
We all know there are major problems if you turn main buildings into special ones.
One symptom I've seen in my borg mod is that the Borg kept upgrading their research building mark 1 into implant recycle centers because the centers were occupying the spot of main research building mark 2. As a result their home planet was busy building research buildings and upgrading them all the time. Setting the right group in edifice.bst and changing bonus type didn't help.
This is now fixed in UE version 0.6.8dev12. It will set the correct values in trek.exe, thus solving those symptoms.
But before you try it, here's what you should know:
The values in trek.exe are first and last id of main building group, so:
Main buildings of a specific group and race need to be grouped together in edifice.bst. This means Cardassian main food buildings need to be placed one after the other. Same goes for the other groups of main buildings.
Main industry and food buildings of a race also need to be grouped together (industry first, food second).
UE does not yet test for these things so be careful. It takes the first group it finds (test for empire, pop req and group).
UE will now allow you to set building group yourself. It'll then translate that into race specific group code. I haven't tested if two empires can share main buildings, but UE was made to allow this - no idea how it affects botf.
The relevant values (too many to list them all) were found in these subroutines:
545008, // 0x000850F0 - main research buildings
545952, // 0x000854A0 - main intel buildings
547152, // 0x00085950 - main ind/food and en buildings
548944, // 0x00086050 - main research buildings
549824 // 0x000863C0 - main intel buildings
Have fun
EDIT:
The relevant values are moved to ecx in those subroutines.
EDIT2:
Cardassian main industry, food, energy and intel buildings have a maximum limit of 127 on last ID.
Last edited by DCER on Thu Jan 22, 2009 1:32 am, edited 2 times in total.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7965
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
I tested this now. However, it does not seem to work (yet).
I replaced the first (type 1 assembly yard) and last (class 9 science center) Cardassian main building by special buildings, both accessible to any empire.
Problems:
1. No empire was able to build the new buildings in their starting systems at a tech 9 start.
2. The new building which had replaced the type 1 assembly yard was present in any new colony, being treated as a main industry building.
I did not test AI upgrading or aibld.req serviceability.
I used UE v0.6.9dev1a.
I replaced the first (type 1 assembly yard) and last (class 9 science center) Cardassian main building by special buildings, both accessible to any empire.
Problems:
1. No empire was able to build the new buildings in their starting systems at a tech 9 start.
2. The new building which had replaced the type 1 assembly yard was present in any new colony, being treated as a main industry building.
I did not test AI upgrading or aibld.req serviceability.
I used UE v0.6.9dev1a.
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7965
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
I also have had problems. I have left the first building and used next 4 for main structure for upgrades freeing up 4 building per area. Also I am leaving Primitive Farms unchanged in food area. so food uses 6 total and all others use 5 total.
main structure Upgrades are now working properly, and new structures that I have added are available to be built and AI is building them once aibldreq.bin was set up too.
but found one race trying to build a structure "N\A" not sure how it was displaying this but it was. to fix this I set all unused structures so nothing was selected for "can be built by" and "needed race on system". Then they stopped tring to build "N\A" structures also all unused structures were set to "other" type.
Note: N\A only happened after AI took over home system of another race. and in tool tips it showed upgrade for one of the new buildings when building had no upgrade? this was very strange behavior even for this AI.
also remember to set starting condition "starting buildings" and "starting technology" after each change.
So far this is being very tricky to keep everything setup correctly.
thunderchero
main structure Upgrades are now working properly, and new structures that I have added are available to be built and AI is building them once aibldreq.bin was set up too.
but found one race trying to build a structure "N\A" not sure how it was displaying this but it was. to fix this I set all unused structures so nothing was selected for "can be built by" and "needed race on system". Then they stopped tring to build "N\A" structures also all unused structures were set to "other" type.
Note: N\A only happened after AI took over home system of another race. and in tool tips it showed upgrade for one of the new buildings when building had no upgrade? this was very strange behavior even for this AI.
also remember to set starting condition "starting buildings" and "starting technology" after each change.
So far this is being very tricky to keep everything setup correctly.
thunderchero
ThanksDCER wrote:I've found the starting building id's for the new colonies, it's already added to UE (but not uploaded) in the sense that it sets the right farm and industry ids.
But that first problem should be easy to work around, anyway; just leave low-level farms and low-level factories alone.
The 2nd problem seems to have been a problem with racetech.tec, not related to this topic and not related to UE
It's working now.
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
This info is already included in the UE, but has not been explicitly posted here.
These IDs determine the (two) types of buildings that are available to new colonies as initial buildings. The numbers of buildings can also be edited, see here.
First building (default: factories):
Second building (default: farms):
These IDs determine the (two) types of buildings that are available to new colonies as initial buildings. The numbers of buildings can also be edited, see here.
First building (default: factories):
Code: Select all
Empire, default ID, asm offset, hex offset
Card., 0x058, 445070, 44470
Fedr., 0x086, 445095, 44495
Ferg., 0x0B4, 4450AB, 444AB
Klng., 0x0E2, 4450C1, 444C1
Roml., 0x110, 4450D7, 444D7
Code: Select all
Empire, default ID, asm offset, hex offset
Card., 0x062, 445130, 44530
Fedr., 0x090, 445195, 44555
Ferg., 0x0BE, 4451AB, 4456B
Klng., 0x0EC, 445181, 44581
Roml., 0x11A, 445197, 44597
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1961
- Joined: Sun Apr 27, 2008 2:00 am
Changing of the following values should allow to increase total amount of buildings in edifice.bst (in theory / untested !).
The max Structure ID differs due to the check (asm-offsets):
So maybe its possible to add new special buildings without need of main building slots?
Building Groups in edifice.bst
The max Structure ID differs due to the check (asm-offsets):
Code: Select all
jle -> 317 (dec)
4504E3 cmp ax, 13D
4506D5 cmp dx, 13D
453D02 cmp bx, 13D
485DC1 cmp ecx, 13D
485E94 cmp ecx, 13D
485F43 cmp ecx, 13D
485FCE cmp ecx, 13D
48604D cmp ecx, 13D
486072 cmp cx, 13D
486523 cmp bx, 13D
486B36 cmp cx, 13D
486C28 cmp bx, 13D
486E3E cmp ecx, 13D
486EE1 cmp ecx, 13D
486F6C cmp ecx, 13D
486F91 cmp bx, 13D
487352 cmp bx, 13D
48740C cmp bx, 13D
4874E9 cmp bx, 13D
4875CB cmp ecx, 13D
4876BB cmp ecx, 13D
jb -> 318 (dec)
40B9DA cmp ax, 13E
40D752 cmp bx, 13E
43AA62 cmp bx, 13E
4F44C6 cmp dx, 13E
Building Groups in edifice.bst
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.