Combat

Combat is triggered if two opposing fleets are at the same solar body. A solar body is a planet or moon or asteroid. Anything of interest that is distant enough to realistically be a different combat zone. A temporary solar body is created in a solar system if a a fleet is in transit toward the system. This allows you to organize a defense better. When two, or more, fleets meet each participant chooses whether to engage in combat or not. If any party says yes, a combat map is drawn up of that solar body and a number of combat rounds are had at the end of the round. The length of the combat depends on the movement remaining for each fleet. If additional fleets arrive to the engagement before the end of the round, than they will join the battle some number of rounds in based on the percentage of movement they have left. A battle map remains consistent once drawn up until the battle is over and all battles occur at the end of a round. At the start of each round, all players involved in a battle may again choose to avoid combat, if all agree to end hostilities, than the battle map is eliminated and all forces are abstracted as fleets again. There may be other events that cause a battle map to be drawn. I may even use these events to allow combat outside of solar systems with the use of traps that pull ships out of hyperspace or something.

The above means that campaign turns need to be simultaneous. I'll just limit the ways one can abuse that in ways such as making combat happen at the end of a round so that you can't just ambush someone with quick reflexes. Those reflexes just give you a couple turns advantage but the enemy can than pull in troops to save their fleet during the rest of the turn. I may have combats happen when all parties agree rather than at the end of the round. This means fleets could potentially fight a battle and than move. But I'll just leave combats until the end of the round unless I see a clear situation where it would be better to do it the other way.

When a ship takes damage, that damage is assigned to a flank based on the direction it came from. The shields of the ship block some of the damage and than what remains is randomly assigned to a row along that side. Each module has a minimum soak, maximum soak and percentage soak. All damage up to the minimum soak are taken as damage to that module. Anything over the minimum is multiplied by the percentage and the module takes that much damage up to the maximum soak. Any damage that was not dealt to that module is than carried over to the next module in. The functions of a module decrease or are eliminated as it takes damage. Once a module is completely destroyed, it is ignored for damage calculations. (Maybe it still have a very low soak stat to signify debris barriers.) The hull as a whole should have some health stat so when enough systems are destroyed, the entire ship breaks apart. Each hull also has an armor module. This "module" exists on every edge of the ship and will soak damage before any internal modules.

I feel like the two biggest issues with combat complexity are, the possibility of complexity for complexity sake, and the limitations of the AI. The more complex the combat becomes, the more it can be abused. The player will eventually learn to abuse these mechanics to their fullest, so if the AI can't abuse the mechanics as well, they will inevitably becomes easily beaten. This applies to all mechanics, but battles have a more immediate and noticeable impact than most other systems.

My idea for the combat AI is to break things up into triggers each turn: an approaching missile, allies nearby, enemies nearby, critical damage, ext. Based on these general inputs, the AI will than decide a number of possible actions and each action will be given a weight based on the various inputs. (To avoid bugs like when a unit runs back and forth in an rts, I would like one of the inputs to be the previous actions taken to give a sense of follow through.) The weighting are than used to randomly decide what the AI will do, giving the AI the possibility of making a mistake. (As the flip side of the human learning the system and the AI not, is the AI knowing the system perfectly and never losing. Like if an AI was taught tic tac toe.) The weightings could than be changed based on difficulty and AI traits, like aggressive or stubborn. This allows the AI to get harder to beat without cheating, and creates a sense of personality to the AI's choices

Some actions come in "combos", where they add addition possible actions with weights to the following turns. Since it's just weightings, the plan can still be abandoned if other things come up. Combos overlap with the idea of "listening" to previous turns. But they are meant to accomplish different things so I do want to approach them both rather than just merge them together. Maybe combos will add a whole new trigger, or triggers, for the AI to listen for rather than just adding weighting. Than the previous turns will simply influence the various triggers that create the AI action weighting.

If I include admirals, I might force the player to rely on them by only letting the player control X combats per turn. The rest the player will have to hire good admirals they trust to lead the combats since they will impact the weightings that decide the maneuvers used in combat. It would be nice to allow the player to save up these "command points" in case some turns are more combat intensive than others. So maybe you gain some number each turn with a cap on how many you can save. Both being changeable through various technical advances. The AI will have the same command points, but they will be assigned to battles to up the intelligence of the AI in those fights to simulate the idea of a player taking direct control.

I tend to prefer hexes to squares, but I'm unsure what works best here given that I want modular ship design. Either way it would be nice to have momentum in battle. Where ships continue to move along their trajectory until they actively do something to change it. I would than like turns to be smaller increments of time than Stars in Shadow. To the point where ships don't fire every single turn and direct fire weapons are an instant hit. Projectiles would all exist, just move fast enough that within a certain range they will hit right away. Since any projectile fired should immediately "take a turn". Ships are abstracted down to 1 square/hex per X square/hexes in the ship builder. Possibly just making most, if not all, ships fit inside of a single square/hex. Than when a ship is hit, use the direction of the hit to randomly choose an exact hit location along that arc.