This is what's going on:
Turn 213: Red empire has attacked system H and flattened all shields, defenses and infrastructure. Some troopers there are ordered to invade, but with insufficient forces. Others arrive next turn.
Turn 214: Red empire has attacked system H again. New troopers are ordered to invade Asteroids H, with enough forces. Last turn that Asteroids H were attacked by ship was 213. Green empire forces arrive next turn.
Turn 215: Red troopers successfully invade Asteroids H. Green ships destroy all red ships in the system but do not target Asteroids H because it has all meters zeroed. Last tusn Asteroids H were attacked was still 213. So troop regen (base and the ones from Garrison techs) takes place and the now Red Asteroids H start with 6.16 troopers. This should not work like that. I'm testing using LastTurnColonized < CurrentTurn - 1, which seems to work, but I don't know if that will backfire. I'll keep testing stuff.
Make all colonies/outposts to start with 6/3 def. troops
Moderator: Oberlus
Re: Make all colonies/outposts to start with 6/3 def. troops
If 30 troops invade a planet with 27.84 troops, the invaded planet will have 2.16 troops after invasion?
Re: Make all colonies/outposts to start with 6/3 def. troops
I thought we always trigger combat by unconditionally ensuring a infrastructure at least one.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Look, ma... four combat bouts!
Look, ma... four combat bouts!
Re: Make all colonies/outposts to start with 6/3 def. troops
Same.
Since planet invasion happens before combat (AFAICT), the green ships not attacking just-conquered asteroids might make sense for turn 215. But I can't make any sense of turn 214...
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Make all colonies/outposts to start with 6/3 def. troops
Before troop level growth, yes. But troops may grow post-invasion. See these planets before invasion, between turns after invasion before troop growth, and on the next turns.
Note that LastTurnColonized and LastTurnConquered are not the same...I'm testing using LastTurnColonized < CurrentTurn - 1
Re: Make all colonies/outposts to start with 6/3 def. troops
OK, so the problem is that the planet invaded at the start of turn 214 will not have infrastructure when the Green forces arrive and thus will not be attacked, so it will regen troops and whatnot at the end of that turn 214, which is wrong.
Since the planet was attacked on turn 213, it did not regenerate construction or shields at the end of that turn. Then, on turn 214 it is targetted for invasion (which succeeds), the Green fleet arrives, and combat ensues. Since the effects for that turn have not yet been processed, the planet has no construction, shields or defense, so it is not targetted by Green ships during combat. When effects are processed, the planet has not been attacked in current turn and so can regenerate shields, defense and troops, and so the planet starts turn 215 with 8 shields, 9 defense and some troops apart from the invading troops surplus. Planet should have been attacked this turn.
Colonies regenerate construction with their species effect STANDARD_CONSTRUCTION, when not just conquered or attacked. Outposts regenerate 1 construction with the tech OUTPOSTS, always.
At first I thought the solution could be changing the tech/construction/OUTPOST.focs.txt effect to also apply to colonies, so that they regenerate that minimum of 1 construction for consistent planet participation in combat regardless of being just conquered or not. It didn't work because the issue with invasion, fleet movement, combat and effects processing ordering.
(How) Can we ensure in the backend a minimum of 1 construction at the start of every turn?(that is, before Colonisation, etc.)
/Edit: my guess is such a change would go in ServerApp::PreCombatProcessTurns() somewhere after HandleScrapping()/
Since the planet was attacked on turn 213, it did not regenerate construction or shields at the end of that turn. Then, on turn 214 it is targetted for invasion (which succeeds), the Green fleet arrives, and combat ensues. Since the effects for that turn have not yet been processed, the planet has no construction, shields or defense, so it is not targetted by Green ships during combat. When effects are processed, the planet has not been attacked in current turn and so can regenerate shields, defense and troops, and so the planet starts turn 215 with 8 shields, 9 defense and some troops apart from the invading troops surplus. Planet should have been attacked this turn.
Colonies regenerate construction with their species effect STANDARD_CONSTRUCTION, when not just conquered or attacked. Outposts regenerate 1 construction with the tech OUTPOSTS, always.
At first I thought the solution could be changing the tech/construction/OUTPOST.focs.txt effect to also apply to colonies, so that they regenerate that minimum of 1 construction for consistent planet participation in combat regardless of being just conquered or not. It didn't work because the issue with invasion, fleet movement, combat and effects processing ordering.
(How) Can we ensure in the backend a minimum of 1 construction at the start of every turn?
/Edit: my guess is such a change would go in ServerApp::PreCombatProcessTurns() somewhere after HandleScrapping()/
Re: Make all colonies/outposts to start with 6/3 def. troops
Alternatively, we can gate all shield, defense and troop regeneration not only LastTurnAttackedByShip but also LastTurnConquered. Regardless of combat, just-invaded colonies would not regenerate the turn they are invaded, which would be a change to current behaviour. Would this be better than the above suggestion?
Re: Make all colonies/outposts to start with 6/3 def. troops
The first suggestion sounds like adding another hack on top of a hack.Oberlus wrote: ↑Mon Oct 19, 2020 11:06 am Alternatively, we can gate all shield, defense and troop regeneration not only LastTurnAttackedByShip but also LastTurnConquered. Regardless of combat, just-invaded colonies would not regenerate the turn they are invaded, which would be a change to current behaviour. Would this be better than the above suggestion?
We could also instead change the target condition to include planets if LastTurnConquered. But then we would attack that planet a lot, not only a single bout.
I like your second suggestion implementation wise better. Game wise the change is ok I think.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Look, ma... four combat bouts!
Look, ma... four combat bouts!