Pre-Order the Game!

Desura Digital Distribution

Monday, February 13, 2012

Combat plans - no pictures sorry!

This will be the last "technical" post, I promise that the next one will contain screenshots and video of the combat screen!

I've started on the scripting system for space combat. So far, I've implemented part of technology and particle scripts. I'm also working on the UI for space combat screen.

The plan for UI is to have two different lists for your ship, the "Passive" systems and the "Weapon" systems. Passive systems are the list of equipment that are either passive (such as shields), or are part of the ship without doing anything directly (such as armor and engines). Some of them you can turn off/on such as shields and cloaking. "Weapon" systems are the list of equipment that you can fire or activate manually. They are the weapons and some special equipment that you have on your ship.

Another part of the UI is to show the amount of time units remaining, and how many power you have left in your capacity. Each turn will have 100 TU (time units) automatically, those are not carried over. Each turn will also have your reactor add power to your power capacity, left-over power from last turn will be carried over.

Let's use an example of how this system works. You have a ship with a shield that drains 20 MW (Megawatts) of power per turn, and a cloaking system that drains 50 MW per turn. It have a laser cannon that uses 10 MW, a photon torpedo that uses 100 MW, and a plasma cannon that uses 30 MW. It have a reactor that generates 100 MW per turn, and have power capacity of 1 GW (Gigawatts).

If you have both shield and cloaking active, each turn it will add 30 MW to the capacity (100 - (20 + 50) = 30). If you want to fire the laser cannon, you can do so three times, or you can fire the plasma cannon one time, or wait four turns before firing the photon torpedo, with 20 MW left over. However, if you want to fire the torpedo as soon as possible, you can turn off shield and cloaking, which will enable you to fire the torpedo next turn, but leaves your ship exposed to direct fire and scanning.

When you want to move your ship, you hover over a position, and it will tell you how much power and time it will require to move your ship there, then you click on it. To use an weapon or special equipment, you click on the desired weapon, and click on your target, similar to X-COM, minus the firing options. If you want to teleport using an teleportation equipment, you click on the equipment first before clicking. It's possible to teleport more than once in the same turn, provided you have enough power and time to do so.

I also have plans that will make the combat more tactical than just having the best weapons. One is the detection range. Ships that are out of detection range will be not visible to you on your turn. You can try and fire in their general direction in hopes you'll hit something, or move closer and try to detect them. This will make ECM and ECCMs equipment valuable. ECM (Electronic Counter Measures) will increase the detection range required to detect the ships. ECCM (Electronic Counter Counter Measures) will decrease the detection range. Let's say you have a ship with an ECM that adds 5 to range. The enemy ship will have to move 5 units closer to detect your ship than if your ship didn't have one. However, if they have an ECCM that reduces the range by 6, they will have the same detection range (ECCM don't magically reduce the range below its actual range, you'll need other special equipment for that)

Ships that are not in line of view (hiding behind asteroids, planets, or big ships) will also not be visible normally.

This will make ships designed for scouting and detection very valuable in combat. If an enemy ship have cloaking equipment, you will need a scout with a special cloak-detector to be able to detect that ship. Otherwise, it'd be a similar situation with an iron-clad vs a wooden ship. Cloaking don't magically disappear when you fire weapons, since it'll be a constant effect.

This system will greatly reduce the advantage of being the first player in the space combat, and offers some very interesting tactical decisions.

Now, on the last item for today, data handling in the scripts. So far, I've explained how the combat will work tactically, and part of the scripting. I've left out one important detail. How do you handle special attributes in weapons and equipment? For example, shield-piercing modifier on your laser cannon?

Here's how it will work. The game don't care about special values, it only cares about a few things: The size of the target reticle, the power and time consumption in using an equipment, whether or not an equipment is passive, whether or not ships are visible to certain ships, and how much damage is dealt to a ship on hit from an equipment. However, it will store the special values for equipment's script logic.

Let's say that you have a laser cannon with a 50% shield piercing modifier. In the script, when you fire that weapon, it will create a list of values that may look like this:

When the laser beam hits a shield, the shield's "OnHit" is processed with above values passed in. This shield normally reduces damage by 6. In the OnHit function, it looks for "Shield" value, and if it finds one, divides it by 100. The result is 0.5 with the above values. It then subtracts (6*0.5=3) from "Damage", leaving it with the following values:

Then when it hits the ship, all of the range 0 equipment's OnHit will be processed, modifying the above values. Let's say the ship's armor have damage absorption value of 5. Since there's no "Armor" value to process, it modifies the "Damage" by reducing it by 5, and ignores "Shield" value completely, resulting in Damage=12.

After all the equipment are processed, the game then grabs the "Damage" value, which is 12 at this point, and applies it to the ship's components. All other values are ignored.

It's possible with this system to create a ship that have a huge shield (range 10 for example) that is solely for protecting other ships by reducing any damage that passes through this shield. Note that all values other than "Damage" are custom and defined by your technology script. So you could create an item called "Wacky Cannon" with 50% chance of just making the ship disappear. On fire, you add a value of "Wackiness=50", and on hit, the particle's OnHit processes this value (which could be modified by other equipment), and if it does make the ship disappear, modifies the damage to be 0 to avoid showing damage number, spawns the "Wacky Disappear" effect on the ship which makes it fade out, then removes the ship from combat.

When I finish the scripting system, I will show the above examples (huge shield, shield piercing, wacky cannon) plus some others. So if there's a lengthy period between this post and the next post, it's because I'm working on making it all work. I think this and last posts pretty much cover the whole scripting system and how combat will work, so I won't bore you further with picture-less posts before I finish combat :)


  1. So will the weapon on hit script allow us to apply values to the enemy ship?

    Example: Molecular destabilizer cannon. Each time the destabilizer beam hits it does it's base damage*(1+ target destabilization factor/100). Each time it hits it also raises the target's destabilization factor by 5.

    This destabilization should be able to fade away with time as the ship's molecular cohesion restores.

    Is this possible in the current system?

  2. Yes. You would have to create a new "Destabilizer Effect" when the weapon hits the ship. Next shot will have this effect process "OnHit" which checks the values from the incoming weapon to see if it is molecular destabilizer, if so, add its value and remove its value from the particle so that when the particle's OnHit is processed, it sees that the value don't exist, so it don't spawn another "Destabilizer Effect".

    Then on each OnHit, regardless of which weapon, it would use that formula you have to increase the damage. If you want to have the damage increase to be specific to only molecular destabilizer weapon, then you add a custom value of "IsDestabilizer=1" and it checks for that value before modifying the damage value.

    After each turn, each of the "Effect" will have its "EndTurn" function called which allows you to decrease the lifespan/damage modifier.

    I will add this idea to the video demonstrating different possibilities of the script system. So far, I have the technology script compiling and running, but not yet the particle/effect scripts. Hopefully this week I will get it all done and start work on the video!

  3. If you're gonna have it in the video it might be better to have it a little less anaemic than a stacking five percent.

    I figure a setup where the lingering effect that stacks from each hit is the chance of the next destabilizer shot causing a severely damaging chain reaction where a truly large amount of the ship disentegrates at once instead of just a part. Though this chain reaction when it goes off resets the effect to zero as the parts that have been destabilized just vaporized leaving the more stable bulk of the ship beyond.

    But I'm sure whichever way it'll turn out vaguely balanced so use your best judgement.