FreeOrion

Forums for the FreeOrion project
It is currently Thu Nov 23, 2017 5:24 am

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  [ 19 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sat Jul 22, 2017 12:18 pm 
Offline
Dyson Forest
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 215
Playing 2017-07-03.a5f0edc_Test_Win32 I noticed a sizeable lag between turns despite of having disabled the autosaves (although not as laggy as it was with 0.4.6).
Playing 2017-07-16.58fb2fd_Test_Win32 that lag seems gone. :D

AI keeps being too obsessed with getting early military strength when there is no threat in the surroundings, allowing me to lead on RP and colinisation rate, which ultimately brings me sure and easy victory.

I do like the new way of managing drives (i.e. only one engine per ship design), and found nothing bad with it to report.


Top
 Profile  
 
PostPosted: Tue Jul 25, 2017 11:41 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12016
Location: Munich
Oberlus wrote:
AI keeps being too obsessed with getting early military strength when there is no threat in the surroundings, allowing me to lead on RP and colinisation rate, which ultimately brings me sure and easy victory.
Have you tried adjusting the max AI aggression setting?


Top
 Profile  
 
PostPosted: Tue Jul 25, 2017 2:58 pm 
Offline
Dyson Forest
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 215
Geoff the Medio wrote:
Have you tried adjusting the max AI aggression setting?
Yes! What a coincidence. After posting this I was wondering if less aggressive AIs would be more focused on colonisation instead of militarisation, so my last game I set aggressiveness to... typical, IIRC, maybe cautious. The map is 6 players and 300 high density systems (so 50 systems per player). Well, now I'm not anymore the master of PPs and RPs. I'm focusing on research with automative adaptation, and on turn 120ish I am on par on RPs with the most powerful AI and on par on PPs with the less powerful AIs. I'm so glad!
I still need to see how will the AI behave once we come to blows, but for now it looks great.

I read somewhere in this forum (can't find it now) that setting aggressiveness to X (say maniacal) means that AIs will have an 80% chance (or sth like that) to be X and 20% to be the immediately previous level (aggressive).
If that is true, I wonder whether it would be better to allow for a uniform distribution of aggressiveness levels (i.e. if you set maximum as typical, then you get roughly same number of AIs that are typical, cautious or turtle). Or even better, add a new option in that drop-down menu to select fully "random" (uniform distribution among all the possible levels).


Top
 Profile  
 
PostPosted: Tue Jul 25, 2017 6:47 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4377
Oberlus wrote:
Geoff the Medio wrote:
Have you tried adjusting the max AI aggression setting?
Yes! ... my last game I set aggressiveness to... typical, IIRC, maybe cautious. ... on turn 120ish I am on ... par on PPs with the less powerful AIs. I'm so glad! ...
Hmmm, that's an interesting possibility. Although I could think of a couple ways that a lower aggression setting might possibly add to the AIs performance (certainly between aggressive versus maniacal), for anything below Aggressive I would normally expect those potential performance benefits to be outweighed by some hard performance constraints placed on the AI. I think it is likely you are just experiencing the expected random game-to-game variation rather than anything to do with having chosen a lower aggression level(I certainly see a great deal of variation in how well the AIs do in the games I play). But since it's been so long since I played against lower aggression AIs I suppose I should try them out a bit to get a better feel for how they are behaving these days.

I can certainly imagine how the lower aggression might lead to better performance and if so then I should adjust some aspects of all AI behavior. To be more specific, here are the two ways (which interact synergistically) that I could see a lower aggression level helping an AIs performance:
  1. Lower aggression AIs will have a lower limit on the number of concurrent expansion targets they can have, and to the extent those extra targets need military forces to overcome, the smaller limit would lead to them having a smaller total target army size. If those limits are too ambitious for the more aggressive AI's, it could lead to them overbuilding their military and not leaving enough PP for other applications needed to grow.
  2. Lower aggression AIs are more cautious, wanting to have greater military superiority in their battles both for defense and offense, and the priority always goes to defense. So the lower aggression AIs should take fewer losses when they do go to battle, This benefit was expected to be outweighed by them just not wanting to grow as fast, but perhaps the benefit of lower losses is predominating. Also, this could be interacting synergistically with the first factor, in that lower aggression AIs are more likely to concentrate their military forces defensively, and so expansion targets that require military force might languish, resulting in a more effective focus on expansion targets that don't need military force to take. The valuations for expansion targets already try to take into account how much military defense is present, but it's possible they are still underestimating the associated military cost and thereby leaving an advantage to the less aggressive AIs.

So, some interesting food for thought and possible areas for adjustment. The lower aggression AI's do also have some hard limits imposed on them, totally eschewing certain generally advantageous technologies that (story-wise) they "consider too dangerous"). Those were put in as intentional hobbles, and if other aspects of their gameplay actually manage to overcome those hobbles that would be both surprising and significant. I look forward to hearing more feedback from you regarding the results from playing several games at the lower aggression levels. I think I'll take a look at taking off those technology hobbles and testing the lower aggression AIs some to better assess these other aspects of their gameplay.

Quote:
I wonder whether it would be better to allow for a uniform distribution of aggressiveness levels (i.e. if you set maximum as typical, then you get roughly same number of AIs that are typical, cautious or turtle). Or even better, add a new option in that drop-down menu to select fully "random" (uniform distribution among all the possible levels).
My recollection is that we had started with a somewhat broader distribution of aggressions (though not as broad as you suggest), but people preferred a narrower range. I think the better resolution for the above issues, if the lower aggression AIs did prove to have some advantages we had not been expecting, would be to further adjust the various AIs behavior, not make the aggression distribution substantially broader.

_________________
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: Tue Jul 25, 2017 9:24 pm 
Offline
AI Contributor

Joined: Tue Feb 17, 2015 11:54 am
Posts: 224
Dilvish wrote:
Lower aggression AIs are more cautious, wanting to have greater military superiority in their battles both for defense and offense, and the priority always goes to defense.


I still think that excessive military defensive allocations is one of the major culprits for why the AI progress slows down so heavily in the lategame. That allocating more resources would improve the AI economics would come as a surprise to me.

That being said, the maniacal AI loves to suicide fleets into systems that once were explored several turns ago and back then had no defending fleets. As the AI won't rescout the target system, it will happily send fleets that are only slightly stronger than the planetary defences... I can imagine that this behaviour cripples the AI midgame.

_________________
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 Jul 26, 2017 6:24 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4377
Morlic wrote:
I still think that excessive military defensive allocations is one of the major culprits for why the AI progress slows down so heavily in the lategame. That allocating more resources would improve the AI economics would come as a surprise to me.
Sure-- I said above that I expected Oberlus experience in that game was probably a fluke, and just offered up an explanation of how a lower aggression "might possibly" help an AI. And of course, for the less aggressive AIs this overemphasis on defense is intentional and meant to slow down their progress. But for the more aggressive AIs it is probably about time that we try some more adjustments to their military allocation weightings to try making them more successful, sure.

Quote:
That being said, the maniacal AI loves to suicide fleets into systems that once were explored several turns ago and back then had no defending fleets. As the AI won't rescout the target system
I had started to put some code into AIFleetOrder.OrderMove.can_issue_order() that would check for target visibility and trigger a rescouting, but the way it was initially written it was rescouting too much and for whatever reason (probably just too busy I suppose) I apparently decided at the time to just comment it out with a TODO rather than fine tune it properly, but that code is just waiting for one of us to get back to it. I think one of the biggest tweaks it needs is to look at the age of the visibility info rather than just current visibility.

Quote:
it will happily send fleets that are only slightly stronger than the planetary defences... I can imagine that this behaviour cripples the AI midgame.
The Maniacal AI is supposed to be sort of this way, but we can certainly experiment with it not being quite so maniacal, and wanting a bit better margins than it uses now.

_________________
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 Jul 26, 2017 9:10 pm 
Offline
AI Contributor

Joined: Tue Feb 17, 2015 11:54 am
Posts: 224
Dilvish wrote:
Quote:
it will happily send fleets that are only slightly stronger than the planetary defences... I can imagine that this behaviour cripples the AI midgame.
The Maniacal AI is supposed to be sort of this way, but we can certainly experiment with it not being quite so maniacal, and wanting a bit better margins than it uses now.


That behavior is mostly fine if you can actually see what you are attacking. If the margin is so small that a random enemy ship that acts as decoy turns the tide, then scouting becomes absolutely critical.

Larger margins are a good idea for attacking enemy systems, anyway. If we win a battle against an enemy fleet, then that fleet is destroyed and the enemy lost PP, so losing some (possibly large) part of our fleet is reasonable. Sacrificing (possibly many) ships to only get planetary defenses down gives us no immediate value - only if we invade the planets and can actually hold them with our now weaker fleet did we achieve anything at all.

_________________
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 Jul 26, 2017 9:38 pm 
Offline
Psionic Snowflake

Joined: Wed Aug 26, 2015 6:15 pm
Posts: 493
For the games I play, I found Maniacal to be too easy. They are like Kzin, attacking before they're quite ready. If you have some room to fall back and ramp up your fleet, you can smash their ships and backtrack to their territory to grab it up.


Top
 Profile  
 
PostPosted: Thu Jul 27, 2017 9:05 am 
Offline
Dyson Forest
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 215
Dilvish wrote:
I expected Oberlus experience in that game was probably a fluke
Can be, of course. Just one game is anecdotic. But second game has gone the same way: this time 400 systems for 10 player (I + 9 AIs, typical), everything medium but density (high), and again I'm having a hard (i.e. fun) time to keep up with some of the AIs.
Since my last 30ish games with similar settings except for the aggressiveness were cakewalks, and the two (i.e. all) my games with aggressiveness set to typical have become a real challenge, I'm starting to see a pattern here. I'll keep playing until I finish 10 typical games, and then check out what happens in galaxy settings with less systems per player.


Top
 Profile  
 
PostPosted: Thu Jul 27, 2017 9:55 am 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3264
Observation: awhileback someone on Github reported they thought the AI performed better in the Python generated layouts rather than the C++ ones. I've noticed that the AI seems to do better in Clusters than it does in most others, and tends to do worse in spirals.

But it's just observation, knowing how much is AI behaviour and how much good/bad starts is impossible, but I am fairly sure there's a pattern having played multiple games since.

(the spirals are still made using old C++ code, Irregular and Clusters use python, I'm not sure where the others are)

_________________
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: Thu Jul 27, 2017 4:50 pm 
Offline
Dyson Forest
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 215
A command-line tool to launch FO games for AIs of different settings* to battle among them, that runs unattended (no human players, all graphical functinality disabled) until finished with the necessary log and save file as only output. (*) Its input would be the galaxy setting as well as the aggressiveness and species for each separate player (AI), and ideally would include some extra fine-tunning or testing parameters fo the AIs, like, I don't know, the strategy to govern the research sequence, the priorities for PP investment, any rules or parameters to condition how AI makes each decission from empire-wide management to tactical comanding... up to anything that is hardcoded and influence the AI decissions, or better exactly those hardcoded parameters (or constants that change from versions or AI files, if any) that an AI dev would care for.
Is any of that already possible?

With such command-line simulation tool, it would be "easy" to apply some kind of optimisation algorithm to find possibly good AI configurations for given starting game settings (just possibly because the absence of human players in the simulations renders them a bit unreliable). Well, at least "easy" for those game settings whose average run time is small enough. And the results could be useful to the AI team? No idea really if any of all this makes sense at all with FO AI's implementation.


Top
 Profile  
 
PostPosted: Fri Jul 28, 2017 3:07 pm 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4243
Location: Sol III
MatGB wrote:
Observation: awhileback someone on Github reported they thought the AI performed better in the Python generated layouts rather than the C++ ones ... (the spirals are still made using old C++ code, Irregular and Clusters use python, I'm not sure where the others are)
Um, that's not the case anymore, for a long time actually. When I implemented Python scripted universe generation, I first kept the C++ galaxy shape generation functions (and only added one that was done in Python), but migrated all these functions to Python later on.

So, system placement for all galaxy shapes is done in Python (default/python/universe_generation/galaxy.py).


Top
 Profile  
 
PostPosted: Sat Jul 29, 2017 6:29 am 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3264
Vezzra wrote:
MatGB wrote:
Observation: awhileback someone on Github reported they thought the AI performed better in the Python generated layouts rather than the C++ ones ... (the spirals are still made using old C++ code, Irregular and Clusters use python, I'm not sure where the others are)
Um, that's not the case anymore, for a long time actually. When I implemented Python scripted universe generation, I first kept the C++ galaxy shape generation functions (and only added one that was done in Python), but migrated all these functions to Python later on.

So, system placement for all galaxy shapes is done in Python (default/python/universe_generation/galaxy.py).

Oh, OK, thanks, must have missed the latter change, and it was long enough ago that it can't explain the poor Spirals performance (which would've been a weird explanation but at least one that was explicable). The AI definitely performs better in Clusters and Irregular based on my recent observations, can't figure out why though.

_________________
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: Tue Aug 01, 2017 8:51 am 
Offline
Dyson Forest
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 215
Playing 2017-07-25.7e2d33a_Test_Win32.

I've played the following games (always as human, everything medium except planets, high, and monsters, low):

- Irregular 400 Typical.
- Irregular 400 Cautious.
- Irregular 300 Typical
- Irregular 300 Cautious.
- Irregular 250 Cautious (three times with different seeds).
- Cluster 250 Cautious (two times with different seeds).

The first four games I noticed a considerable improvement over the games I'm used to against Maniacal AIs in maps with 30+ systems per player. I needed to reach at least turn 150ish to surpass the best AI on combined PP+RP, while against more aggressive AIs I can be the king of mambo before turn 100. I'd say typical/cautious do way better on early colonisation than aggressive/maniacal.

Then I begin the games with 25 systems per player. Now I'm in pain. I've actually lost the two games on cluster. When I say lost I mean not even the comsat strategy was enough, AIs just stomped over my systems and kept going. I hadn't see this since my second game when I had everything to learn.
I don't know if there has been a change in the AIs or if I can blame the aggressiveness setting for this, but the cautious/typical AIs do not stay still with a huge fleet several times stronger than mine, they rather use that army and trample over mine.
As I said before, I couldn't even swarm comsats to buy time, I had not enough PPs to keep up with the several front lines.

I'm so pleased with this "discovery".


Top
 Profile  
 
PostPosted: Tue Aug 01, 2017 8:50 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4377
Oberlus wrote:
Is any of that already possible?
A while back we implemented the basics of an AI config file to enable just the kind of "evolutionary" exploration of configs like you are talking about, although one of the necessary commandline options got broken a while back, the one for autoquitting, so now it just hangs with an error message about a savegame being in process, but that does not seem to ever clear in this case. One of these days, though, we'll get that sorted out and be able to do an evolutionary refinement to the A. That's not the only thing holding it up, though, we also need to write the basic harness for that as well.

Oberlus wrote:
I've played the following games ... Now I'm in pain....
Interesting feedback, thanks, please keep it up.

_________________
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  [ 19 posts ]  Go to page 1, 2  Next

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:  
cron
Powered by phpBB® Forum Software © phpBB Group