Terra Invicta Dev Diary #18: Space Combat

For updates and discussion of Terra Invicta, a grand-strategy alien invasion simulator
Post Reply
User avatar
johnnylump
Site Admin
Posts: 1262
Joined: Wed Nov 11, 2015 4:12 am

Terra Invicta Dev Diary #18: Space Combat

Post by johnnylump »

The last major dev diary entry for Terra Invicta will cover the space combat layer. Combat starts when a fleet targets and arrives at the location of another fleet or station. Combat tends to take place in orbits around space bodies and L-points; interception of a moving fleet can be tricky and very dependent on the fleets’ propulsion capabilities.

In a standard campaign starting in 2022, it may take several years of play before you are capable of initiating space combat. But you can always practice in skirmish mode, which you can launch from the game’s start menu. There are some pre-made ships to play with, or you can load up designs from a save game.

When combat starts during a campaign, there is a brief pre-combat sequence that sets up the battle. This covers maneuvers out of fighting range and setting your formation. Here’s what that UI looks like:
combat1.png
combat1.png (405.59 KiB) Viewed 34242 times
This is a really big battle taking place many years into a campaign. It just happens to be the one I had queued up when I wrote up the DD.

The first thing you select is your stance. Your opponent secretly does the same. At least one side must select ENGAGE for combat to occur. Fleets defending a station are only allowed to select ACCEPT.

If one side selects ENGAGE and the other FLEE, an abstracted pursuit takes place. Both sides conduct a single blind of bid Delta-V (recall that represents your propellant and thus your capability to move your ship). Whoever spends the most gets their preference over whether the combat starts.

… One thing we noticed during testing was that fleets with significantly higher delta-V could easily avoid combat and keep bombing the nearby planet or whatever else they were doing. That was a bit unfun – they could just rabbit away with no consequences. So we added a mechanic where fleets involved in any combat situation – even a successful escape – were rendered unavailable for operations for a certain period of time. Bombings were interrupted. We added an additional rule that if a fleet was unavailable it was only allowed to select ACCEPT in precombat – in essence, one fleet can chase an enemy and the other can then engage it.

You also select your initial formation. A fleet’s formation consists of four settings:
• Spacing: Tight, Loose, Spread. Governs the distance between ships.
• Pattern: The relative positions of the ships. There are 18 currently configured (and it’s easy to add more), including lines, walls, columns, echelons, and chevrons.
• Focus: The ship characteristic you want to use to govern positioning within the pattern. You can go by mass (“Heavy”), overall combat value (“Swords”), most armor (“Shields”), ships equipped with long-range weaponry (“Archers”) or greatest acceleration (“Swift”)
• Concentration: How ships, ranked by the focused characteristic, are distributed within the pattern.
You end up with something that sounds a little like an American football formation, “Loose Chevron Archers Left” echoes “Split back slot right,” at least to my ears.

From there, the combat itself begins. You have the option to run the autoresolve, which uses the same simulated combat algorithm as AI-on-AI battles, and skip the visualization of the fight. Otherwise you’ll go to the combat layer:
combat6.png
combat6.png (853.26 KiB) Viewed 34242 times
(This might be a good time to refer back to the ship design dev diary for stuff about weapon emplacements)

BATTLE SETUP

The two fleets begin beyond maximum weapons range in their selected formations, facing each other with a forward velocity, unless the combat was a pursuit, in which case the chased fleet will be facing away, with a slower velocity than the pursuer. (The “zero” velocity in a combat is a relative zero -- the fleets might both be in orbit around a space body, so we only care about the fleets’ velocities relative to each other.)
If both sides brought particularly large fleets to the battle, some of your ships will be held back as reinforcements. This is ultimately to maintain game performance in a complex 3-d battlefield with potentially hundreds of projectiles. You can tune how many ships you want in battles simultaneously in the game’s settings. If a ship is destroyed or disengages, a replacement will arrive from reinforcements.

SCALING OF SPACE AND TIME

As in the strategy layer, the player governs the clock and may pause or accelerate time at will. You may give commands at any time.
Combat generally takes place at ranges of hundreds of kilometers, and all the math involved in movement and weapon fire is calculated at that scale. But because dueling pixels isn’t terribly exciting to watch, we scale up the visualizations of the ships and stations many times. Think of it as an admiral’s computer visualization of combat if you like.

You can set autopilot for individual ships if you want to directly control a subset of them, or turn on a fleet-wide autopilot if you want to just watch the battle unfold.

FLIGHT CONTROLS

In a Newtonian environment, your ships will not stop unless you turn around and fire your thrusters to stop them. So a UI built around point-and-click-on-your-destination isn’t feasible; we have to help you drive your ships with the understanding they’ll remain in motion.
combat2.png
combat2.png (738.59 KiB) Viewed 34242 times
A coasting frigate alongside a monitor with multiple planned burns. Green lines represent coasting, yellow represent firing rotational thrusters to turn the ship, and red lines represent burns. The waypoints are color-coordinated by future time, so they’ll both reach the purple waypoint at the same moment. (The pointy part of the waypoint indicates the ship's facing at that time.)

So you control your ships’ movement using a waypoint system. Each of the six waypoints in front of a ship represents its expected future position at a given time. All waypoints – yours and your enemies’ – have the same color for the same future time, so you can envision the predicted future battlefield using those colors. (Note that the enemy waypoints are just projections as you don’t actually know what they are planning).

For each waypoint, you set its position and orientation, both in three dimensions. Movement and rotation are constrained your ship’s capabilities – so some ships may be able to thrust and then quickly rotate away from its direction of movement to keep a nose cannon trained on an enemy, while the heaviest ships with lower drive techs may only be able to plod along on a mostly straight trajectory.

We also have some supplemental flight controls that handle things that manipulating waypoints can’t do very efficiently, including persistent spins, rolls, an all-stop command, and a padlock command that keeps your ship’s nose (which usually has the most powerful weapons and strongest armor) pointed at your primary target.

FIRE CONTROL
combat3.png
combat3.png (827.8 KiB) Viewed 34242 times
A monitor unleashes a standoff missile attack while a lancer holds a steady course toward the enemy.

All weapons have one more fire modes and will engage targets according to those (within the range constraints of the weapon). Some weapons are only for attacking ships and station modules; some are only for shooting down enemy projectiles and missiles, and some weapons do both. In combat, you can set weapon behavior at the fleet, ship, and individual weapon level. Weapons that work in both an offensive and defensive capacity can be set to only operate in an offensive or defensive mode, or in “guardian” mode where they engage threatening projectiles first; if none are present, they fire at ships and hab modules.

Ships will generally fire at the closest enemy unless you set a primary target for it to override its local targeting preferences. Primary targets may be selected at the fleet and ship level.

Because missile magazines are much smaller than gun weapons, they only fire when a primary target is set.

DAMAGE

Weapons do damage based on their type. Beam weapons apply energy to a target to burn through armor into the soft interior spaces. Projectile and missile weapons do some mix of kinetic and explosive damage. Damage is calculated in Megajoules (and then converted to the same scale as armor plating uses). Some portion of damage is applied to “chipping” that represents holes in the armor; each future hit on that armor facing has a chance to ignore armor and go unhindered to the ship’s interior.

Assuming the hit doesn’t pass through a section of chipped armor, the local armor value is subtracted from the damage value. If any remains, it is applied as internal damage to ship systems. The game has a system of applying internal damage according to a vague layout of the ship, so armor penetrations on the nose will tend to destroy nose weapons first. Damage to the bridge, fire control, life support, power couplings and other critical systems can put a ship out of action. Damage Control teams will also repair critical systems.
A ship is destroyed when all three of its main structural elements (in the nose, center and tail) are destroyed.

DELTA-V, BATTERIES, AND HEAT
combat 4.png
combat 4.png (116.72 KiB) Viewed 34242 times

The ship detail panel. The circles over the ship image report damage to critical systems. This is a healthy ship.

Three things to manage:

• Delta-V: Just as in the strategy layer, your ship has only so much thrust before it runs dry. (Your ship will maintain an inaccessible reserve to finish whatever trajectory it is on in the strategy layer.) You tend to burn lots of Delta-V in combat if you are maneuvering. Once your ship runs out of propellant, you’re stuck on the path you’ve chosen.

• Batteries: Ships batteries are drained by laser and electrical weapon fire. They recharge from the power plant; low-tech batteries may not be able to recharge at a meaningful rate during combat, leaving those weapons unable to fire (or firing very, very rarely). So it may be worthwhile to idle some weapons until you can close range with the enemy.

• Heat: Running your drive creates typically creates waste heat from your power plant. This is vastly more than any created by weapons, computers, or the crew. If your radiators are extended, the waste heat is expelled. But radiators are particularly vulnerable in combat, as armoring them would make them not able to bleed heat very well (we subscribe to several of Ken Burnside’s theories of space combat). If they get shot off your ship is in real trouble. You have buttons to retract and extend your radiators if you have equipped your ship with heat sinks. Those hold a certain amount of heat; once full, you have to open your radiators so your crew doesn’t fry.

Note that certain advanced radiators – particularly those that rely on droplets or dust instead of solid fins - are harder to damage even when active.

RAMMING

Yes, you can ram other ships. It’s always fatal for the ramming ship and usually fatal for the target. To set up a single ship for ramming, you’ll have to pay a large influence cost, representing inspiring a crew to give up their lives for your cause. (We don’t really see ramming as a major or cost-effective element of combat, but it seems to get some folks real excited, so have at it.)

STATIONS
combat7.png
combat7.png (670.99 KiB) Viewed 34240 times
Space stations will take part in combat if they are the target of the attack. Stations that have defensive modules with the best heavy weaponry the faction owning the station can muster. A station is considered knocked out of the combat if its combat modules are destroyed. Seizing or destroying the entire hab takes place after combat.

HOW IT PLAYS
combat5.png
combat5.png (1.18 MiB) Viewed 34242 times
The initial pass. Mag weapons are already firing. The missile-armed monitor is trying to maintain distance from the enemy while the lancer and escort frigate line up for shots with their nose weapons.

A great deal of the “feel” of a given battle depends on the propulsion capabilities of the ships involved. Many early ships can manage high thrust but terrible Delta-V, or the reverse. Later ships can have both and are much more able to position themselves on the battlefield, especially after an initial pass.

Attacking an enemy’s flanks is important. Armor is typically lighter on the long sides of a ship (because armoring is so heavy).

Railguns and coilguns fire in either rapid salvoes or steady repeated shots, creating a moving dangerous area that a ship must avoid unless point defenses can shoot down the incomings.

At long ranges, laser fire may seem deceptively weak, but they grow increasingly dangerous as you close with your enemies.
Missiles have a certain all-or-nothing quality to them. They are much more difficult to dodge than ballistic projectiles, so if you can fire enough to overwhelm enemy point defenses, they can do immense damage to a target. But missile ships don’t have enough ammo to fight a sustained battle. A bold captain might try to run in close and launch missiles at point-blank range so point defense don’t have time for many shots.
Mossconfig
Posts: 3
Joined: Fri Jun 03, 2022 1:39 am

Re: Terra Invicta Dev Diary #18: Space Combat

Post by Mossconfig »

I remember something in earlier devlogs about head to head passes getting skipped over, is there an abstracted version or simply no combat? Are ships in a retrograde orbit invincible during the blind bid process due to the difference in delta V?
asaz989
Posts: 11
Joined: Fri May 25, 2018 10:27 pm

Re: Terra Invicta Dev Diary #18: Space Combat

Post by asaz989 »

One thing we noticed during testing was that fleets with significantly higher delta-V could easily avoid combat and keep bombing the nearby planet or whatever else they were doing. That was a bit unfun – they could just rabbit away with no consequences. So we added a mechanic where fleets involved in any combat situation – even a successful escape – were rendered unavailable for operations for a certain period of time. Bombings were interrupted. We added an additional rule that if a fleet was unavailable it was only allowed to select ACCEPT in precombat – in essence, one fleet can chase an enemy and the other can then engage it.
Doesn't this latter bit - the ability to intercept higher-∆V fleets with multiple pursuers - fall out of the more straightforward mechanic anyway? Each evasion costs the evader ∆V, so if the evader has twice as much ∆V as each pursuer they can be caught with two consecutive pursuing fleets that bid high. Maybe even 1 if they're in enemy territory and need to reserve ∆V for the return trip. Or alternately put, they're not "rabbiting away with no consequences", the lost ∆V is the consequence.

This would give an incentive to build ships with extra ∆V or refuel more often even if the disparity is really high - it matters not just whether the evader wins the bid, but by how much. Plus increasing home-court advantage for low-tech ships near their home bases (ie humans at Earth or around their bases) who can safely make the high bids required to run an opponent out of ∆V, while still being unable to do so on the offensive.
asaz989
Posts: 11
Joined: Fri May 25, 2018 10:27 pm

Re: Terra Invicta Dev Diary #18: Space Combat

Post by asaz989 »

Damage to the bridge, fire control, life support, power couplings and other critical systems can put a ship out of action. Damage Control teams will also repair critical systems.
What happens to critically-damaged ships after combat ends? Is a ship with dead engines repairable in the field, or does it have to be written off if you don't have nearby repair facilities, or is there some mechanic for an inefficient tug by undamaged ships?
Mossconfig
Posts: 3
Joined: Fri Jun 03, 2022 1:39 am

Re: Terra Invicta Dev Diary #18: Space Combat

Post by Mossconfig »

lost ∆V is the consequence.
I bet that it would be really hard to balance the delta V availability for that while having a fun game. I do agree with the temporary unavailability for fleets after making an emergency action, but it should be part of a larger mechanic. Maybe increase or decrease the unavailability window based on our or the enemies tech, or where exactly the intercept happened.
asaz989
Posts: 11
Joined: Fri May 25, 2018 10:27 pm

Re: Terra Invicta Dev Diary #18: Space Combat

Post by asaz989 »

The existing system already includes that much lost ∆V, there's no extra balancing work required to take away the auto-engage. Removing the auto-catch during cooldown just gives a chance for very high ∆V runners to escape, and simplifies the player's mental model of the rules.

(I do agree that the unavailability for some time is a good idea.)
Hansag
Posts: 2
Joined: Wed Jun 22, 2022 11:40 am

Re: Terra Invicta Dev Diary #18: Space Combat

Post by Hansag »

Not sure if the skirmish mode is on topic here, but having played Highfleet, perhaps a way to design and run said designs in skirmish mode.
Also, a way to mouse over designs in skirmish mode and see a box with their stats and modules.
laliberty
Posts: 1
Joined: Sat Oct 01, 2022 6:17 pm

Re: Terra Invicta Dev Diary #18: Space Combat

Post by laliberty »

The chase before battle makes very little sense in any way I recon :? . It's wrong that deltaV is the only way to "bid" in chasing, as whoever has higher acceleration will catch up--it's common sense, in a car chase it's not whoever with more gas win. There ought to be a calculation involving deltaV AND combat acceleration.

And by acceleration or deceleration you and your opponents should be knocked off orbit, which is dangerous if there's no supply depot nearby (in terms of real physics). Plus unrealistically high G burn will kill, although I noticed the game's engines have pretty weak G force in general.
User avatar
johnnylump
Site Admin
Posts: 1262
Joined: Wed Nov 11, 2015 4:12 am

Re: Terra Invicta Dev Diary #18: Space Combat

Post by johnnylump »

Yes, in the EA build acceleration is also taken into account for chase mechanics.
blarglol
Posts: 28
Joined: Thu Sep 29, 2022 2:59 pm

Re: Terra Invicta Dev Diary #18: Space Combat

Post by blarglol »

Will derelicts, whether destroyed (i.e. in pieces) or combat ineffective (dead and drifting but intact), ever make an appearance down the road? Is the concern overburdening the battlespace? I know you would have to code what happens if a ship plows into a wreck, as well as the additional burden of displaying and keeping track of those objects. Big battles could get a lot slower with wrecks to display, but it's very immersion killing for a whole vessel to disappear in a blink (unless a reactor went off or something).

Also, whether or not they are actually shown, will crew recovery, escape pods, and search and rescue ever be a thing? Post-battle recovery of officers and crew would be interesting. In some cases you might get interesting intel. I know Falling Frontier is doing something like this. In terms of what resources recovering personnel would offer, perhaps a little boost of cash, reflecting that you don't need to train as many people? Thoughts?
Minthos
Posts: 1
Joined: Wed Oct 19, 2022 6:52 am

Re: Terra Invicta Dev Diary #18: Space Combat

Post by Minthos »

I would like the ability to select multiple ships and give them all the same command. Three commands in particular: Set primary target, change direction, set different settings for different weapons for example setting missiles to focus fire and lasers to defensive. Selecting each ship individually to give these commands is very tedious in a big fleet.
ecpgieicg
Posts: 48
Joined: Mon Oct 03, 2022 12:20 pm

Re: Terra Invicta Dev Diary #18: Space Combat

Post by ecpgieicg »

I would like the ability to select multiple ships and give them all the same command. Three commands in particular: Set primary target, change direction, set different settings for different weapons for example setting missiles to focus fire and lasers to defensive.
This please
Post Reply