Ships not repairing as fast as they should?

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

Message
Author
User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Ships not repairing as fast as they should?

#16 Post by Vezzra »

Any progress on that issue? That should be fixed before RC1 I think...

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

Re: Ships not repairing as fast as they should?

#17 Post by Geoff the Medio »

If someone would post a save that can replicate a similar odd repair situation, it would be very helpful for investigation.

Otherwise, nobody seemed to object to reverting to one-turn repairs from drydocks.

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

Re: Ships not repairing as fast as they should?

#18 Post by MatGB »

I don't think it can be without a massive delay TBH. I've observed it a few times, and not just with damage control, but nothing replicatable or even recorded, I'm now specifically looking for it, AFAICS there's nothing wrong with the script code, 99% of the time that works, but sometimes an effect just doesn't process for an object, I've seen it with a few things, including focus changes, force/energy structures and damage control. For one ship in a fleet to repair as expected, another to repair with some of the effects and the rest to repair with everything is just weird and wrong.

However, I'd be happy to have drydocks go to full repair for 0.4.4 conditional on them not staying that way when we go to rework building based repairs completely in the next cycle (for which I have many ideas, some of which conflict).

I'm fairly sure we have a rare, recurring occasional glitch in effects processing, but I can't track it down or replicate it yet, think we need to flag it for all players (or at least forum users) to find examples + full logs so we can figure out where it's happening. In the meantime, here's a drydock patch that I'm not 100% happy with for balance reasons but it's better than the 10 p/t thing.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]

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: Ships not repairing as fast as they should?

#19 Post by Dilvish »

I was chasing down a blockades problem, which turned out to be a problem with fleets being properly recognized as stationary if a route had been set for them but then they were put back to being stationary; I think that was also quite likely the cause of the problem in the original post here -- Fleet Repair and Advanced Damage Control require that a fleet be stationary, but Drydocks and Basic Damage Control do not.

I just committed a fix in trunk 7410, (0.4.4 7412), so we may not need to switch drydocks back to 100% repair in a single turn.
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
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Ships not repairing as fast as they should?

#20 Post by Vezzra »

MatGB wrote:In the meantime, here's a drydock patch that I'm not 100% happy with for balance reasons but it's better than the 10 p/t thing.
Committed to trunk, merged to release branch.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Ships not repairing as fast as they should?

#21 Post by Vezzra »

Dilvish wrote:so we may not need to switch drydocks back to 100% repair in a single turn.
The issue with drydocks wasn't only because of this bug - as I said in my post above:
Vezzra wrote:Can we please change drydock repair rate up to full repair in one turn again for 0.4.4? The current setup is kind of ridiculous - Fleet Field Repair and Advanced Damage Control can each repair a ship in the field as fast as a drydock? And multiple drydocks that stack? How - by sending half of the ship to one and the other half to the second drydock? Just give them full repair capability again, and all these curiosities go away.
All these quirks actually have nothing to do with the repair bug we've been dealing with here. That said, of course simply giving drydock full repair ability isn't exactly the ideal solution, but it's still better than them repairing just 10% of max structure, and should be sufficient for 0.4.4 (I hope that doesn't screw with the AI?).

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

Re: Ships not repairing as fast as they should?

#22 Post by MatGB »

AI will be fine with it, they're already set to use drydocks fairly well and making them better is fine. I agree overall tho, drydocks, while cheap and quick to build, should be good and strategic points to grab and makign them actually good when field repair is reduced is a good strategic goal.

Longer term, I'd like to either scrap drydocks and have repairs done by the buildings that make the ship (partially also making stargates/transformers even more useful) or have drydocks repair at a slower rate and stack with the buildings, but at most 50% per turn, perhaps with field repair switched to a (higher) %age of current structure not of max structure, meaning lightly damaged ships can fix themselves quickly, but heavily damaged ships need to return for repair, which is how it should be I think.

However, Dilvish, it never occured to me in trying to test/replicate that it might be a bug with the "stationary" clause, that's needed to not cause massive log error outputs when a damaged ship is in transit (the last turn battle here when it's not somewhere a battle can take place), which would've been solved by Geoff's recent exposure of ship last turn in battle to scripting. If that does solve the actual bug that's good long term and for other instances, thanks.

(the big problem I have with drydocks as now for balance is that they make hideously powerful things like Fractals and Titans even more overpowered but that's a different 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.

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

Re: Ships not repairing as fast as they should?

#23 Post by Geoff the Medio »

MatGB wrote:However, Dilvish, it never occured to me in trying to test/replicate that it might be a bug with the "stationary" clause, that's needed to not cause massive log error outputs when a damaged ship is in transit (the last turn battle here when it's not somewhere a battle can take place)...
The "InSystem" condition before "Stationary" should prevent such issues just as well. However, stationary is separately necessary to select just ships that aren't moving but ended up in a system at the end of a turn, and it might also have some recently-added bugs given the semi-recent changes to how fleet movement is stored and ordered.
the big problem I have with drydocks as now for balance is that they make hideously powerful things like Fractals and Titans even more overpowered but that's a different issue
Hulls (or parts?) could be made repairable or not with tags, or a dedicated parser flag.

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

Re: Ships not repairing as fast as they should?

#24 Post by MatGB »

On the first, I need to do further testing but fairly sure ships that arrive on a turn are getting the field repair, I've observed it as so anyway, I thought that fine for balance so didn't think to check if it was meant to be, it was balancing I was worried about.

On the latter point, the problem I have with big hulls balance wise is it takes a LOT of effort to knock something with 200+ structure down to nothing, if you can get one down to, say, 10% remaining then it runs and gets 100% repaired quickly that's a lot harder for an attacker to deal with than a bunch of ships with, say, 50 structure each. It's not that they repair per se, it's that they get a bigger advantage from %age based repair compared to smaller ships.

But balancing repairs is somethign we've discussed working on for 0.4.5 so this is fine for now.
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: Ships not repairing as fast as they should?

#25 Post by Dilvish »

MatGB wrote:... fairly sure ships that arrive on a turn are getting the field repair
yes, it's intended that just-arrived fleets count as stationary per the comments in Condition::Stationary
// if a fleet is available, it is "moving", or not stationary, if it's
// next system is a system and isn't the current system. This will
// mean fleets that have arrived at a system on the current turn will
// be stationary, but fleets departing won't be stationary.
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: Ships not repairing as fast as they should?

#26 Post by MatGB »

That's what I thought, but it matters not, I put the condition in to make the code work, insystem would've been as good, don't know why I picked one over the other. It isn't, of course, needed for drydocks as they can only be in a system. Might be worth changing at least one of the two techs (ADC?) to simply be ship not been in battle when we revamp it all thoroughly, if we keep those techs at all.
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: Ships not repairing as fast as they should?

#27 Post by Geoff the Medio »

Dilvish wrote:...it's intended that just-arrived fleets count as stationary per the comments in Condition::Stationary
Being so described in the comments doesn't necessarily mean that's how it was "intended" to work... It could have just been the easiest way to implement it, and with no reason to do anything different at the time, was done by default. If it needs to change for some reason, it can be changed...
MatGB wrote:...insystem would've been as good, don't know why I picked one over the other.
Fleet field repair has both...

Code: Select all

scope = And [
    Ship
    InSystem
    Stationary
    OwnedBy TheEmpire Source.Owner
    Turn low = LocalCandidate.System.LastTurnBattleHere + 1
    Structure high = LocalCandidate.MaxStructure - 0.001
    ResupplyableBy empire = Source.Owner
]

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

Re: Ships not repairing as fast as they should?

#28 Post by MatGB »

In which case it always had it, the big change I made was to Advanced Damage Control, all I did to field repair was change the end result of what it did to imrpove it (and change the price), must have missed it when copying to ADC. If it makes the code better should add it next we do a patch to that file? It seems to work fine without it (or at least work as fine as FFR anyway).
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: Ships not repairing as fast as they should?

#29 Post by Dilvish »

Geoff the Medio wrote:Being so described in the comments doesn't necessarily mean that's how it was "intended" to work... It could have just been the easiest way to implement it...
Um, yeah, if I refer to code I haven't written as working as intended, I'm not trying to claim any knowledge of Founder's Intent or somesuch, I'm simply talking about the code operation conforming to its documentation/comments, meaning that this issue, unlike the one just solved, was not a mysterious bug needing to be tracked down. Certainly we can always choose to change how things are done.
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: Ships not repairing as fast as they should?

#30 Post by Dilvish »

MatGB wrote:insystem would've been as good, don't know why I picked one over the other. It isn't, of course, needed for drydocks as they can only be in a system. Might be worth changing at least one of the two techs (ADC?) to simply be ship not been in battle when we revamp it all thoroughly, if we keep those techs at all.
Food for thought: a key situation where the distinction matters a lot is when a ship is insystem, trying to depart, but prevented by a blockade. In that situation it will currently not count as stationary even if it remains in the same system one turn after another.
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