This isn't the first time I've observed this but it's the first clear example.
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.
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.AI client not giving correct stealth info?
Moderator: Oberlus
AI client not giving correct stealth info?
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Re: AI client not giving correct stealth info?
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).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.
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
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: AI client not giving correct stealth 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:Dilvish wrote:...I think we need to get AI access to the Universe.GetEffectAccountingMap() method/info...
Code: Select all
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> > > > > &>)
Re: AI client not giving correct stealth info?
This explanation makes perfect sense, thanks, and I'd forgotten there might've been a Derelict reveal.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.
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.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Re: AI client not giving correct stealth info?
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.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
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: AI client not giving correct stealth info?
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).
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
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: AI client not giving correct stealth info?
Yes.Dilvish wrote:Hmm, it let you compile, and then you get a runtime error?