problem with blockades

For topics that do not fit in another sub-forum.

Moderator: Oberlus

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

problem with blockades

#1 Post by Dilvish »

I have pretty consistently observed what seems like a problem / incomplete treatment for blockades -- when I have an aggressive armed fleet parked over a system, all defenses cleared, waiting for invasion troops, my fleet's engagement with the planets seems to alternate. One turn they'll bombard the planets & clear the defenses & ground troops won't regen/advance, but the next turn, apparently the planetary regen occurs after the battle decision, because there will be no battle at all, and the defenses and the ground troops will regen and have positive values at the end of the turn. The turn thereafter there will again be a battle and defenses cleared and ground troop level held stationary. And that continues to alternate.

I suppose the difficulty comes (at least currently) from the regular defense meters being on the same timing as the troops -- the meter regen happens after battles so that the troop meter can check for a battle that turn and know if it should advance. If it's too much trouble to decouple the timing & have shields & defense meters regen before battles, but have the troop meter regen after battles, then perhaps the logic informing troop meter regen could be made to be a little more complex, also holding flat if there is an aggressive enemy fleet in the system, whether or not an actual battle was triggered?
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: problem with blockades

#2 Post by Geoff the Medio »

The code that decides if a battle happened in a system could mark a planet as being in a battle even if its meters are all 0 so isn't attacked, as long as there are ships in the system that could have attacked it.

Longer-term, a separate bombardment mechanic was discussed, which would be what reduces planet meters, and that would continue even if the meters are zero, in order to prevent their regen.

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

Re: problem with blockades

#3 Post by Dilvish »

Geoff the Medio wrote:The code that decides if a battle happened in a system could mark a planet as being in a battle even if its meters are all 0 so isn't attacked, as long as there are ships in the system that could have attacked it.
That sounds like a good solution, at least until some decision is made about bombardment and the other meters. If you're too busy to get to it soon, would you recall any more hints as to particular files I should check?
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: problem with blockades

#4 Post by Geoff the Medio »

Dilvish wrote:...more hints as to particular files I should check?
Probably it's in ServerApp.cpp, when deciding where combats should take place each turn. There also are or recently were a few quirks with that code, that sometimes lead to battles where nothing can attack.

Post Reply