FreeOrion

Forums for the FreeOrion project
It is currently Mon Dec 18, 2017 6:27 pm

All times are UTC


Forum rules


Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.



Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Tue Apr 25, 2017 11:09 pm 
Offline
Space Dragon
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 262
Playing 0.4.7 RC2.

So far so good. I noticed some of the bugs reported for RC1 have been corrected (the others, if any, I bet are also corrected, it's just I didn't look for them).

To the point: I found some unprofitable colonisation strategy for one of my AI neighbours in my current game.

Pale blue AI, Trith, at turn 147 has:
- Simbiotic Biology.
- Subterranean Habitation.
And obviously self-sustaining. I guess that allows it to colonise poor planets, right?

The following systems were under its control (until I kick in in turn 145).

Carina y:
- Medium Ocean (unoccupied).
- Tiny radiated with Philosopher Planet (colonised with exobots).
- Asteroids (exobot colony under construction).
- Small Inferno (colonised with exobots).

Carina a:
- Medium Radiated (unoccupied).
- Small Barren (unoccupied).
- Medium Radiated with Ambient Superconductors (unoccupied).
- Gas Giant (unoccupied).

Lomadia:
- Tiny Ocean (outpost with Scanning Facility finished).
- Medium Radiated with Ambient Superconductors (inhabited by Ancient Guardians)
- Small Terran with Ki Spice (unoccupied).
- Asteriods (unoccupied).

Mentar b:
- Medium Inferno (exobot colony under construction).
- Asteriods (unoccupied).

Mentar a:
- Tiny Ocean with Eccentric Orbit (unoccupied).
- Large Desert (Trith capital).

Why has the AI not colonised the Small Terran in Lomadia with Trith and the Radiated and Barren planets in Carina a with exobots but has colonised the further away Philosopher planet in Carina y? It seems to be like a very bad planning. The Lomadia system was visible from my systems under Trith control since (not sure) turn 50 or 100.
Am I missing something or the AI here is playing a bit dumb? Having only 7 planets at turn 145 (half of them with under construction exobot colonies) while my Egassem have 48 planets, but I'm the only direct neighbour of it and I know for sure that no one has attacked that AI.


Attachments:
Trith_AI_bad_colonisation.jpg
Trith_AI_bad_colonisation.jpg [ 54.88 KiB | Viewed 611 times ]
Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 7:12 am 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
Oberlus wrote:
Pale blue AI, Trith, at turn 147 has:
- Simbiotic Biology.
- Subterranean Habitation.
And obviously self-sustaining. I guess that allows it to colonise poor planets, right?

No, I don't believe it does. Trith have Narrow environmental tolerance, so they go directly from Good to Poor, and then Self Sustaining just doubles the environmental adjustment. So their Good instead of +3*PlanetSize is +6*PlanetSize, but for them Poor planets are -4*PlanetSize rather than the normal -2. So with their techs you cite it looks to me like they would still be at -2*PlanetSize for terran planets.

It looks to me like they would have to get all they way up to Xeno Hybridization before they could colonize anything other than Good Planets. Or perhaps I'm doing my calcs wrong? I don't recall that really being talked about back when a critical change was made in PR#44. Does anyone here play Trith much? What tech does it take to colonize Terran with them?

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 7:40 am 
Offline
Programmer

Joined: Sun Feb 14, 2016 12:08 am
Posts: 359
Trith can colonize poor planets(Terran, Tundra) from the start(Small is +2.0). They start with desert (small = +12.0), only access to the 3 until xenological genetics(just before hybridization).

(Edit: That is assuming no other species nearby, special malus for xenophobic self-sustaining species)

_________________
Any content posted should be considered licensed GNU GPL 2.0 and/or CC-BY-SA 3.0 as appropriate.


Last edited by dbenage-cx on Wed Apr 26, 2017 8:43 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 8:22 am 
Offline
Space Dragon
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 262
Dilvish wrote:
Self Sustaining just doubles the environmental adjustment. So their Good instead of +3*PlanetSize is +6*PlanetSize, but for them Poor planets are -4*PlanetSize rather than the normal -2.
Hmm. I've tried to find that double adjustment in the github to no avail. I've used for the searches "target.sizeasdouble", "self-sustaining", "SetTargetPopulation" and "xenophobic".
In the end, I've checked this files:
- default/scripting/species/common/population.macros
- default/scripting/species/common/xenophobic.macros
- default/scripting/species/common/env.macros
- default/scripting/species/SP_TRITH.focs.txt
- all the population affecting techs in default/scripting/techs/*/<TECHS>.focs.txt

The ENVIRONMENT_MODIFIER macro in population.macros does not take into account self-sustaining.
The SELF_SUSTAINING_BONUS macro does this:
effects = SetTargetPopulation value = Value + 3 * Target.SizeAsDouble // Gets the same bonus as three growth specials

I can't find any place where it does 2.0*Value (after the environment effects) or sth like that.
I guess I'm not missing any file, judging by dbenage-cx answer.

Anyway, I think Self-sustaining should be able to colonise poor planets from the start, otherwise they would be really fucked up.


Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 8:48 am 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3295
Actually...

I remember now I introduced a minor bug in self-sustaining when I did the prioritisation ages ago and while we discussed it we never agreed which way to go with it: self sustaining now allows you to colonise really early but that wasn't my intent when I made the change, we considered trying to gatekeep it in some way or instead have them not get some tech bonuses that other species do: the latter is my preferred but it wasn't something we agreed on and it basically got forgotten.

The change was to make sure that self sustaining worked as described (ie the equivalent of all three growth specials) and at the same priority time (ie after Good/Bad Population), but doing this meant it now worked after and regardless of the Habitation bonus/penalty.

So yeah, Trith AIs think they can't live places they actually can, because we never decided which way to jump on what they should be able to do and thus the AI wasn't updated.

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 9:05 am 
Offline
Space Dragon
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 262
MatGB wrote:
So yeah, Trith AIs think they can't live places they actually can, because we never decided which way to jump on what they should be able to do and thus the AI wasn't updated.
Shouldn't the AI consider for colonisation just the actual (current) population limit that we human players see when we check it in the UI?


Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 11:22 am 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3295
Have you noticed how long those reports take to generate? They're one of the biggest individual lag things for me. The AI client does its own calculation based on numbers in the python scripts, and while theoretically the numbers haven't actually been changed, because we changed what order they're calculated it does make a substantial difference.

I don't actually do AI stuff, I'm just about capable of editing a datafile with numbers in if someone checks it, and the Pedia suitability reports are also beyond my comprehension: I can change the numbers that feed into them but not how they're worked out.

So while it would be ideal for the AI to get the same info we do that's not currently the case (although I believe it's a long term goal for them to be able to query the database directly)

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 2:49 pm 
Offline
Space Dragon
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 262
MatGB wrote:
python scripts
Ah, I found them. I'll have a look and see if I understand them, or learn some python.

Edit: I guess it would be enough to comment out the lines 59 to 61 in ColonisationAI.py to get the same values than we get from population.macros.
Should I learn GitHub and commit that?


Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 5:29 pm 
Offline
AI Contributor

Joined: Tue Feb 17, 2015 11:54 am
Posts: 225
Please always add the savegame and the relevant AI log file when making a report regarding the AI behavior. It cuts down the time to fix a bug by approximately a factor of 100 on average.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 6:38 pm 
Offline
Space Dragon
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 262
Morlic wrote:
Please always add the savegame and the relevant AI log file when making a report regarding the AI behavior.
For the case on this thread, I have a save game from when I noticed the weird behaviour of Trith, but I already started another game.
Some questions about that:
- If I save a game and exit FO and on next sesion I reload that saved game, will AI logs keep all the information from previous turns or I should make copies of every log each time I exit FO to be sure I don't lose any relevant information for a possible undiscovered bug?
- If I was playing a different game and then load a different saved game, will AI logs keep all the information from previous turns?

Morlic wrote:
It cuts down the time to fix a bug by approximately a factor of 100 on average.
Yeah, with a p-value>0.01 ;)


Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 7:18 pm 
Offline
AI Contributor

Joined: Tue Feb 17, 2015 11:54 am
Posts: 225
Oberlus wrote:
Morlic wrote:
Please always add the savegame and the relevant AI log file when making a report regarding the AI behavior.
For the case on this thread, I have a save game from when I noticed the weird behaviour of Trith, but I already started another game.

That savegame would be good to have and useful.

Quote:
- If I save a game and exit FO and on next sesion I reload that saved game, will AI logs keep all the information from previous turns or I should make copies of every log each time I exit FO to be sure I don't lose any relevant information for a possible undiscovered bug?

The AI logs are generally overwritten and the previous information is lost. Still, having a log file with the most recent turns can often be useful as the AI calculates and logs many information each turn. Of course, if the weird behavior is rooted only in calculations of previous turns and would be fine in later turns, logs are less useful but that is usually only known in hindsight.

If you want to go through the trouble of copying files when playtesting, that could help but it is certainly not expected from you.

Quote:
- If I was playing a different game and then load a different saved game, will AI logs keep all the information from previous turns?

Doesn't matter, same behavior as above.
Quote:
Morlic wrote:
It cuts down the time to fix a bug by approximately a factor of 100 on average.
Yeah, with a p-value>0.01 ;)


I am actually serious. There were bugs in the past that were immediately obvious when looking at the log but that would have required hours of looking through the code to find because they are hiding in not-so-obvious places. There were bugs that required a very specific game situation to occur which is therefore hard/impossible to reproduce in a reasonable time.

Having a savegame additionally means I can immediately check any possible fixes instead of starting some hundreds of games hoping that there is a similar game situation which occurs and then work from there or guessing what a bug might be and then randomly push it to master and hope it helps.

The factor of 100 is a rather conservative estimate if you compare "fix that takes 10 minutes" vs "can't reproduce, will randomly fix in a year when working on some other thing".

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 7:30 pm 
Offline
Space Dragon
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 262
I attach the save game. Although it seems it won't be necessary for the the described issue since it was already known by MatGB, nor useful in any way to inmediatly test the appropriateness of a given solution since the "wrong-doing" must have happened since turn 1 and the save game is turn 145.

Thanks for the info about AI logs. From now on I'll only play games with concrete seeds for the random generator so that I can replay the whole game in case I find something weird that would need older than last-turn AI logs (or maybe the game save does store the used seed?).

Morlic wrote:
I am actually serious.
I know, and I know you are right in an hyperbolic way. In fact, I've already attached logs and saves on other bug reports. My pedantic statement was to make you sure I was understanding you, despite of your lengthy way to say "a lot", but no offence intended.

Best.


Attachments:
EgassemDiscCenter.sav [2.08 MiB]
Downloaded 14 times
Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 8:53 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
dbenage-cx wrote:
Trith can colonize poor planets(Terran, Tundra) from the start(Small is +2.0).
AH, ok thanks. I see now that when I had traced back to see when the requirement of TargetPop >= 0 disappeared, I forgot that along the way the adjustment had changed from a doubling of current target to an addition of 3* planetsize.

Oberlus wrote:
I guess it would be enough to comment out the lines 59 to 61 in ColonisationAI.py to get the same values than we get from population.macros.
Should I learn GitHub and commit that?
That would not be the right change to make, no. I'll take care of this particular change. It would be great for you to learn git and GitHub, though, and you could propose changes for things in the future. Be sure to read up on our GitHub process do's and don'ts in the programming forums.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
PostPosted: Thu Apr 27, 2017 1:40 am 
Offline
Space Dragon
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 262
Thank you, Dilvish. I'm already reading some git and GitHub stuff, I hope to be helpful in the future.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group