Unending Galaxy : Combat

Here is an early summary on how ship to ship combat will work in Unending Galaxy. As usual, this is more to give you a general idea than a definitive article on the subject, comments and idea are as usual welcome.

Enjoy ! ๐Ÿ™‚

Ships

There’s several classes of ships:

  • Fighters : Small and Fast combat ships
  • Frigates : Medium ships with heavy firepower used as anti capital ships
  • Cruisers : Medium ships with heavy shields mostly used as anti fighter ships
  • Battleships : Very large ships with tremendous firepower
  • Carriers : Very large ships able to deploy and repair wings of fighters
  • Transports : Large bulky ships used to transport goods
  • Constructors : Very large and slow ships used to build stations

Ships can only use weapons and shields designed for their specific class (or for smaller ones). As an example, frigates can only use Medium and Small weapons while Battleships can basically use everything available in-game.

Each ship has a given amount of weapon and shield slots. Contrary to X3, ships can equip any weapon available for its class. However some factions, like the AI Core, are limited to their own equipments. More to the point, ships have a battery with a given capacity and recharge rate that is used to power both weaponry and shielding. As a result, it’s not necessarily wise to put the “best” stuff in all the slots if the ship’s battery can’t handle the stress.

Weapons

So far, there are three kinds of weapon behaviors:

  • Bullets : The classic shot, it goes from your ship toward a specified destination.
  • Beam : A straight line between your ship and wherever you shot. Anything at the receiving end will take constant damage until they move away or you stop firing.
  • Homing : Missiles and mines. It will move the same as a ship toward its target and explode on impact. Homing weapons can be destroyed (that’s not yet implemented though).

There’s also 3 damage types, one focusing the hull, one focusing the shields and a balanced one.

And of course, all weapons consume battery energy and have different speed, time to live, rate of fire and so on.

Shields

Shields protect the ship’s hull from damage. They can have different strength, recharge rate and battery usage. For example AI Core shields have a very low strength (while core ships have the largest hull strength in the game) but ridiculously fast regeneration rate, making small arms virtually useless against this faction.

Ship to Ship Combat

First of all, there’s no collision handling between ships. Mostly because we’re simulating a 3D space on a 2D plane, and because it allows me to cut down the calculations for more important stuff. To be honest, staying over an enemy ship is a very bad idea in itself and NPC ships will try to stay away from you and from each other anyway.

So far, the AI isn’t very good at fighting against human opponents. Mostly because bullet weapons become useless against the player once he learns how to circle around enemies. When equipped with beam weapons, they obviously become deadly. Note that I didn’t put much effort into it yet, because right now it’s a secondary concern coding wise. Also, balance wise, in the early game, sure you are going to fight AI ships yourself, but later on it will mostly be (your) AI vs (other factions) AI anyway. Still, enemy ships retreat when low on shield or battery and come back when ready.

Mostly not yet implemented but planned, ships will be able to fly in wings and carriers / military bases will be able to manage their fighters dynamically according to threats, like myย ADS plugin for X3:TC currently does with roughly the same level of efficiency.

Also (this may change but it’s very unlikely so far), contrary to X games, combat happening in sectors the player isn’t not currently looking at, happens exactly as if they were happening next to him. In general, nothing is simulated, there’s no differences (modder stuff) between “In Sector” and “Out of Sector”. Everything, everywhere is fully calculated.

6 thoughts on “Unending Galaxy : Combat”

  1. “Ships can only …class (or for smaller ones). As an example, frigates can only use Medium and Small weapons while Battleships can basically use everything available in-game.”

    – i hope smaller weapons are somehow “marked” besides the container class or mยณ/value.
    and will be there a “template” screen to pre-setup various “classes” for new ships, so it ain’t be necessary to fit every ship one by one ? ( If i ahve missed that feature in one of the older blogposts ๐Ÿ™‚

  2. Hi again ๐Ÿ™‚

    I’m not really sure what you mean by “marked”. If it’s a way to limit given weapons to specific ships: Apart from class and battery usage, it’s still possible to limit ships built by a specific faction to weapons built by the same faction. And programming wise, if i really want to have a rare ship limited to a specific set of weapons and shields, I can still make a “dummy” faction for this ship that will be used for that purpose only. But it will be the exception rather than the rule.

    Regarding templates. Yes, it will be possible to do exactly what you’re describing. Ships will have (editable) templates and buying them in bulk will give them the selected load-out.

    I can’t give much more details on that front however, this is relevant to the User Interface (GUI), a part that will be finalized last in development. I’ve already been burnt by rewriting my games’ GUI several times before completion. It can be quite demoralizing to rewrite several thousands lines of code because the older GUI became outdated. So I can answer questions regarding the AI, trading, factions, the universe relatively easily as it’s more or less set in stones now. But how you will specifically handle your empire, not so much yet.

    Cheers,
    SK.

  3. Iโ€™m not really sure what you mean by โ€œmarkedโ€. If itโ€™s a way to limit given weapons to specific ships: Apart from class and battery usage, itโ€™s still possible to limit ships built by a specific faction to weapons built by the same faction. And programming wise, if i really want to have a rare ship limited to a specific set of weapons and shields, I can still make a โ€œdummyโ€ faction for this ship that will be used for that purpose only. But it will be the exception rather than the rule.

    – marked as in “container class” as example in X-Universe, there was only S M L XL for the various items, it was for my self hard to understand which weapons are good for the cruisers as “anti-fighter vessels” or as counter “cruiser vessels”, except i read and test all weapons. … sorry if this is more confusing,then just ignore it, i will write another text by times when we can Test the game, which will be a better idea. if i have the money i will send some money along with the first “alpha” version (still fighting with the goverment, meh) ๐Ÿ™‚

    PS: thanks for the insight of your workload through the various GUI changes ๐Ÿ˜€ noworries i’m that “arrogant” or “clueless” to every producer :> because i can’t understand that kind of work ^^ This is my reference http://hypftier.de/files/programs-as-seen-by-users-black.png

  4. Yeah this picture is pretty much accurate ๐Ÿ™‚

    Ok, I think I understand now. So, yes, we have the S/M/L/XL setup of X3 but it’s only relevant to ship weaponry, trading goods aren’t using this. S is for fighters, M for frigates (so M class weapons will mostly be slow, long range and high damage), L for cruisers (so it will be fast weapons with a high rate of fire and shorter range) and XL for battleships and carriers. In any case weapon stats and usage will be displayed on screen before you buy them.

    And you made me realize that this S/../XL classification is probably a bit confusing. I will probably rename it to something making a bit more sense later on (or find a better system altogether) ๐Ÿ™‚

  5. Greetings Serial Kicked,

    On an off chance I stumbled across your website. I really enjoyed your work on the X-Series. I used Pirate Guild 3 and it was excellent. I initially based my first mod off of ECS. Have you already developed a scripting engine for your game and are you going to make it multi-threaded and scalable like Rebirth or will it be single threaded. Just curious, I’ve been researching how to make a multi-threaded persistent script engine/data engine combo that would support Universes significantly larger than the X series and scale with core developments.. Its been slow going, but I have some ideas I am going to get to try soon. Wondering if you’ve already solved the problem or if your planning on a smaller scale engine for version 1.0.

  6. @Anon:

    Hi, thanks for the praise regarding my plugins, it’s appreciated ๐Ÿ™‚

    So far my game is fully multi-threaded. To go into details, there’s a thread for each of the following: physics, ship AI and path-finding, faction AI, factory management and trading, display, and player input. I guess that when I will decide to add sound, it will have a dedicated thread too. The application is 32bit, but it won’t require that much memory anyway, and I can more or less recompile the thing in 64bits without too much hassle if I really need to.

    I have written many network applications in my younger years (if you were a Counterstrike player in the late 90 early 2000 you may have stumbled across my freeware server browser AWPunk), so I am kinda used to writing multi-threaded applications. Those are notoriously hard to debug, though, finding why a thread died can be a real pain.

    However, I don’t have a scripting engine for my game. I made editors however for the data (ships, sectors, map, factories, faction, wares…), but I am not sure yet if they will be available for free on release. I have relatively long term plans to allow scripting through LUA scripts, but I’ve not yet looked into it.

    Scale wise, I ran a few tests, so far my engine can handle much larger galaxies (with way more factories) than X3 (or X:R) could without the need of abstracting stuff not happening in the sector the player is currently in. However, once the faction AI is fully in place and fleets start battling around the galaxy, things may change a bit. Time will tell.

    Honestly, the best advice I can tell anyone who want to write something multi-threaded is to do it from the get go. It’s near impossible to add that later on in the development process.

    Cheers,
    SK.

Comments are closed.