FreeOrion

Forums for the FreeOrion project
It is currently Mon Dec 11, 2017 2:08 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Sep 09, 2017 4:17 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
For a while I've been thinking of refining the AI's colonization assessment re supply, to reduce or eliminate priority to expanding supply by colonizing just outside of the current supply range, especially if there are armed opponents around.

Morlic just noticed a conflict in some AI code regarding expected values for projected system supply values and committed some changes to address that which prompts some immediate attention to this, so I thought it a good time to open up a discussion both regarding the supply projections and regarding the colonization strategy issue.

Regarding the supply projections, it seems to me that really the underlying code conflict (about whether the system supply value can be greater than zero) stems from some changes that Geoff made while I was occupied with other matters last year and was rather inactive with FO, I don't recall reviewing those changes before and the commit message doesn't mention a PR for me to look for any discussion from the AI team. If there were discussions, it would be great if someone could point me to them. My initial take on reviewing that now is that I would prefer to restore the functionality that Geoff removed rather than take Morlics approach of harmonizing the AI code with the loss of that information. (And it very well could be that at least part of Morlic's commit above was not entirely due to the system supply issue and could still be a useful change, I need to look at it more closely)

On the broader colonization strategy issue, there is certainly some value to expanding the supply reach of the AI empire (potentially puts additional valuable planets within colonization reach), but it can take longer to colonize those peripheral colonies and then of course they are somewhat more exposed to hostile forces. Morlic's system graph analysis will likely be handy in this front, to help distinguish supply expansions towards apparently open territory versus supply expansions towards enemy empires. The latter could of course be still preferred by aggressive AIs if they make a favorable assessment of their strength versus the enemy. Brainstorming on this strategy issue is invited.

_________________
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: Sat Sep 09, 2017 4:29 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12039
Location: Munich
Dilvish wrote:
...some changes that Geoff made while I was occupied with other matters last year and was rather inactive with FO, I don't recall reviewing those changes before and the commit message doesn't mention a PR for me to look for any discussion from the AI team. If there were discussions, it would be great if someone could point me to them.
Looks like it was part of: https://github.com/freeorion/freeorion/pull/488

Edit: Just noticed there's a link from the commit page to the pull request:
Attachment:
File comment: link to pull request from a commit page on github
Link_to_PR.png
Link_to_PR.png [ 55.48 KiB | Viewed 110 times ]


Top
 Profile  
 
PostPosted: Sat Sep 09, 2017 4:35 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3286
I think it needs to depend on when in the game it is and how densely packed the galaxy is in terms of both planets and players.

I tend to select and fill entire systems and expand out, with colonies/outposts at the edges in order to extend supply to make an invasion work, preferably in good otherwise systems.

If there are a lot of planets per system then extending out too fast means you're not filling your home territory quickly, and filling up in a safe central block is by far the most efficient way to be able to outperform other empires. On the other hand, if you hold off invasions for too long then someone with a slightly better start than you can get further ahead. If you're a long way from an opponent then expanding is going to be essential and might as well do it relatively quickly, but if there are opponents very close by then concentrate on immediately defensible systems and capture their planets to get supply links.

I sometimes see an AI sending outposters way out into opposing territory to grab small or tiny worlds without any military backup, knowing that there was effectively a bug and larger worlds were being discounted far too much makes that clearer and I hope it reduces but any territorial expansion, especially into enemy supply areas needs a strong military presence else you might as well be giving them a gift, I certainly treat it as such (when I can figure out where they're going, sometimes it's really unclear).

Getting the AI to be able to defend its supply lines when there's a conflict is another thing that needs working on, possibly alongside this, but slower expansion of colonised territory except during an invasion makes sense compared to what they do now.

_________________
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: Sat Sep 09, 2017 4:36 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
Geoff the Medio wrote:
Looks like it was part of: https://github.com/freeorion/freeorion/pull/488
Edit: Just noticed there's a link from the commit page to the pull request:
Attachment:
Link_to_PR.png
Thanks, I had checked Morlic's recent commit and looked for new PR about it, but forgot to check to see if he had just opened up an issue without a PR.

_________________
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: Sat Sep 09, 2017 4:56 pm 
Offline
AI Contributor

Joined: Tue Feb 17, 2015 11:54 am
Posts: 224
Dilvish wrote:
If there were discussions, it would be great if someone could point me to them. My initial take on reviewing that now is that I would prefer to restore the functionality that Geoff removed rather than take Morlics approach of harmonizing the AI code with the loss of that information. (And it very well could be that at least part of Morlic's commit above was not entirely due to the system supply issue and could still be a useful change, I need to look at it more closely)

As I wrote in the Github issue I created along with the fix, I think the best way to fix the problem mention is to rewrite empire.supplyProjections() to calculate values greater than zero as it did before.

Note that the fix I pushed is independent of that bug: What I fixed concerns a projected negative planet supply meter which is wrong regardless of what system we use to calculate the extent of the AI's supply lines.

_________________
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: Sun Sep 10, 2017 2:17 am 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
Morlic wrote:
Note that the fix I pushed is independent of that bug: What I fixed concerns a projected negative planet supply meter which is wrong regardless of what system we use to calculate the extent of the AI's supply lines.
The actual functional code change portion of what you pushed was a good bug correction, yes, it's really just the comments portion about system supply, which I read as calling for that portion of the code to made consistent with system supply always being <=0, which I objected to. But perhaps you just intended them to generally flag the inconsistency, and regardless, some interim comments don't matter much, so let's just sort out how we want to fix it (about which it sounds like we are in agreement on the broad strokes, and I think the finer details would benefit from some more debate anyways).

_________________
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 Sep 14, 2017 8:04 pm 
Offline
AI Contributor

Joined: Tue Feb 17, 2015 11:54 am
Posts: 224
Evaluation of expanding outside of (current) supply is a tricky topic as there are so many considerations. I think the following things should at the very least be considered:

1) The number and value of currently colonizable planets
2) The number and value of colonizable planets we could "unlock" by expanding the supply
3) The "position" of the systems - are we moving towards an enemy, some unknown part of the universe or some already explored deadend?
4) The time of the game

For the first two points, it may make sense to do two passes for planet evaluation. At first, the "base value" for all planets are calculated. We then know the currently colonizable planets. In the next step, we check which of the currently non-colonizable planets (i.e. planets outside supply even after colonization) are unlocked by each planet. The supply score is then based upon the value of unlocked planets compared to currently possible targets.
There should be some incentives to push into unknown territory (using outposts) if there is no chance for colonization around (and/or trigger research of the next growth tech / exobots).

As far as point 3 is concerned, my graph analysis branch already classifies the "inner" (i.e. assumed to be safe) systems compared to (potentially) dangerous outer systems which are connected to either enemy or unknown systems.

For point 4 I'm thinking something like comparing the number of universe.systemIDs with the actual number of systems by game setup divided by the number of players. That allows some estimate to how likely it is to meet another player when moving into unknown territory.

_________________
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  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 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