How AI builds in 1 turn

General Modding Information/Questions; support/discussion/questions

Moderator: thunderchero

Forum rules
:idea: Please search before starting new topic. :idea:
There is a good chance it has already been asked.
Post Reply
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7936
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

How AI builds in 1 turn

Post by thunderchero »

Hi Everyone,

while debugging sub 460940 I noticed cardassians building Type 8 Science Centers at Cardassia and Holberg 917G on turn 2

Type 8 Science Center (costs 5830 industry)

current industry at Cardassia = 2068
current industry at Holberg 917G = 1128

to complete the structure in one turn the AI would run though sub 460940 and re-using the same industry until structure was complete.

I counted Cardassia go though code 3 time and lost track on how many time Holberg 917G went though code but would bet it was 6 time.

I would also bet they use this to do all build types ships, structures and upgrades

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

Re: How AI builds in 1 turn

Post by Spocks-cuddly-tribble »

Buddy, I think you need a break. Usually the AI buys its stuff. Set AI starting credits and income to 0 and test again. :wink:

Btw using your recent research on build queue and old info on overflow build cost bug we can read the entire code with no problems. It has some strange loops yes, but no cheat stuff. :smile: (unless de-bugging or patches changed trek.exe behavior).

Also I re-checked the AI build code and I have to correct myself. The AI cannot build more than one item per turn or skip build costs :up: (only minors).

Skipping building restrictions is due to bugs, not cheats (special shipyard code). 'Build Wonder' AI Task B Looks like broken code for special and 'one per empire' buildings i.e. unfinished part of the bug.


@ the OB issue we talked about:

Back in the day, all my tests with saved games from people complaining about this concluded the update of the player map display and popup for enemy OBs was point of confusion. BotF has VERY complicated prerequisites to show current enemy OBs, even more so for active OBs. The statement from Discord means he saw zero OBs on map display but when moving in, there magically appear great numbers after one turn. Some factors are: sector scan value, having ships in sector, current and shiptech.sst tech levels(raid messages on OBs)... So checking files of some previous saved turns should solve the mystery.
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: 7936
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: How AI builds in 1 turn

Post by thunderchero »

but the credits don't add up either. :wink:

starting credits on turn 2 40855

ending credits on turn 3 38134

income 165

ship support 684

gift to vulcans 500

ending credits should have been 39836

so they paid 1702 for 2 structures that has build cost of 11660

btw I never test with any patches installed. code changes are done on vanilla.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1928
Joined: Sun Apr 27, 2008 2:00 am

Re: How AI builds in 1 turn

Post by Spocks-cuddly-tribble »

Then there is something very strange. The main loop is for all economic system orders from ordInfo (see the files Flocke analysed) i.e. all empire systems on the map. If it's somehow forced to repeat itself it must affect all empire systems with orders.

Or will debugger trace or breakpoint affect trek.exe?
thunderchero wrote: Thu May 27, 2021 5:24 pmthey paid 1702 for 2 structures that has build cost of 11660
Remember to subtract the system industry.

Also remember AI starting credits and income cheats (not displayed).
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: 7936
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: How AI builds in 1 turn

Post by thunderchero »

Spocks-cuddly-tribble wrote: Thu May 27, 2021 4:10 pm Buddy, I think you need a break. Usually the AI buys its stuff. Set AI starting credits and income to 0 and test again. :wink:
I agree I need a break.

but as to setting to 0 credits, yes it will not build or give credits to vulcans, but I expect this changes build priorities also.

but, if lowered to 4000 credits it will still build a Type 8 Science Centers (5830 credits) at Cardassia and give 500 credits to vulcans and have 3697 afterwards.

but I agree the AI gets away with/does some strange things.

on a side note I get exact same results without debugger.

after all this, I am not sure how AI builds now :???: (TBH I don't care, all I know is it cheats!)
Post Reply

Return to “General Modding Information/Questions”