Recent Posts

Hi! The first month of active development is now over, and I've got some great progress to report! According to my Codealike statistics, I managed to spend over 5.5 times as much time coding and debugging than during the previous month.

New features implemented this month include: Turret and fixed weapon modules, projectile and beam weapons, basic missiles, damage system and targeting logic. What this means is that it is now possible to have actual battles between ships and fleets, even though combat AI is not yet implemented.

Please take a look at the video below for an overview of these features. I recommend watching it in 1080p (Full HD) as it allows you to better see the projectiles, missiles etc. that are quite small.



Weapons

There are currently 5 weapon modules in the game: Beam, gauss, plasma and missile launcher turrets, and a fixed "super gauss" cannon. The turreted weapons are mean to be medium or standard versions of these weapon types, with light and heavy variants being possibly added later. The turrets themselves have limited turning velocity, but it is high enough to allow the beam turrets to easily track and disable enemy missiles, performing a point-defence role. All weapons consume resources such as electricity, and have a reloading timer in addition to heat generation and dissipation properties that in combination define the fire rate.

Each weapon type is meant to have it's own distinct flavor, I don't intend to create 10 variants of weapons that all use the same basic principle such as firing a kinetic or plasma projectiles. Gauss cannons use electricity to fire a simple kinetic projectile that has unlimited range and high change of penetrating enemy armor, but deal less overall damage than plasma weapons at close range. Plasma weapons on the other hand have limited range because the gas expands and dissipates energy rapidly, but will melt armor and practically never ricochets. The beam weapons can be used for point defence and pinpoint accurate fire to drill through specific modules on the enemy ships, but for balance reasons also have limited range. Otherwise the AI could always just snipe you from across the battlefield. Beam reflection is being considered, but would complicate some things and possibly cause performance issues.

Missiles are fired from turrets and have their own control logic to hunt down a target specified at launch. Like the other weapon projectiles, they have a body in the physics engine, and follow the same Newtonian physics as the ships do. This means that they need to have quite powerful strafing thrusters in addition to the main one and thus differ from the traditional atmospheric missiles that can depend on air resistance to maintain the velocity vector pointing towards the heading. The current implementation deals a set amount damage to the target on contact, but advanced payloads such as multiple warheads that spread before point defence can knock them out have been planned. The missiles are balanced by limiting the amount carried by each launcher module and engine operation time before the fuel runs out.

Projectiles

Currently there are two main projectile types in the game: Plasma and kinetic (gauss). The kinetic projectile has two variants which differ on the velocity and delivered energy, one used by the gauss turret and the other by the larger fixed gauss cannon.

Plasma is a form of matter that is basically superheated gas. In vacuum this gas naturally will expand rapidly and lose its effectiveness, making such a weapon useless at realistic distances. However, since this game isn't aiming at realism on the combat distances aspect of things, this is only present in the mechanic that these projectiles have a limited range and immediately start losing energy when fired. The initial energy of plasma projectiles is higher than that of kinetic ones, and they travel faster, making them effective at close range and still viable at medium ranges. They also deal damage to armor because penetration and ricochets are very unlikely to happen.

Kinetic projectiles are made from hard and dense materials such as depleted uranium and will usually penetrate armor, causing damage to the functionality and structure of the hit module. The brutally simple kinetic energy of these projectiles can't really be stopped other than mechanically, and the more energetic ones may pass through multiple modules or even tear an unarmored ship apart with a single hit. Once shot, the projectile will travel at a constant velocity until it hits something or leaves the battle area. These are balanced by the relatively low velocity, which makes shooting at actively dodging targets ineffective at longer ranges.

Damage system

The damage system consist of two main parts: A deterministic algorithm to calculate damage to a single module on collision, and another one for finding all modules within the hit ship that the projectile may go through. The physics engine reports the projectile collisions with the edge modules of ships via C# events, and when a collision with a fixture belonging to an enemy ship is found, a grid intersection algorithm is used to find modules that are on the projectile's path. The collision algorithm is then run for these modules in order until the projectile's energy is depleted.

The collision evaluation algorithm is deterministic, which means that there are no random elements and thus the one input will always yield the same result. The damage to the module depends on the projectile's heading in relation to the hit surface normal, projectile type properties such as penetration & ricochet angle modifiers, and the state of the hit module. All modules have three separate "hit point" counters: armor, functional and structural. Armor is depleted first, but penetrating shots can also deal functional and structural damage even if the remaining armor HP is higher than the energy of the projectile. The relative state of the armor is also a factor on the change of penetration. When a module's functional HP is reduced to zero, it goes to a disabled state that can't be recovered during the battle, and when the structural HP hits zero, the module is destroyed, leaving a hole in the ship. Functional damage depends on how close to the center of the module the projectile's path gets to, meaning that hits that only grace a corner are unlikely to disable it, but more likely to pass through to the next module.

The current implementation always destroys the projectile on impact even if it could go through the whole ship. This is because re-positioning the projectiles in the physics engine may have some adverse side effects, and since the projectiles aren't just points with zero surface area, calculating the exit point so that it doesn't overlap the ship's fixtures can be challenging. An undesirable consequence of this is that small pieces of debris can block even the most powerful projectiles.

A full battle demo

Here is an uncut, disorganized, fleet battle demonstration if you just want to see some action.



I will cover development goals for the next month and some other stuff in a separate post coming later this week, stay tuned!

Posted by Tomi Tuesday, September 30, 2014

0 comments

Post a Comment