planets troops increasing even with attacking ships in orbit

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.
Message
Author
UrshMost
Space Kraken
Posts: 123
Joined: Fri Jul 03, 2015 2:32 am
Location: Great White North Eh

planets troops increasing even with attacking ships in orbit

#1 Post 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
Attachments
freeorion one.jpg
freeorion one.jpg (202.76 KiB) Viewed 6000 times
freeorion two.jpg
freeorion two.jpg (205.79 KiB) Viewed 6001 times
Windows 10 64bit, AMD 8 Core, 16 GB
Nvidia GTX 670 @ 3240x1920
FreeOrion Build: Latest Windows Test Build

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: planets troops increasing even with attacking ships in o

#2 Post by Oberlus »

Maybe the troop meter is also subject to the defense regeneration techs?

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

Re: planets troops increasing even with attacking ships in o

#3 Post 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.
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
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: planets troops increasing even with attacking ships in o

#4 Post 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.

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

Re: planets troops increasing even with attacking ships in o

#5 Post 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
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
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: planets troops increasing even with attacking ships in o

#6 Post 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.

UrshMost
Space Kraken
Posts: 123
Joined: Fri Jul 03, 2015 2:32 am
Location: Great White North Eh

Re: planets troops increasing even with attacking ships in o

#7 Post 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.
Windows 10 64bit, AMD 8 Core, 16 GB
Nvidia GTX 670 @ 3240x1920
FreeOrion Build: Latest Windows Test Build

dbenage-cx
Programmer
Posts: 389
Joined: Sun Feb 14, 2016 12:08 am

Re: planets troops increasing even with attacking ships in o

#8 Post 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.

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

Re: planets troops increasing even with attacking ships in o

#9 Post 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?
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
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: planets troops increasing even with attacking ships in o

#10 Post 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.

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

Re: planets troops increasing even with attacking ships in o

#11 Post 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.
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
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: planets troops increasing even with attacking ships in o

#12 Post by Geoff the Medio »

Feel free to switch the scripts back to LastTurnAttackedByShip...

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: planets troops increasing even with attacking ships in o

#13 Post 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.

UrshMost
Space Kraken
Posts: 123
Joined: Fri Jul 03, 2015 2:32 am
Location: Great White North Eh

Re: planets troops increasing even with attacking ships in o

#14 Post by UrshMost »

FYI; Build 02-12 win32, unable to invade now (no invade button), and enemy troops still increasing while i'm in orbit.
Windows 10 64bit, AMD 8 Core, 16 GB
Nvidia GTX 670 @ 3240x1920
FreeOrion Build: Latest Windows Test Build

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: planets troops increasing even with attacking ships in o

#15 Post 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.

Post Reply