Stealth in combat

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderator: Oberlus

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 Reply
Message
Author
User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Stealth in combat

#1 Post by MatGB »

It's my understanding that if a ship has higher stealth than its enemy's detection, it cashouldn't be targetted in the first round but, once it has fired, it reveals its position and is then fair game.

Up against an AI with Multi-Spectrals, and I've just sent in 4 ships to try to take down two of its. We both lost a ship, but my ships were able to target both its ships on the turn of the combat.

If my understanding is correct, it's not working as intended. However, the first ship to fire within the first round was one of the AI ships, one of my ships then targetted it exclusively, then the other AI ship fired and it became a free-for-all.

If all combat is meant to be simultaneous per round, then the order ships fire shouldn't make a difference, in this case it appears it does (it's very rare for me to go up against a stealthed opponent I can't see so while I've wondered if it was working properly before this is the first time I've confirmed it's not).

Now, this behaviour can be explained (immediately a ship opens up you return fire), but I'm not sure it gives stealth an advantage.
Attachments
stealth-fail.png
stealth-fail.png (86.23 KiB) Viewed 522 times
Mat Bowles

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

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Stealth in combat

#2 Post by MatGB »

OK, second fight, complete opposite problem. In the first fight, the ships had been in orbit around, and attacking, my planet. In this fight, I was in an AI system and one of their ships moved in to attack me.

In the first round, Unknown shoots but isn't shot back (intended?) in the 2nd round onwards my ships are shooting at it but, even after it's been destroyed, it's still 'unknown'.

So maybe stealth is working, but I'm not sure the information to players is good
Attachments
stealth-fail2.png
stealth-fail2.png (72.02 KiB) Viewed 519 times
Mat Bowles

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

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Stealth in combat

#3 Post by Dilvish »

MatGB wrote:Now, this behaviour can be explained (immediately a ship opens up you return fire), but I'm not sure it gives stealth an advantage.
Right, two things wrong with it working this way -- (1) order of firing matters, and (2) stealth can actually make things worse for the side with stealth. I'll take a look at changing when firing ships become visible-- please set that savegame aside if you can (from the turn before this combat) to check again later.
MatGB wrote:In the first round, Unknown shoots but isn't shot back (intended?)
Right, that's how it should always work first round, here it just worked out because the stealthed ship shot last.
in the 2nd round onwards my ships are shooting at it but, even after it's been destroyed, it's still 'unknown'.
I suspect the problem is that the server head already 'cleaned up' the destroyed ship and removed it from its object map before it did another round of updating visible object info, so it had no more info to pass on. I'll mull on ways to deal with that.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Stealth in combat

#4 Post by Dilvish »

Dilvish wrote:I'll take a look at changing when firing ships become visible-- please set that savegame aside if you can (from the turn before this combat) to check again later.
This should be fixed now; please check again once you've updated and recompiled.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Stealth in combat

#5 Post by MatGB »

compiles with errors:

Code: Select all

                                                               
Building CXX object client/human/CMakeFiles/freeorion.dir/__/__/UI/MapWnd.cpp.o
/home/matgb/freeorion/combat/CombatSystem.cpp: In function ‘void {anonymous}::CombatRound(int, CombatInfo&, {anonymous}::AutoresolveInfo&)’:
/home/matgb/freeorion/combat/CombatSystem.cpp:1009:95: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int event_index = init_event_index; event_index < combat_info.combat_events.size(); event_index++) {
                                                                                               ^
/home/matgb/freeorion/combat/CombatSystem.cpp: In function ‘void {anonymous}::CombatRound(int, CombatInfo&, {anonymous}::AutoresolveInfo&)’:
/home/matgb/freeorion/combat/CombatSystem.cpp:1009:95: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int event_index = init_event_index; event_index < combat_info.combat_events.size(); event_index++) {
                                                                                               ^
/home/matgb/freeorion/combat/CombatSystem.cpp: In function ‘void {anonymous}::CombatRound(int, CombatInfo&, {anonymous}::AutoresolveInfo&)’:
/home/matgb/freeorion/combat/CombatSystem.cpp:1009:95: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int event_index = init_event_index; event_index < combat_info.combat_events.size(); event_index++) {
                                                                                               ^
Linking CXX executable ../../freeorionca
Seems to boot up and run fine 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.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Stealth in combat

#6 Post by Geoff the Medio »

MatGB wrote:compiles with errors:
Those are warnings, not errors.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Stealth in combat

#7 Post by Dilvish »

hmm, I suppose I should clean that up to use unsigned int...
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Post Reply