Hello! I’m William from VSXGames. Welcome to the forum for the Space Combat Kit for Unity!
Looking for a package that will help you create any kind of 3D space combat game imaginable? After several years of development, constant updates and a recent major revision to improve the ease-of-use even more, the Space Combat Kit is the best foundation for your space game.
Whether you’re looking to make a simple mobile space shooter or a complex space sim, this kit has you covered.
Easily customize target boxes and radar icons for different target types.
Health
Easily make anything damageable and explodable
Subsystem targeting and damage.
Energy shield with hit effects.
Slow ship detonation (for those big capital ship explosions!).
Resource Management
Add boost fuel consumption, energy management, weapon ammunition, and more to your game.
Drive events with resource levels (such as exploding the ship if heat gets too high).
AI
Physics based AI controller.
Obstacle avoidance.
Patrol, formation, and combat (including attack and evade) behaviors.
Behavior system for adding your own AI behavior.
Modules / Module Mounts
Create points on your ship where the player can load modules (e.g. weapons)
Easily create new modules (weapons, health generators etc).
Loadout menu for ship and loadout selection;
Load and swap modules during gameplay.
Floating Origin System
Handle large space scenes with no fuss.
Handles particle systems and trail renderers automatically.
Objectives System
Set up objectives for the player
Set waypoints to them and display them on the HUD
Ship Enter/Exit System
Easily enter and exit ships during gameplay with a character.
Use third party character controllers.
Pooling System
Efficiently handle many objects in the scene such as projectiles, explosions, and effects.
Simple and easy to use.
Rumble System
Add camera shakes and controller rumbles based on what’s happening in the scene.
Customize rumbles in the inspector.
Menu System
Pause, game-over, loadout, and controls menus.
Game states system to easily switch between game states and activate menus.
Much More!
Loads of utility scripts and components to help you build out your space game.
Additional benefits:
Packed with features – build the foundation of your game in a fraction of the time it would otherwise take, giving you the opportunity to quickly test new creative ideas and make rapid progress toward release.
Easy to customize – enjoy a modular, event-driven design that gives you powerful customization from the inspector. All the code is designed to be easily extended with inheritance, and is neatly written and documented.
Actively Supported And Updated – benefit from years of constant development and updates, driven by a community of users just like you. No support request goes unanswered.
Feel free to ask me questions about this kit, and I am always very keen to hear what you would like to see improved or added in the future.
Don’t wait! Grab your copy of the Space Combat Kit right now and turn your dream space game into a reality
Sorry, forgot about enabling that, I don’t use mouse very much! Fixing it now, should take about 15 minutes. Thanks for playing and let me know any feedback you have
Edit: Updated now, sorry for the delay. Use K and M to switch between keyboard and mouse respectively. Don’t forget to clear your cache if you played the old version.
Keep it coming! Let me know what YOU want to see in this kit
Update:
Finished the Ship and Level Manager scripts in preparation for large space battles with numerous ships.
The Ship script contains references to all the publicly useful components of each ship such as the gameobject, rigidbody, flight controller, avionics, shields etc, meaning that virtually all the expensive GetComponent calls are removed during runtime. This is great for performance optimisation especially on mobiles.
The Level Manager stores references to the Ship scripts for all ships in the scene, and contains functions for radar target cycling such as Next Target, Closest Target, Freest Target, Target Under Nose etc. This means that all the ship data is stored and accessed at a centralised point and improves performance.
@ikemen_blueD due to a few changes in my work/life I stopped working on it and I’ve been focused on other stuff. However you made me think about starting it up again! Space exploration and combat is my favourite thing in games so I will have to get back to this soon. Let me know if you have suggestions as to what I might put in there that you haven’t seen in other kits. Thanks for showing your interest!
@Billy4184 Space exploration and combat is my cup of tea also. For now, I kind of like your Target system, your AI system. I would love to see more Steering AI behaviors, especially a large group of Ships, moving together, smart AI Space Combat, performance friendly for massive space combats, no fun if you cannot fight more than 50 ships at the time, mobile support
Yes, just before I left it I was working on centralized collision detection to reduce the amount of raycasting going on. In fact the whole thing was made with mobile in mind! The auto snap targeting a la Starlancer is essential also for mobile.
AI is a bit of a funny proposition, I think the main thing to focus on is reactivity, i.e. the enemy changing targets and prioritizing dynamically. Nothing feels deader than a zombie enemy that just flies toward you shooting! Apart from that coding the enemy is not very hard, although path planning and collision detection are sometimes tricky.
Cannot agree with you more. Auto Snapping Target is a must. Since when I shoot I want to shoot like a pro lol. Surprisingly, mobile user often hates too hard user control inputs, simpler, better. The centralized collision detection to reduce the amount of raycasting is really interesting to me. I work with a package that no needs to have a collider to detect a ray cast. It’s okay. But, at the end, I still cannot avoid to have a Rigidbody for each AI. Anyway, AI is just a suggestion. I already have my in-house system. The more I play your game, the more I wanna it now I will be patient …, happy coding!!!
This package is back on the burner, with a few changes:
Cockpit view will appear in the first version, whereas before it was planned to add it as an update;
AI will not appear in the first version. It has been decided to develop an optimised general 3D navigation solution in a separate package which may be included in this one in the future. Very simple state-machine AI may be added in a future update if it is highly requested.
A lot of code has been re-written to improve architecture and ease of interaction.
Here’s a picture of current progress (cockpit and skybox are just placeholder):
Glad you like it, the cockpit is just a quick untextured placeholder so you can expect a much more exciting one soon! Also let me know if there’s something you’re looking for in particular in case I’ve missed it and it would be a good fit for the project.
I did a little work on the skybox today to make it look better, here’s the outside view. HUD not finished yet for this view.
Code-wise I’m working on the missile’s PID controller at the moment.
Very cool! What about scaling up for controlling large (Capital) ships? Camera set back farther when controlling huge ships, and closer in for smaller fighters in 3rd person camera view? And a “bridge” cockpit first person view when controlling large Capital ships? With generic spots for crew characters manning stations? I’m working on a space sim game and about to scrap/restart my ship controls code in my never-ending game development - and this looks promising!
Support for multiple ships? Ie: so you can switch between multiple ships in your fleet? (I’ve been working on a simple formation system so ships will form up on a capital ship when recalled, and select leaders to follow when sending out fighters/bombers - so their AI only needs to make decisions if they’re the “leader”, and ships assigned to follow them continually navigate to their formation points unless ordered to attack something… Orders cascade down the chain of command: ie waypoints, targets, aggression, etc
UNet support? Multiple fleets (players) sending commands to their fleets attacking, resource gathering, exploring, etc
Turrets/weapon-groups?
That would rock! I’ll be watching this thread for sure!
Hi @danreid70 , thanks for your interest and comments!
Modularity and scalability is at the core of what I’m trying to achieve. For example, adding a new weapon to the ship will simply be a case of adding a GunSystem or MissileSystem script to an object, setting the parameters, and adding it as a child of the Weapons component of the ship. This should automatically do everything else such as creating a pool for the projectiles/hit effects at runtime, updating the HUD, updating the targeting system etc etc. I am making a big effort to make every component relevant to any general definition of “ship” from fighters to capital ships. Also setting the position of the camera target is just a matter of dragging a gameobject. However I do understand that there are quite a few differences in capital ship combat. Expect v1.0 to be ‘core features of space combat’ and therefore probably more fighter-based but I can see a big update for capital ship combat coming soon.
Multiple ship support is an interesting proposition, I can see that you’re looking for team-mate AI that kicks in when a ship has been deselected (see my post below). I went a long way with my AI before I decided to separate it into a different product, and I’m still a little bit unsure that I’ve done the right thing by doing that. The reason being that I see quite a lot of questions from people unsure what makes decent space combat AI, not to mention wondering what the optimal solution for 3D pathfinding is, and the asset store is lacking in this area. I feel that a space combat kit should probably address this to some measure.
UNet support hmm, multiplayer is my weak area but I can see this looming on the horizon, considering how much it is a part of space combat games of this era.
Weapons groups this will probably not be added to the first version as I’m trying to keep it to the bare basics and get it out the door, but I have no doubt it will be part of the first update(s).
I wanted to add a post on AI because, despite the fact that at the moment I’ve sort of decided for the time being to separate it into a separate product, I want to stimulate discussion about it and see what people’s experiences, wants and expectations were. I also noticed @danreid70 and @ikemen_blueD that you both mentioned AI in your comments.
AI Behaviours
When I started work on the AI (quite a while ago) I did quite a bit of research on the topic and found a lot of thread questions that hadn’t really been properly answered. People asked what made a good spaceship AI and there were a lot of generic answers that were helpful but not specific. In my early testing I also found it quite difficult to code something that didn’t feel flat and boring and didn’t devolve into a continuous turning battle. After a while though I found some good information, especially from a guy who had worked on the X-series. So my current thoery of best practice for space combat AI behaviours is:
Reaction-driven behaviour is far more important than planned behaviour as players can much more easily identify it in the melee of combat and therefore feel like their actions have an effect on the AI ship. Exaggerated behaviour is hardly ever a bad idea even if unrealistic (as a lot of game devs are well aware of!).
The quanitity of pre-programmed interesting behaviours goes a long way to making interesting AI. Due to ‘the more the merrier’ being relevant to AI behaviours, state machines are not scalable and behaviour trees are a better option. However I’m not sure if I should code my own behaviour tree asset due to there being well-respected products on the Asset Store already;
In creating such things as evasive maneuvres generating on-the-spot spline paths for the ship to follow (inspired by Kythera’s work on Star Citizen) works well and is easier to apply to a range of complicated manoeuvres (I’ve actually got the basics of this working already). It is much easier than trying to determine whether the ship has reached a certain step in the maneuvre by comparing its current physical state to the starting physical state, especially when something like a collision might have happened in the meantime.
Path Planning and Obstacle Avoidance
Surprisingly, the same lack of clear information went for 3D pathfinding in space games, which I thought would have been tackled numerous times. For example, a lot of answers just suggested extending the A* algorithm into the 3rd dimension. However for large volumes of space with only a small percentage of that volume filled with ships, A* isn’t going to be optimal out-of-the-box. The conclusion I’ve come to is that the best way is a combination of traditional methods (A*, raycasting and so on) but that the bulk of what makes it relevant to space games is in performance optimisation and drastically pre-culling the information fed into the algorithms.
My theory of best practice for 3D path planning and obstacle avoidance is:
It is hard to go past A* algorithm as it is basically proven to be the best path-finding algorithm possible. However uniformly distributed nodes will almost certainly be prohibitively expensive in performance. Manually creating 3D nav meshes also would be a nightmare. I haven’t gone too far yet but generating nodes around obstacles seems to me to be best way to populate the node list, although I can see a lot of challenges here.
Manually creating spline paths for ships near complex structures is likely a good idea, especially concave structures. Otherwise the ship should stay outside the convex hull of the object to avoid getting trapped.
Raycasting is probably the best approach for avoiding dynamic obstacles as well as a preventative measure around static obstacles, and controlling the raycasting from a centralised information point (i.e., a script that only allows a ship to raycast if other ships are nearby) is a good way to reduce unnecessary raycasting.
Another way to do dynamic collision avoidance is in a completely centralised way where the ships themselves have no ability to detect collisions. A script might calculate the trajectories of the ships to predict collisions and send commands to the ships to avoid them. This approach is neat and tidy but in some sense less ‘realistic’ and I haven’t tested performance comparisons with raycasting.
Another important thing I’ve found is the necessity to control the AI behaviour collectively, or otherwise large battles become messy and unintelligent and the lack of strategy is obvious to the player. For example it is easy to end up with a lot of ships attacking the same target even when there are other freer targets nearby, and I’ve found that it is hard to keep the fight spread out as it wanted to converge into a small cluster with the AI I had. So I’ve done a little work on an AICommander script that controls this and would make it easier to separate tasks between ship classes (e.g. fighter, torpedo bomber) and enable a high degree of teamwork between the ships.
Due to the enormity of the task of combining all of these things, I decided to keep it as a separate product, but I would reconsider adding it to this package if it was enough of a necessity. It wouldn’t be for some time though.
Would definitely be interested in seeing that AI implementation as part of this package! I’ve been rolling my own, and worry about overkill. Have seen some great results in my own system trying to keep it very simple, but as you stated above: with groups of ships acting in concert, an “AI Commander” script does seem to end up being necessary. Otherwise even the emergent behaviors (using simple AI) does seem to just end up looking somewhat chaotic - whereas having a concerted overall strategy being controlled by a higher level AI definitely would make for a more realistic adversary (and smarter seeming player controlled/commanded AI units).
Would really like to see your AICommander code in action. Will check out your site (just found this thread and getting a bit of time to finally dig in a bit deeper tonight). What price range are you looking at for this package (and especially interested in the continued development ideas you brought up).
My plan is to store player data/inventory/scene map data online via SQL, and store Host info per “map sector” for which player is currently hosting (first player in becomes host, when max players is reached, new players launching that map area become new host… Ie, if no host data listed, player becomes host, else they join that host… Etc). That way seamless navigation through “space sectors”, and in “local space” (scene), I’d use UNet to update just pertinent data per player and per units - when data changes… Pos/rot, thrust, weapon target (net id of target or position depending on target)… I’m rambling now… Sorry… Lol
Really looking forward to the evolution of this! Could really use it especially with my current “revamping” of my command system.
Yeah that’s the thing, it feels like you could almost make a good system with just a few behaviours, but getting it from 75% to 100% means adding a lot of stuff. That’s the way it seems to me.
And it definitely is necessary to add some teamwork-oriented behaviours in there. It would probably be possible to actually get some good teamwork by working at the individial level, by, for example, making an AI agent look for a target that is as free as possible, but without knowing exactly what their team-mates were targeting it would be hard to read which targets were freest simply by looking at the ships and their positions. So it makes sense to centralise things anyway. On top of that any combat in real life involves teamwork and tactics and radio communication so it doesn’t make sense not to have some entity directing the combat.
My description of the AI commander script was actually more what I intended rather than what I’ve achieved yet. I was more interested in getting the fundamentals such as obstacle avoidance down first. And now the AI is not my priority until at least v1.0 is out the door. But as a space strategy fan (Homeworld 2 being my favourite game) big tactical battles are the nirvana of space combat even in first person, and I think a lot of space games just shortcut the work by emphasizing multiplayer and leaving AI behind, without realising that AI can often do a much better job of creating that cinematic experience for the player.
I’ve never programmed a multiplayer game and it certainly doesn’t seem to be easy, so thanks for giving me an idea of what you’d like to see as it helps me see how you would like to manage the multiplayer aspect. It won’t be a priority for a while though I imagine. It all depends on how the first version is received and what is most requested.
Yeah I let my site slip lately (and stopped paying the hosting) so I need to get that link out of my sig until I set it back up. It will definitely be up again very soon.
Started the VSXGames site again from scratch today, a little on the unfinished side but feel free to check it out and leave feedback. I know, I know, there need to be more pictures. Unfortunately I’ve focused mainly on the programming and left the art very ‘placeholder’ so I’m going to make an effort to bring up the art to an acceptable level over the weekend.
All updates will be posted both on this thread and on the site.