Page 1 of 2

planets troops increasing even with attacking ships in orbit

Posted: Sun Feb 11, 2018 6:41 am
by UrshMost
Is this an intended change? I noticed that on a scylor planet that I was attacking their troops were increasing even though I had blockading ships in orbit.

In the screencaps below you can see that on turn 131 the planet has 2 troops but on the next turn its grown to 3, even though I have a fleet in orbit and there don't appear to be any stealth issues going on.
(I am in blue, I've taken over Albans a II, but didn't have quite enough troops for Albans a I. By the time the additional dropship was built I found to my surprise it was no longer enough.)

Build 2018-02-04

Re: planets troops increasing even with attacking ships in o

Posted: Sun Feb 11, 2018 7:05 pm
by Oberlus
Maybe the troop meter is also subject to the defense regeneration techs?

Re: planets troops increasing even with attacking ships in o

Posted: Sun Feb 11, 2018 9:16 pm
by Dilvish
Oberlus wrote:Maybe the troop meter is also subject to the defense regeneration techs?
Checking the scripts, it does not look that way to me, and the troop level techs that provide a bonus troop regen have it gated by LastTurnBattleHere, so that shouldn't be doing it either.

Re: planets troops increasing even with attacking ships in o

Posted: Sun Feb 11, 2018 10:09 pm
by Geoff the Medio
Should meter regen be gated by when a battle occurred in the system, or by when the planet was attacked? Currently it's the latter, possibly with some lingering buggy - 1's in the scripts.

Re: planets troops increasing even with attacking ships in o

Posted: Sun Feb 11, 2018 10:56 pm
by Dilvish
Geoff the Medio wrote:Should meter regen be gated by when a battle occurred in the system, or by when the planet was attacked? Currently it's the latter, possibly with some lingering buggy - 1's in the scripts.
I suppose you mean that the base regen is gated by LastTurnAttackedByShip? Before I posted above, I reviewed the scripts, and it looked pretty clear to me that the bonus regens provided by the troop techs are currently gated by LastTurnBattleHere. As far as which one it *should be*, it does seem like they should both be the same, and as I recall we had previously discussed the overall issue and the LastTurnAttackedByShip gate is the newer one we had decided to move to, these troop regen techs must have just slipped through.

As for lingering buggy -1's,
* After your couple of recent commits making corrections for that, I scanned the scripting for any other uses of LastTurnAttackedByShip and found no others
* I have now also scanned for all uses of LastTurnBattleHere, and it looks to me like they are all of the form "Turn low = X.System.LastTurnBattleHere + 1" which looks fine to me (where 'X' was either 'Source' or 'LocalCandidate').
* So those all look fine to me, and I don't think that could have caused the premature (as opposed to delayed) regen anyways

Re: planets troops increasing even with attacking ships in o

Posted: Sun Feb 11, 2018 11:04 pm
by Geoff the Medio
In troops.macros there is a "(Source.LastTurnAttackedByShip < CurrentTurn)" remaining. Other meters have it as well. I'll switch them to LastTurnBattleHere.

Edit: https://github.com/freeorion/freeorion/ ... f1b690c514

I'm pondering removing several conditions, like Turn, that can be replaced with (Value1 >= Value2) style conditions, to simplify the parser format.

Re: planets troops increasing even with attacking ships in o

Posted: Sun Feb 11, 2018 11:26 pm
by UrshMost
I don't know if it's directly related to this or not but I just noticed my ships in orbit around enemy planets are repairing as well.

Re: planets troops increasing even with attacking ships in o

Posted: Sun Feb 11, 2018 11:43 pm
by dbenage-cx
Given a system with only a single planet with Ancient Guardians, still seeing +1 troop gain where ships have attacked for 5+ turns.

Oddly enough, changing the "increase 1 per turn" effectgroup in /scripting/species/common/troops.macros to equal current turn increases the troop gain to +2.
(LastTurnAttackedByShip < CurrentTurn changed to LastTurnAttackedByShip <= CurrentTurn)
Deleting the effect removes any gain on this planet (in both cases, need to click next turn to update changes on load).
Edit: This was as of fff1390 - "Additional - 1 missed in previous commit.", rebuilding.

Not sure if related, in this same instance the Invade button does not appear when troop ships are in system.
I'll open an issue for unable to invade with savegame later.

Re: planets troops increasing even with attacking ships in o

Posted: Mon Feb 12, 2018 3:49 am
by Dilvish
Geoff the Medio wrote:In troops.macros there is a "(Source.LastTurnAttackedByShip < CurrentTurn)" remaining. Other meters have it as well. I'll switch them to LastTurnBattleHere.
Ack!
Dilvish wrote:...as I recall we had previously discussed the overall issue and the LastTurnAttackedByShip gate is the newer one we had decided to move to
Did you have a different recollection than me, or did you perhaps misread my sentence with too many clauses?

Re: planets troops increasing even with attacking ships in o

Posted: Mon Feb 12, 2018 7:43 am
by Geoff the Medio
Dilvish wrote:...did you perhaps misread my sentence with too many clauses?
Sorry, I missed this bit...
...LastTurnAttackedByShip gate is the newer one we had decided to move to...
But,
it does seem like they should both be the same...
.System.LastTurnBattleHere will be the current/last turn for any battle. .LastTurnAttackedByShip will only be the latest turn if the planet was actually attacked by a ship in the battle, which it might not be if there are also allied ships in the battle.

Re: planets troops increasing even with attacking ships in o

Posted: Mon Feb 12, 2018 3:17 pm
by Dilvish
Geoff the Medio wrote:LastTurnAttackedByShip will only be the latest turn if the planet was actually attacked by a ship in the battle, which it might not be if there are also allied ships in the battle.
Yes, OK; or, if there are several planets present, and the attacker only sends in a single ship.

I am not having luck finding the previous discussion I was thinking of, but one of the examples there was about repeatedly sending in a single small cheap sacrificial ship to initiate combat in the system without a real chance of doing anything except triggering LastTurnBattleHere and blocking local planet defense regen, and the consensus was that we didn't like that being a viable tactic, and if a planet wasn't actually attacked then it should get to regen. (edit: I now think that discussion must have been about blocking various damage repair techs for ships, rather than planet regen, since planet regen had long been tied to actually getting hit.)

At least, that's my recollection; I am frustrated by my inability to find that previous discussion via searching. I did find a previous discussion where we noted a related problem-- if an outpost undergoing an extended blockade had gotten its defenses and infrastructure knocked to zero on one turn, then they would still be zero on the next turn, leading to it not getting attacked that next turn and therefore allowing regen for a turn, which we didn't like. In that discussion it seems we had settled on marking such outposts as attacked even if they weren't actually hit.

Relying on LastTurnBattleHere is a simpler solution, but not one that I really like, and it seems like a pretty big change to me.

Re: planets troops increasing even with attacking ships in o

Posted: Mon Feb 12, 2018 3:53 pm
by Geoff the Medio
Feel free to switch the scripts back to LastTurnAttackedByShip...

Re: planets troops increasing even with attacking ships in o

Posted: Thu Feb 15, 2018 11:18 am
by Oberlus
planets troops increasing even with attacking ships in orbit
Bump.

Also, AIs can't conquer my planets, dunno why. And I can't conquer theirs.

I'm over an outposted asteroid belt, with two warships and 16 troops in orbit, combat is being triggered and planet is flat. Yet I won't see the Invade button. There is visibility, double checked.
Before, the AI was orbiting my undefended planet with two warships and 6 or 8 troops for 7 turns, during which the troops of my planet grew from 0.** to 2.**, besides the enemy attacking it.

So something bad is broken.

Edit: maybe it's been fixed along with this. I'll check later on my laptop with compiled FO.

Re: planets troops increasing even with attacking ships in o

Posted: Sat Feb 17, 2018 7:04 am
by UrshMost
FYI; Build 02-12 win32, unable to invade now (no invade button), and enemy troops still increasing while i'm in orbit.

Re: planets troops increasing even with attacking ships in o

Posted: Sat Feb 17, 2018 10:13 am
by Oberlus
Yeah. The compiled version, pulled from github two days ago, has the same problem.

I wonder if it is related to the InitialMeterValue/CurrentMeterValue FOCS thingy?

No need to say this is gamebreaking.