Structure of edifice.bst

Structure of edifice.bst -> edifice.bst (old); support/discussion/questions

Moderator: thunderchero

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

Post by Gowron »

DCER wrote:I'm pretty sure it's the number of buildings, maybe used for determining the size of the address map. UE saves it as such and the files I've checked have it set as 318.

If you find it to be otherwise let me know and I'll update my post.
Never mind, you're right, sry :)
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Post by Peter1981 »

Followed by: (offset 0x0018 to 0x01F3 - 476 bytes)

Code:

Code: Select all

For each tech requirement (7) 
    For each tech level (10) 
        address (4 bytes) of the first building with given tech req. and level 

    0x00000000 separator? (4 bytes) 

    For each tech level (10) 
        number of buildings with given tech req. and level (2 bytes) 

    0x00000000 separator? (4 bytes) 
 
so as i understand this, would it be possible DCER, to make use of the (seperator?) bytes? -- Using them to place tech level 10 infomation within this table?

Existing vanilla BotF (1.0.2) technologies go to level 10, so I would like to be able to set a building's technology requirements to ten for testing. As I understand it UE will not do this at present, and deletes (does not save) any building with a technology requirement above technology level 9.

My request is could you allow UE to set a building's technology requirement to level ten and allow UE to use the spare seperator bytes as if they were ment for level ten technology?


The reason i ask is that given a few tech ten test building in edifice.bst I can test to see if i can get trek.exe to use tech ten buildings. This would be a useful minor extention to the existing file which may (my hope is it will) lead to the extention of the table at 0x0018 to 0x01F3 for extra technology levels (ie techs 11-15.)

but first i need to be able to add some building's with technology requirement ten in UE.

Look forward to you reply DCER -- I realise UE is on hold at the moment and my request probably seems un helpful but I am willing to tes tech 10 just need UE to set up the edifice.bst file for me :) as always your help is appreciated.
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

Hi Peter,

I've re-enable the option for the tech level, any building above 9 will be put into the separator slots now. Looking at this again they might actually be slots for tech 10.

I also found some old code for adding/removing buildings so I've enabled/added that too. It should make it easier to add buildings if it works right. You still need to edit trek.exe afterward, as this only edits edifice.bst and descriptions.

All of these are only available when experimental options are enabled.

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

Post by Peter1981 »

TEST1 report :-

Added for the federation one Type 10 Automated Farm just after the Type 9 automated Farm in UE, saved and updated trek.exe.

Observations

1. no CTD or game hang up (this is the best news)
2. broken federation main Energy, Intel, and Research upgrades.
3. Farms could only be upgraded to type 9
4. type 10 automated farm did not display anywhere in game.

What i think is happening (this is speculative):-

Trek.exe reads a set offset of nine for main industry, energy, intel, & research and 10 for farms (inc primitives)
Thus adding one farm means that the entries in edifice.bst are not read correctly since industry is before farms and farms and industry both upgrade to level 9 correctly
further the science popup notifications gave the incorrect building types.
I think this is simillar to the early problems when tethys was trying to add technologies and the tech 11 appeared on the next section

Conclusion: Adding extra main building will require moddification of Trek.exe

Testing will continue...
Last edited by Peter1981 on Thu Jul 22, 2010 1:20 pm, edited 1 time in total.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2211
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Post by Tethys »

Sweet thanks DCER you rock
Not for the weak of heart...
Galaxies MOD v0.3.6x1 <--- GALM/Galaxies Mod latest version
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Post by Peter1981 »

From UE tread
I've tested the building with techs above ten (in my case up to tech 15) and they display correctly in thescience screen

As I expected cramming all tech 10-15 buildings in the table together means trek.exe treats them for the purpose of avaliability as tech ten -- i.e. tech pop up shows at tech 10 all tech 10+ buildings

One little request to do with UE can building view be extended to include tech 10 at the very least as i get an error with building view and can't use this feature any more.

I will continue this post (train of thought in Edifice.bst post)
Any way where was I....

oh yes: the table that is used in edifice.bst is broken down into 7 sciences (biology, Computer, Construction, Energy, Propulsion, Weapons and All.) in each there are two section, first offset of first building with required technology level (11x4bytes techs 0-10) and number of building with the required tech level (11x2bytes techs 0-10) followed by a two byte 00 00 (seperator?).

AFAICS the 4bytes section never use more than two bytes and the 2bytes section never uses more than one.

:. could we adapt the offsets in trek.exe and double up the technology requirement table?

I think this would be possible - however while i have made some progress in understanding asm this kind of modification of the trek.exe is beyond me (any one out there wanna give it a go?)

second another feature for UE would need to be added to use the condensed table (I don't think this would be to hard for you (DCER) to do?)

I hope this make some sence but while i can coprehend the proble I can't solve it -- it's quite frustrating.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2211
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Post by Tethys »

I too believe this is possible by adjusting offsets but all offset need adjusting that refer to these tables, not sure where they all are so ur im probable worse off then u are Peter ;)
Not for the weak of heart...
Galaxies MOD v0.3.6x1 <--- GALM/Galaxies Mod latest version
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1161
Joined: Sun Apr 27, 2008 2:00 am

Re: Structure of edifice.bst

Post by Spocks-cuddly-tribble »

The overview of edifice.bst entries was very helpful to figure some stuff out. :)

In preparation for some bugfixes wrt buildings & upgrades, I discovered 2 hidden features:
DCER wrote:Offset 0x007A to 0x007B unknown (2 bytes)
SystemPopCap requirement(*10): (subtracted from [SystInfo+BC], cf. 3rd value in aibldreq.bin, but cumulative for all buildings i.e. one cannot build more than one 1000(dec) building on a max pop 180 system).

Warning: The feature is unfinished, not buildable buildings still can be put in the production queue and waste industry (resp. credits when buying), but will not be added to the system (the "build finished" message is wrong). Also not sure if AI can adapt to this.
DCER wrote:Offset 0x007E to 0x007F unknown (2 bytes)
Support cost in credits per turn: (unlike ship support cost no pop support, total system support cost displayed in F2 popup for credits on the left)



I cracked also the internal address structure of the empsInfo & systInfo files. Knowing about the pattern of the GUI / effective switch areas, including the displacement values, completing the missing values is just a matter of basic arithmetics (simple since relative order of main buildings resp research areas should be always the same).

Check this out:
http://flocke.bplaced.net/botfwiki/inde ... le-Listing

Using this knowledge, it should be very easy to fix some missing/unfinished building output types like local research bonus in percent or empire-wide industry bonus.

F.e. this data field in trek.exe determines the systInfo addresses of each bonus via edifice.bst bonus type (empire-wide bonuses get loaded from systInfo to empsInfo):

ds:[58FC6C+bonustype*4] = address of bonus in systInfo[+C0/+180h (see link)]
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7000
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Structure of edifice.bst

Post by thunderchero »

nice I am sure this will be some very nice patches and fixes

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

Re: Structure of edifice.bst

Post by Peter1981 »

Wow SCT stunning work :D
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2832
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Structure of edifice.bst

Post by Flocke »

DCER wrote: Fri Jul 09, 2010 6:59 am File Structure Overview
Offset 0x0008 to 0x01F3 tech map (496 bytes)

Tech map
Followed by: (offset 0x0018 to 0x01F3 - 476 bytes)
Small correction for the file structure overview: 1F4h - 8h = 1ECh = 492 bytes, not 496!
The 476 bytes of the teach map data are correct: 1F4h - 18h = 1DCh = 476 bytes.
Post Reply

Return to “Structure of edifice.bst -> edifice.bst (old)”