Drydocks vs Stargates

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

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

Drydocks vs Stargates

#1 Post by MatGB »

Here's a weird one. If a fleet of damaged ships arrives at a system set to Stargate send containing a drydock, they'll go through the drydock without getting repaired. They will get repaired if there's a drydock at the receiving system.

However, despite them not getting repaired, a Sitrep will be generated telling you they have been.

Any ideas?
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: Drydocks vs Stargates

#2 Post by Dilvish »

MatGB wrote:Here's a weird one. If a fleet of damaged ships arrives at a system set to Stargate send containing a drydock, they'll go through the drydock without getting repaired. They will get repaired if there's a drydock at the receiving system.
That makes sense to me (at least, it makes sense that it happens, not necessarily that it makes the most sense for the game). The Stargate effect is a focus effect, which is covered in species.txt, the first set of effects to get processed; drydock effects get processed later.
However, despite them not getting repaired, a Sitrep will be generated telling you they have been. Any ideas?
Do you mean that if there is no drydock at the receiving end this happens? Looking over the script, that does not seem possible to me that the repair could be decoupled from the sitrep-- they are in the same EffectsGroup.
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: Drydocks vs Stargates

#3 Post by MatGB »

Dilvish wrote:
MatGB wrote:Here's a weird one. If a fleet of damaged ships arrives at a system set to Stargate send containing a drydock, they'll go through the drydock without getting repaired. They will get repaired if there's a drydock at the receiving system.
That makes sense to me (at least, it makes sense that it happens, not necessarily that it makes the most sense for the game). The Stargate effect is a focus effect, which is covered in species.txt, the first set of effects to get processed; drydock effects get processed later.

Yup, it makes sense to me as well, it's the sitrep that makes no sense.
However, despite them not getting repaired, a Sitrep will be generated telling you they have been. Any ideas?
Do you mean that if there is no drydock at the receiving end this happens? Looking over the script, that does not seem possible to me that the repair could be decoupled from the sitrep-- they are in the same EffectsGroup.
Exactly. At the time I typed this I was looking at a fleet that had taken a battering against a Sentinel and gone through a stargate without repairing. I was also looking at a Sitrep telling me they had all been repaired.
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: Drydocks vs Stargates

#4 Post by Dilvish »

Hmm, now it comes to mind that there are multiple rounds for EffectsProcessing, first m_universe.ApplyAllEffectsAndUpdateMeters(), and then a bit later m_universe.ApplyMeterEffectsAndUpdateMeters(); which only does meters (I think redoing/resetting the results from the initial round). So if the movement phase was between these two calls, then that would explain the result you see. But these are both in ServerApp::PostCombatProcessTurns(), and so I still don't see how what you observe would be happening. Have you repeated it?
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: Drydocks vs Stargates

#5 Post by MatGB »

Just managed to repeat it, yes, same gate/drydock, this time with a Great Kraken, had to comment out the damage control techs to prove it but yup, repeats, sitrep generated, ship moved to new location, no repair.

For this specific issue, I'd been planning to make Drydocks and the techs require the ships not have moved that turn as well as be stationary, but while that would stop this happening it doesn't solve the underlying "this shouldn't happen like this at all" for future scripts.

FWIW, I'd noticed this before in a "I'm sure they're supposed to be repaired" way but this is the first time I've confirmed it with a savegame, etc
Mat Bowles

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

Post Reply