the AI minimum terraform threshold

the AI minimum terraform threshold; support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 723
Joined: Sun Apr 27, 2008 2:00 am

the AI minimum terraform threshold

Post by Spocks-cuddly-tribble » Wed Nov 04, 2009 5:04 pm

If the AI decides colonisation of a specific system, sub_41BF00 tests (among others) the need of further terraforming:

Code: Select all

41C015   cmp   eax, 4Bh    //  test current MAX POP
41C018   jnb   short loc_41BFD4
This means a system must reach at least a MAX POP of 75. Otherwise AI is forced to terraform more planets.


Limitations which can override the threshold: :?
  • total system capacity is less than the limiting value
  • at the time an AI colony ship arrives a system there is a MAX POP larger 0
    (M-class planets or previous terraforming)
[EDIT] solved (see below):
410134 jnz short loc_410143 // 0xF534 -> 75 0D to 90 90
[EDIT/]


Since this check, due to its structure, can only work for a maximum value of 127(dec), we could remove the following jump statement:

At 0x1B418 -> 73 BA to 90 90

(Same effect: 41BF87 jz short loc_41BFCE // 0x1B387 -> 74 45 to 90 90)

Either of them forces the AI to fully terraform the system before colonizing it.
Last edited by Spocks-cuddly-tribble on Mon Feb 08, 2010 9:45 am, edited 1 time in total.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

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

Re: the AI minimum terraform threshold

Post by thunderchero » Wed Nov 04, 2009 10:06 pm

Thanks Spocks-cuddly-tribble,

This will be added to UDM, This should increase AI strengh with more money and ground combat too. :D I also noticed now AI went back and completely terraformmed a minor system after subjugating :wink:

Edit: I have been testing The minor had all class M, Do you think it can be adapted to terraform all classes of planets?

thunderchero

User avatar
Martok
Rear-Admiral
Rear-Admiral
Posts: 1132
Joined: Thu May 01, 2008 2:00 am

Post by Martok » Wed Nov 04, 2009 11:30 pm

Outstanding! Hopefully this will be worked into BOP as well.
"Evil is easy, and has infinite forms." -- Pascal

stardust
Rear-Admiral
Rear-Admiral
Posts: 1381
Joined: Sat Apr 26, 2008 2:00 am
Location: good ole Blighty

Post by stardust » Thu Nov 05, 2009 1:40 am

I've a question/spanner in the works here.

If this code is meant to force the AI to terraform a system to 75 pop before colonising, then how come I've seen the AI pick a perfectly good system to colonise but only terraform a naff J or Y class planet that only has 15/20 pop and colobnise then?

It's not like this has been a one off in my experience. I've seen it happen dozens of times over the years on Vanilla.
Computers! [Expletive deleted]

My 4shared folder

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

Post by thunderchero » Thu Nov 05, 2009 1:54 am

I am not an expert on this, but it may have been due to no class M planets in that system? so this part of code was over looked.

thunderchero

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

Post by Spocks-cuddly-tribble » Thu Nov 05, 2009 1:18 pm

thunderchero wrote:This should increase AI strengh with more money and ground combat too.
Be careful, it slows down AI expansion (especially low tech/epic games). So maybe a 50% increase of colony ships in the AI fleet buildup agendas could be recommended. Note due to longer terraform times AI builds lesser of them!
thunderchero wrote:I also noticed now AI went back and completely terraformmed a minor system after subjugating
Must be coincidence. AI terraform behavior after colonizations/subjugations seems unaffected by sub_41BF00.
thunderchero wrote:The minor had all class M, Do you think it can be adapted to terraform all classes of planets?
1.) This probably is a MAX POP larger 0 issue, not a class M specific problem
2.) As I said, sub_41BF00 only applies to unhabitated systems! (Do you intend to bomb all minors to death?)

Concerning an adaption of the MAX POP > 0 issue. Just tell me the code location and I'd be happy to adapt it for you. :wink:
stardust wrote:how come I've seen the AI pick a perfectly good system to colonise but only terraform a naff J or Y class planet that only has 15/20 pop and colobnise then?
I'm not sure. Note this is a small part of a large jigsaw only.

Possible:
1.) Terraform task was interrupted i.e.an AI colony ship (re-)arrives a system with a current MAX POP larger 0 -> limit overriden
2.) It also might be that some sort of AI-diplomacy agenda can override sub_41BF00

Also, durring my tests, AI always selected the pop(or growth?) largest planet for next the terraforming task. But at the same time, I think I share your memories.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

stardust
Rear-Admiral
Rear-Admiral
Posts: 1381
Joined: Sat Apr 26, 2008 2:00 am
Location: good ole Blighty

Post by stardust » Sat Nov 07, 2009 10:16 am

Spocks-cuddly-tribble wrote:
stardust wrote:how come I've seen the AI pick a perfectly good system to colonise but only terraform a naff J or Y class planet that only has 15/20 pop and colobnise then?
I'm not sure. Note this is a small part of a large jigsaw only.

Possible:
1.) Terraform task was interrupted i.e.an AI colony ship (re-)arrives a system with a current MAX POP larger 0 -> limit overriden
2.) It also might be that some sort of AI-diplomacy agenda can override sub_41BF00

Also, durring my tests, AI always selected the pop(or growth?) largest planet for next the terraforming task. But at the same time, I think I share your memories.
Combat does seem to have some overriding effect on this code change.

I'm running a game on AAM at the moment with the MUDD cheats on to see how the AI is handling things and I've noticed the Federation have colonised a system that had an L type planet previously terraformed.

The colony ship started terraforming this system but something's caused the colony ship to retreat (I didn't see who engaged them though.)

The following turn the colony ship was back and colonised the system without bothering to finish terraforming any other planets.
Computers! [Expletive deleted]

My 4shared folder

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

Post by Spocks-cuddly-tribble » Sat Nov 07, 2009 11:02 am

stardust wrote:The colony ship started terraforming this system but something's caused the colony ship to retreat (I didn't see who engaged them though.)
That's a mod-independent AI behavior(temporary conflicting orders) and has nothing to do with combat.
stardust wrote:The following turn the colony ship was back and colonised the system without bothering to finish terraforming any other planets.
That's my point 1.) above - no matter which cause.


A funny/odd thing I forgot to mention: previous terraforming by a human/player doesn't override the limit.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

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

Re: the AI minimum terraform threshold

Post by Spocks-cuddly-tribble » Sun Nov 08, 2009 1:09 pm

thunderchero wrote:Do you think it can be adapted to terraform all classes of planets?
This should work for you, and also reduce (a bit) the conflicting orders issue:


410134 jnz short loc_410143 // 0xF534 -> 75 0D to 90 90

The problem is/was: AI selects orders (colonize/terraform) already at the time of beginning of the colony ships movement. :?


For the other big problem (prolonged terraforming tasks), we'd need an AI terraform cheat (maybe each planet = 1 turn).
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

Post Reply

Return to “the AI minimum terraform threshold”

Who is online

Users browsing this forum: No registered users