starting buildings and starting technology

Ultimate Editor; support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7966
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

starting buildings and starting technology

Post by thunderchero »

UE has 2 screens with dropdown list that is currently limited to tech 10. Since we have a few mods that increase tech levels it would be helpful if this was increased.

file; BldSetGUI.java at line 400
for (int i=0; i<10; i++){
changed to
for (int i=0; i<26; i++){

file; StartConGUI.java at line 373
for (int n=0; n<10; n++){
changed to
for (int n=0; n<26; n++){

this will allow dropdown to display techs for all current mods, but my question is should it get max tech level from "technology fields" to set dropdown max?

Note; even vanilla when tech 10 is selected from dropdown the list is blank. this change would display vanilla 10 - 25 blank/empty lists if not coded to auto adjust.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: starting buildings and starting technology

Post by Flocke »

thunderchero wrote: Fri Jun 11, 2021 1:54 pm this will allow dropdown to display techs for all current mods, but my question is should it get max tech level from "technology fields" to set dropdown max?

Note; even vanilla when tech 10 is selected from dropdown the list is blank. this change would display vanilla 10 - 25 blank/empty lists if not coded to auto adjust.
The answer to this might be given by BuildingsGUI.java#L1839 where the max tech level is determined from TechTree.java

But it is a very inefficient implementation cause it iterates over all the tech entries all the time without ever caching it.
Further, a more proper implementation would check for the buildings instead and list tech levels actually in use, cause for the start buildings as well as the starting technology view, it both actually is a filter on the building structures and not on the available technologies.
See https://gitlab.com/stbotf/ultimate-edit ... .java#L190 - it needs an analogous implementation here to iterate the used building tech levels, but instead of searching for the highest, we return a list of the used ones to skip those not in use (if any).

With GALM still on my disk I'll give it a try. :wink:
Last edited by Flocke on Fri Jun 11, 2021 4:05 pm, edited 1 time in total.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7966
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: starting buildings and starting technology

Post by thunderchero »

Flocke wrote: Fri Jun 11, 2021 3:42 pm With GALM still on my disk I'll give it a try. :wink:
iirc Galaxy mod has no structures above tech 10... but tech levels 0 - 15
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: starting buildings and starting technology

Post by Flocke »

yep it has no structures above tech 10 but I went ahead anyhow and think I have it working now
however, from testing vanilla botf doesn't properly regard higher tech level requirements
guess there are some additional trek.exe fixes required, but I leave it to the modder then

in Edifice.save I found that the written tech map is limited to 0 + 10 tech levels, which does explain why higher techs aren't properly updated

in addition I noticed that there seem to be some hardcoded assumptions by trek.exe in what id range some expected buildings are stored. At least UE has some checks there that I don't know the context and didn''t analyse

anyhow, here a sneak preview:
tech_lvl_selection.jpg
tech_lvl_selection.jpg (92.38 KiB) Viewed 2028 times
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7966
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: starting buildings and starting technology

Post by thunderchero »

nice job :wink:

I have been watching all the clean up and changes as you went though changes :grin:
Flocke wrote: Sun Jun 13, 2021 5:30 pm in Edifice.save I found that the written tech map is limited to 0 + 10 tech levels, which does explain why higher techs aren't properly updated

in addition I noticed that there seem to be some hardcoded assumptions by trek.exe in what id range some expected buildings are stored. At least UE has some checks there that I don't know the context and didn''t analyse
From the quick look I think this is start of future tech? this was edited when tech levels were extended also.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: starting buildings and starting technology

Post by Flocke »

thunderchero wrote: Sun Jun 13, 2021 6:16 pm nice job :wink:

I have been watching all the clean up and changes as you went though changes :grin:
Thx,

and well, when there is too much code involved and too much cryptical undocumented code, and all the formatting is broken, I first try to clean things up a bit to get a better view. And when done I clean up even more to keep it simple when I or someone else ever touches the code again.

I'm still not used to Eclipse, there is alot I miss from other editors, but one helpful tool it has is the code formatter. It doesn't work well all the time, but selecting the lines to commit or omit with Github for Windows, it does a good job and reduces the work alot. :D
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3258
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: starting buildings and starting technology

Post by Flocke »

thunderchero wrote: Sun Jun 13, 2021 6:16 pm From the quick look I think this is start of future tech? this was edited when tech levels were extended also.
From what I've seen UE expects a hard coded list of 7 tech fields incl sociology and the tech levels 0-10 here, listing all the building ids per tech field and level.
So that is likely what you see in the technology database, sorted for the differet tech levels.
If you set a higher tech level for some structure than 9, it seems to get messed by BotF. Already the future tech level 10 seems to get messed in the database.

related to this I found:
viewtopic.php?p=21801#p21801
viewtopic.php?p=22042#p22042

Without further investigation I can't tell any more about it, but when using UE to add buildings above lvl 9 I am sure it still involves manual trek.exe editing.
Post Reply

Return to “Ultimate Editor”