I do not know how planetwars works. I recall that the mechanics were reasonable but I cannot make further fixes without knowing the current state. Here are some of the things that I can think of.
[x] ~How is metal distributed to participants? Defenders can be from different factions either by neutral defense or a defensive pact. How does this work?~ Total metal is distributed to individual participants in equal parts. Their faction does not matter, if they are from a pact or defending a neutral they still get the metal personally for whichever faction they belong to (ie. not necessarily the actual defending faction).
[x] ~How does the HQ affect metal income? Is the bonus for all battles? What if you are a hired Defender (either defender of a neutral planet or defensive pact).~
The bonus does not affect defense of neutral planets, the base gain is final in that case. For attackers, and defense of owned planets, the gain is modified by HQ. The gain is reduced by 50m if there is no direct link to HQ (possibly because a HQ does not exist). Battles on the HQ get +30m bonus which reduces by 5m for every 1 distance (measured by graph edges), this caps at +0 (ie. does not go into the negative, there is no penalty). For defense pacts, the owner of the planet matters (so for example defense of the HQ planet itself is always +130 metal regardless of who defends). The values here are defined in the DB for the HQ structure.
[x] ~Can structures be scrapped for metal? For how much metal? What are the restriction on when they can be scrapped?~
Structures can be scrapped instantly for 50% of their cost in metal, by their owners or planet governors. Faction economy officials can chown the structures to themselves, which will allow them to scrap them too. Structures cannot be scrapped while a battle is in progress. Only buildable structures can be scrapped.
Activation
[x] ~There is only one activation time database key. Does this apply to all types of activation? What are they?~
Besides normal timely activation there's also reactivation after being destroyed ingame. It is twice as long as normal activation. There do not seem to be any other types.
[x] When do structures activate? I build a dropship factory which is set to 5 turns to activate. Will I have 0.5 dropships after 5 battles have started?
If you build it, it needs 5 game ends with enough power to activate. Activation occurs before production, so you will have bomber production the same tick it activates (which is after 5th battle).
[x] ~Is a structure with an activation time of 0 effectively impossible to deactivate?~ Yes as long as there is enough energy for upkeep costs.
Dropships
[x] When do dropships allow a faction to invade a planet without adjacency? Is there some threshold of dropships in orbit that must be reached? What if warp jamming is involved?
At any time, there is no threshold. Structures that have EffectBlocksJumpgate and are active will prevent dropship transfer. Once dropships are in orbit, they can start battle as long as they outnumber defenses.
[x] What causes dropships to be removed from orbit? Are they only removed upon the commencement of a battle for the planet? If your own ships are orbiting your planet, they will be removed without refund. Dropships which stay in orbit for "PlanetWarsDropshipsStayForMinutes" (set to 2h) will be removed with refund. Time is measured since last addition of dropship to that planet. If there is a new treaty that has "preventdropshipattack" dropships will be removed with refund as well.
[x] Is there a limit on the number of dropships (or for that matter, bombers) that can be sent concurrently. I recall that Fleet Command used to increase this cap, does a cap still exist?
Yes the limit is "DefaultDropshipCapacity" + capacity of fleet command structures. Default dropship capacity is presently 50, so the effective limit is 50.
Warp Jamming
[x] What does warp jamming stop? Does it stop the use of already present dropships? String connector? Guerilla Jumpgate? "EffectBlocksJumpgate" presently prevents bomber and dropship attack without links.
Race Conditions
[x] How is activation precedence determined?
If there is not enough energy to power structures, then structures are sorted by their priority and then by their energy demand (biggest first). They are then served energy in that order. Structures that remain powered for their activation time will activate, otherwise activation timer resets (meaning single outage = repeat activation process).
[x] Do newly activated energy generators make their energy before or after the rest of the infrastructure requests energy?
Energy used is energy from last turn (which includes treaty transfers as well). So they are effectively activated "after".
[ ] Are effects due to forfeited defenses applied before or after the usual economy tick? I think they should be applied afterwards because the economy ticks upon the battle starting, not upon its conclusion.
I don't understand. There is no economy tick on battle start. Only valid battle ends are ticks of the game.
Forfeited defenses are invasions that were launched but to which no defenders responded. In a sense there is no battle and in another sense the battle starts and ends at the same time.
[x] Do wormhole inhibitors come online before Influence is spread?
No, after.
[x] If warp jammers jam any targetable structure do they come online before the target activates?
They don't jam targetable structures. There is no way to block them.
Ongoing battles and scaling
[x] What happens if a faction has no valid targets for them to attack during their attack phase? This could occur via the destruction of wormholes, diplomacy or if there is already a running battle on every adjacent planet. I recall that in previous rounds they were allowed to attack anywhere, this seems highly broken. I think a faction with no valid targets for attack should not be able to attack. At the moment I think that no special handling should be in place for this though, their turn should progress as normal and time out if no targets have appeared in the intervening time.
Matchmaker picks 6 best targets. It makes sure one of them is always 2v2 planet (if such an option exists outside the 6 best targets).
If there are no attackable planets at all, then 6 best non-attackable planets are selected. Note that this rule exists to prevent a total deadlock of PW, which is trivially possible for example using treaties. With this rule at least ticks progress and people can fix the issue.
[x] What can be done to a planet with an ongoing battle? Can they be invaded at all? Any structures produced or destroyed? Bombers? Can faction leaders even change structure priorities? Priorities should at least be able to change. If a turn elapses on an embattled planet do structures produce their products and do activation ticks occur? All stuff can be done to them. Second battle can start on them as well. Planets produce normal stuff and activation ticks occur.
[x] Do battles have a time limit? I could imagine some ridiculous situation in which two factions create invulnerable planets by starting never ending battles. Perhaps after 2 hours the defenders should win (this can just be set with a modoption (defaultwinallyteam, defaultwinminutes?) and ingame can deal with it). No they don't.
I do not know how planetwars works. I recall that the mechanics were reasonable but I cannot make further fixes without knowing the current state. Here are some of the things that I can think of.
See the etherpad that I am writing on mechanics: http://etherpad.springrts.com/p/planetwarsStructures
Metal
Activation
[x] ~There is only one activation time database key. Does this apply to all types of activation? What are they?~ Besides normal timely activation there's also reactivation after being destroyed ingame. It is twice as long as normal activation. There do not seem to be any other types.
[x]
When do structures activate? I build a dropship factory which is set to 5 turns to activate. Will I have 0.5 dropships after 5 battles have started?If you build it, it needs 5 game ends with enough power to activate. Activation occurs before production, so you will have bomber production the same tick it activates (which is after 5th battle).[x] ~Is a structure with an activation time of 0 effectively impossible to deactivate?~ Yes as long as there is enough energy for upkeep costs.
Dropships
[x]
When do dropships allow a faction to invade a planet without adjacency? Is there some threshold of dropships in orbit that must be reached? What if warp jamming is involved?At any time, there is no threshold. Structures that have EffectBlocksJumpgate and are active will prevent dropship transfer. Once dropships are in orbit, they can start battle as long as they outnumber defenses.[x]
What causes dropships to be removed from orbit? Are they only removed upon the commencement of a battle for the planet?If your own ships are orbiting your planet, they will be removed without refund. Dropships which stay in orbit for "PlanetWarsDropshipsStayForMinutes" (set to 2h) will be removed with refund. Time is measured since last addition of dropship to that planet. If there is a new treaty that has "preventdropshipattack" dropships will be removed with refund as well.[x]
Is there a limit on the number of dropships (or for that matter, bombers) that can be sent concurrently. I recall that Fleet Command used to increase this cap, does a cap still exist?Yes the limit is "DefaultDropshipCapacity" + capacity of fleet command structures. Default dropship capacity is presently 50, so the effective limit is 50.Warp Jamming
What does warp jamming stop? Does it stop the use of already present dropships? String connector? Guerilla Jumpgate?"EffectBlocksJumpgate" presently prevents bomber and dropship attack without links.Race Conditions
[x]
How is activation precedence determined?If there is not enough energy to power structures, then structures are sorted by their priority and then by their energy demand (biggest first). They are then served energy in that order. Structures that remain powered for their activation time will activate, otherwise activation timer resets (meaning single outage = repeat activation process).[x]
Do newly activated energy generators make their energy before or after the rest of the infrastructure requests energy?Energy used is energy from last turn (which includes treaty transfers as well). So they are effectively activated "after".[ ]
Are effects due to forfeited defenses applied before or after the usual economy tick? I think they should be applied afterwards because the economy ticks upon the battle starting, not upon its conclusion.I don't understand. There is no economy tick on battle start. Only valid battle ends are ticks of the game. Forfeited defenses are invasions that were launched but to which no defenders responded. In a sense there is no battle and in another sense the battle starts and ends at the same time.[x]
Do wormhole inhibitors come online before Influence is spread?No, after.[x]
If warp jammers jam any targetable structure do they come online before the target activates?They don't jam targetable structures. There is no way to block them.Ongoing battles and scaling
[x]
What happens if a faction has no valid targets for them to attack during their attack phase? This could occur via the destruction of wormholes, diplomacy or if there is already a running battle on every adjacent planet. I recall that in previous rounds they were allowed to attack anywhere, this seems highly broken. I think a faction with no valid targets for attack should not be able to attack. At the moment I think that no special handling should be in place for this though, their turn should progress as normal and time out if no targets have appeared in the intervening time.Matchmaker picks 6 best targets. It makes sure one of them is always 2v2 planet (if such an option exists outside the 6 best targets). If there are no attackable planets at all, then 6 best non-attackable planets are selected. Note that this rule exists to prevent a total deadlock of PW, which is trivially possible for example using treaties. With this rule at least ticks progress and people can fix the issue.[x]
What can be done to a planet with an ongoing battle? Can they be invaded at all? Any structures produced or destroyed? Bombers? Can faction leaders even change structure priorities? Priorities should at least be able to change. If a turn elapses on an embattled planet do structures produce their products and do activation ticks occur?All stuff can be done to them. Second battle can start on them as well. Planets produce normal stuff and activation ticks occur.[x]
Do battles have a time limit? I could imagine some ridiculous situation in which two factions create invulnerable planets by starting never ending battles. Perhaps after 2 hours the defenders should win (this can just be set with a modoption (defaultwinallyteam, defaultwinminutes?) and ingame can deal with it).No they don't.