FreeOrion

Forums for the FreeOrion project
It is currently Thu Dec 14, 2017 5:11 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Sep 21, 2017 11:37 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3291
This isn't the first time I've observed this but it's the first clear example.
Attachment:
Spectacle.J11063.png
Spectacle.J11063.png [ 185.58 KiB | Viewed 105 times ]

The troop ship has been there for awhile, the AI cannot see that Setinon colony but has a troop ship there set to invade. It obviously can't because it can't see it.

I've also occasionally observed this for Furthest and in one case a Lembalalam colony. While the system should be highlighted if there's a homeworld there that you can't see, knowing what troops are needed, etc seems off.

Unfortunately it's a recent reload so no logs of any use but hopefully this can help? It's not game breakingly bad, obviously, but they're spending resources way too early and it's knowledge that shouldn't be there.

_________________
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: Fri Sep 22, 2017 6:04 am 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
MatGB wrote:
The troop ship has been there for awhile, the AI cannot see that Setinon colony but has a troop ship there set to invade. It obviously can't because it can't see it.
Right, that's one of those lingering inefficiencies we haven't fixed yet, though the AI code does have a couple related TODOs. I think the problem can get triggered in a couple ways, such as when a derelict momentarily grants the AI visibility of the stealthed planet, or the AI sees a planet that has been outposted by an AI but not yet had a stealthy colony established on it, and it starts thinking of it as an invasion target; the logic the AI tries using to decide if the planet has a permanent stealth effect is a bit weak (comparing last turn it had partial_visibility of the planet to the last turn it had partial_visibility of the system, there is a TODO to improve that). So it may think the planet is easy pickings and not realize the mistake until the troopships arrive and the code for aborting an in-progress invasion mission is just a placeholder at this point (also a TODO in place there).

To really handle this kind of thing well, I think we need to get AI access to the Universe.GetEffectAccountingMap() method/info that the human UI uses to display meter accounting info, which lets the human player figure out if a stealth effect is just temporary from an ion storm or whatnot, or apparently something more permanent.

In the meantime, we let the AI take a more aggressive, sometimes resource wasteful, approach, rather than foregoing valid invasion opportunities. We could think about flipping that decision, if you think that would be noticeably better (or maybe add enough logic to tie it to AI aggression), but I expect we'll get this shored up in the not too distant future, and I'll open an issue to help prompt us to improve the AI handling sooner rather than later.

_________________
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: Fri Sep 22, 2017 10:50 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12041
Location: Munich
Dilvish wrote:
...I think we need to get AI access to the Universe.GetEffectAccountingMap() method/info...
I had a go, but I'm getting some errors from Python when trying to run a game... Not sure what the issue is:
Code:
ArgumentError: Python argument types in
    MeterTypeAccountingInfoVecMap.__iter__(MeterTypeAccountingInfoVecMap)
did not match C++ signature:
    __iter__(struct boost::python::back_reference<class std::map<enum MeterType,class std::vector<struct Effect::AccountingInfo,class std::allocator<struct Effect::AccountingInfo> >,struct std::less<enum MeterType>,class std::allocator<struct std::pair<enum MeterType const ,class std::vector<struct Effect::AccountingInfo,class std::allocator<struct Effect::AccountingInfo> > > > > &>)


Top
 Profile  
 
PostPosted: Fri Sep 22, 2017 5:29 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3291
Dilvish wrote:
In the meantime, we let the AI take a more aggressive, sometimes resource wasteful, approach, rather than foregoing valid invasion opportunities. We could think about flipping that decision, if you think that would be noticeably better (or maybe add enough logic to tie it to AI aggression), but I expect we'll get this shored up in the not too distant future, and I'll open an issue to help prompt us to improve the AI handling sooner rather than later.

This explanation makes perfect sense, thanks, and I'd forgotten there might've been a Derelict reveal.

At the moment, it's an edge case as there are a tiny number of really stealthed native species, but it might become more of an issue when we move on making stealth an interesting/viable strategy but we know the AI needs work for that anyway.

If we decide to add a fair few more stealthed natives then it's something to bear in mind but not many suggestions recently so not currently an issue.

_________________
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: Fri Sep 22, 2017 5:51 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
Geoff the Medio wrote:
I had a go, but I'm getting some errors from Python when trying to run a game... Not sure what the issue is

Hmm, it let you compile, and then you get a runtime error? For me on Ubuntu, it wouldn't even compile. At your end the problem might have only been an incomplete edit for the type of MeterTypeAccountingInfoVecMap, at my end there was also a symbol visibility issue. It seems to work OK for me now (at least compiling and running, I haven't yet tried having the AI actually use the info) and I have pushed my fix to the branch.

_________________
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: Fri Sep 22, 2017 6:00 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
p.s Geoff, Thanks for getting most of that taken care of.

On a related note, does anyone know whether the no-proxy rule for such exposures causes a shallow copy or a deep copy to be made? For me in this case, it was not necessary to have no_proxy set to true for AccountingInfoVec and MeterTypeAccountingInfoVecMap. I left those no_proxy specifications as-is to be conservative, but if the no_proxy for TargetIDAccountingMapMap is causing a deep copy anyways, then I think we could be quite a bit more memory efficient by not making AccountingInfoVec and MeterTypeAccountingInfoVecMap be no_proxy, especially if we really start using this info (there are more applications for it than just the stealthed invasion issue).

_________________
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: Fri Sep 22, 2017 10:07 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12041
Location: Munich
Dilvish wrote:
Hmm, it let you compile, and then you get a runtime error?
Yes.


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