Logo Platform
logo amplifiers simplified

I am looking for means to make the AI consider anomalies when colonizing.

Reply
Copied to clipboard!
11 years ago
May 5, 2013, 3:43:55 PM
I'm sure others see this as a problem; AI colonize without regard to the Approval effect the new colony will have. One thing i did to mitigate this is increase colonization cost of higher tier planets; this seem to make the AI more eager to colonize the lower tier planets first. Unfortunately, this method has no effect on planet's anomalies that can be either good or bad. I am scratching my head trying to figure out a mean to make the AI prefer high approval planets to those with negative values.



So far i have no ideas, so i am wondering if anyone can come up with something to try.
0Send private message
11 years ago
May 5, 2013, 5:35:37 PM
I think i found my answer. I created a ApprovalMin value in ClassStarSystem and made it so it would set the minimal Approval "output" a planet can have before being considered a valid colonization target (ie don't bring the system bellow 50% approval). My tests seem to confirm it works, though i'm considering adding a similar value for Dust as the AI also don't consider if the new planet will provide dust to sustain the system's upkeep cost (some anomalies can make some planets quite bad in that regard). This one may be a bit more tricky as i don't want to forbid the AI from colonizing bad system if it can afford it.
0Send private message
11 years ago
May 5, 2013, 6:39:35 PM
.. You can create new variables?

Mind==Blown.

Use a min(food+ind) rather.
0Send private message
11 years ago
May 5, 2013, 7:40:12 PM
Foraven wrote:
I think i found my answer. I created a ApprovalMin value in ClassStarSystem and made it so it would set the minimal Approval "output" a planet can have before being considered a valid colonization target (ie don't bring the system bellow 50% approval). My tests seem to confirm it works, though i'm considering adding a similar value for Dust as the AI also don't consider if the new planet will provide dust to sustain the system's upkeep cost (some anomalies can make some planets quite bad in that regard). This one may be a bit more tricky as i don't want to forbid the AI from colonizing bad system if it can afford it.


Will you be including this AI enhancement in your Fair Fight mod?
0Send private message
11 years ago
May 5, 2013, 8:11:05 PM
Aureon wrote:
.. You can create new variables?

Mind==Blown.

Use a min(food+ind) rather.




Yes, please explain how you did this! smiley: smile
0Send private message
11 years ago
May 6, 2013, 2:05:32 AM
Aureon wrote:
.. You can create new variables?

Mind==Blown.

Use a min(food+ind) rather.




Never too late to learn new things smiley: stickouttongue.



All i can set currently is a minimal requirement, i can't make the AI value things more, just ignore stuff that make no sense to colonize at a given turn. However i'm starting to think i could use a min industry/food check depending on what we really need (and race attributes), i will thinker something in that regard...



The only problem i have left is making sure the AI don't overcolonize; in my test all my AI were doing fine exept Automatons that for some reason had too many new systems and were going broke. I need some mean to make them stop building new colony ships when approval gets too low...



Sechrima wrote:
Will you be including this AI enhancement in your Fair Fight mod?




That's the plan! smiley: mrgreen



LogicSequence wrote:
Yes, please explain how you did this! smiley: smile




I'm still working on my parameters, i'm rooting out mistakes before explaining others how to do it and just show it's broken... I will post about how i did it as soon as i'm sure all is ok.
0Send private message
11 years ago
May 7, 2013, 5:24:29 AM
So if I get it right, there are different things to think over:



First: When the AI wants to colonize further planets in a system, this shouldn't get influenced by approval of a planet only. Cuz thinking of a system with lets say +50 smiley: approval, the AI should not care so much about the planets smiley: approval itself (+50smiley: approval -20smiley: approval = +30smiley: approval and that is still high enough I think, just as an example). But if smiley: approval of a Star system is only +10 to +20 it is a bad idea colonizing a planet with -20 smiley: approval.

Second: Setting a threshold of planets smiley: approval only would prevent the AI from colonizing bad planets which could be transformed into great planets. smiley: confused



I'll take a look at the xml files, maybe I get an idea how to "fix" this smiley: biggrin
0Send private message
11 years ago
May 7, 2013, 1:06:23 PM
nToxic wrote:
So if I get it right, there are different things to think over:



First: When the AI wants to colonize further planets in a system, this shouldn't get influenced by approval of a planet only. Cuz thinking of a system with lets say +50 smiley: approval, the AI should not care so much about the planets smiley: approval itself (+50smiley: approval -20smiley: approval = +30smiley: approval and that is still high enough I think, just as an example). But if smiley: approval of a Star system is only +10 to +20 it is a bad idea colonizing a planet with -20 smiley: approval.

Second: Setting a threshold of planets smiley: approval only would prevent the AI from colonizing bad planets which could be transformed into great planets. smiley: confused



I'll take a look at the xml files, maybe I get an idea how to "fix" this smiley: biggrin




Well, i did apply my idea into my v 1.33 of FF. Basically i set it so it check if the system can afford to have that given planet (ie not fall bellow 50% approval). The way i did it was to create a variable that set the max negative value we can tolerate (50 - System Approval, with positive max value set to zero so any planet that don't affect Approval is a good planet). Then i added a parameter into the AIPathsPrerequisites (for each colonisation tech) that check if we can colonize by looking if the planet's Approval value is higher or equal to the min value. Also, since global approval "bleed" to all systems, the AI will consider colonizing lower approval planets when global approval can afford it (however the AI may end up adjusting taxes to bring the Approval up thus enable even more low approval planets to be colonized, triggering lowering taxes again and so on). My "fix" works but i think it need improvement so the AI don't trigger a lowering tax vicious circle.





So it look like this in my mod:



In starsystem descriptor



[CODE]











[/CODE]



[CODE]











[/CODE]



In PlanetColonization, one planet example



[CODE]



$(PlanetTypeTerran) and !$(PlanetStatusColonized)

($(../ClassStarSystem:Population) ge $(../ClassStarSystem:EnoughPop)) and ($(../ClassStarSystem:Population) gt 1) and ($(.../ClassPlanet:Approval) ge $(../ClassStarSystem:ApprovalMin)) and ($(.../ClassPlanet:Money) ge $(../ClassStarSystemsmiley: biggrinustMin)) and (($(.../ClassPlanet:Food) ge $(../ClassStarSystem:FoodMin)) or ($(.../AffinitySower) and ($(.../ClassPlanet:Industry) ge $(../ClassStarSystem:IndustryMin))))



%ColonizeTerranTitle

%ColonizeTerranDescription





[/CODE]
0Send private message
11 years ago
May 9, 2013, 10:30:08 PM
Creative smiley: approval



My "fix" works but i think it need improvement so the AI don't trigger a lowering tax vicious circle.


Nothing's ever easy right? smiley: twisted
0Send private message
?

Click here to login

Reply
Comment