Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI

Discord Channel | Website | Asset Store

From the makers of Landscape Builder, and LB Enviro Pack 1, comes a brand new asset full of technical know-how and goodness.

Popularized by the Star Wars saga, complex space planes which can move between planet surfaces and space with ease, are now the staple diet of gamers worldwide. The maths is extreme, which is why we take care of this for you.

NASA would call this a Space Plane controller. It can control a “craft” like an airplane while inside a planet’s atmosphere, but can also act like a spaceship while in space.

What is Sci-Fi Ship Controller?
Sci-Fi Ship Controller is an asset that allows you to quickly and easily turn your ship models into fully-functioning, flying ships.

How do I use it in Unity?
Currently, it consists of three main modules: The Ship Control Module, the Player Input Module, and the Ship AI Input Module. The Ship Control Module is a script that can be added to ship models to turn them into flyable ships, complete with all the parameters needed to tweak their behaviour to your liking. The Player Input Module is a script that can be added to any ship with the Ship Control Module already attached to map inputs from the Unity input manager and other input sources to the Ship Control Module in order to let a player control the ship.

Why should I use Sci-Fi Ship Controller instead of another asset?
One of the main things we’ve worked really hard on with Sci-Fi Ship Controller is its ease of use. All the parameters in the modules are arranged logically and have headers describing their functionality. In addition to this, every editable parameter has an associated tooltip, so if you’re unsure about what something does you can simply hover your mouse over it and get a brief description. We’ve also tried to write Sci-Fi Ship Controller in a way that makes sense to all game developers, not just ones that have a degree in aerodynamic engineering or physics. We’ll continue to work on this aspect throughout the beta: Your feedback matters to us.

One of the other strengths of Sci-Fi Ship Controller is its versatility. It isn’t an asset JUST for arcade spaceships, JUST for aircraft or JUST for hover-ships: If it flies, then there’s a good chance you can make it with our asset (and if you can’t, feel free to let us know so that we have to opportunity to improve Sci-Fi Ship Controller in that regard).

Sci-Fi Ship Controller includes an extensive, documented, runtime API with many C# examples.

As well as this, Sci-Fi Ship Controller is completely physics-based. All movements are driven by Unity’s built-in physics, which provides a great feel for players and ensures you won’t encounter any strange behaviour caused by our asset fighting with the physics engine.

Finally, Sci-Fi Ship Controller is designed from the ground up for performance. We’ve tried as much as possible to follow best practice and avoid expensive allocations and function calls, so Sci-Fi Ship Controller should only comprise a minimal part of your performance budget. The Combat system supports DOTS (Entities, Jobs, Burst Compiler in Unity 2019.1).

Beta Program
Get early access to all new great features that we’re developing. Also influence what features we are adding in the next release. Open to all who have purchased Sci-Fi Ship Controller. Private message me with your name, Unity invoice number(s), and email address to sign-up.

Playable Tech Demos

AG SSC Racer
SSC Tech2

5 Likes

Currently implemented features (available as of version 1.1.0):

Wide range of supported ship types, for a variety of games

  • 6 degrees-of-freedom spaceships
  • Limited degrees-of-freedom spaceships (i.e. always oriented upwards)
  • Physically realistic aircraft (aeroplanes, fighter jets, etc.)
  • Anti-gravity futuristic racing craft (such as in the Wipeout and F-Zero series)
  • Ground-based endless runner ships
  • Spaceplanes
  • And more!

Physics-driven controller

  • All motion is completely driven by physics, resulting in a smooth and natural feel
  • Two selectable modes: physics-based and arcade
  • Physics-based allows you to create physically realistic craft, only exposing realistic options to the developer
  • Arcade maintains the same physics-driven control while exposing a number of options to allow for different gameplay styles

Configurable input system

  • Easily configure inputs from the keyboard or the unity input system to pass to player ships using the player input module
  • Intuitively map inputs to thrusters with just a few clicks
  • Control surfaces and arcade rotation inputs are automatically configured correctly from the player input module
  • Support for new Unity input system
  • Support for VR input systems (Oculus and Vive)
  • Rewired integration

Extensive suite of control modifiers to suit your game

  • Rotational and translational flight assists to make flight a more intuitive experience for players
  • “Limit pitch/roll” feature: Ship is limited to a certain range of pitch and roll. Roll can either be controlled by yaw (turning) input or strafe (moving) input
  • “Stick to ground surface” feature: When a ground surface is detected underneath, the ship attempts to maintain a certain distance from the ground surface and orients itself to the ground surface
  • Behaviour can easily be tweaked with a small number of parameters

Realistic aerodynamic simulation

  • Profile drag and angular drag properties calculated from your ship model
  • Editable profile drag and angular drag coefficients
  • Ability to add any number of wings to a ship, with basic lift and induced drag simulation
  • Stalling effect (adjustable in arcade mode)
  • Ability to add any number of control surfaces to a ship. Current control surfaces available are ailerons, elevators, rudders and air brakes

Weapons system

  • Ability to add any number of configurable weapon components to a ship
  • Configurable inputs for weapons (i.e. primary and secondary fire)
  • Pooling system for projectiles
  • Option to use DOTS (a.k.a. ECS) for projectiles
  • Turrets that can track a specified target

Damage system

  • Simple damage model - take damage up until a point then respawn
  • Progressive damage - damage can affect performance of ship parts such as thrusters and weapons
  • Localised damage - depending on where the ship takes damage, different parts are affected
  • Global / localised shields for ships - can absorb damage before ship/part health is affected
  • Ability to spawn explosion prefabs etc. when ships are destroyed or projectiles collide with objects

AI system

  • Flexible state-based system for AI control of ships
  • Default states: Idle, Move To and Dogfight
  • A variety of default behaviours that can be used in states such as pursuit, evasion, obstacle avoidance and path following
  • Location and path system to allow loose or fine control of your ships’ movement
  • Simple API for initiating state transitions and setting state parameters
  • Ability to write custom states and behaviours to suit the specific needs of your game

Visual interface for faster development

  • Thrusters, wings, control surfaces and centre of mass all visible and adjustable in the scene view
  • Intuitive editing processes fully integrated with the usual Unity tools (move, scale, rotate etc.)

Prioritised ease of use for developers

  • Tooltips for all editor parameters, along with headers in the editor explaining features
  • Doesn’t have lots of difficult-to-use technical parameters
  • In-depth documentation of all features

Other

  • Scripting API for scripted inputs, modification of values at runtime and runtime creation of ships
  • Tutorial videos
  • Demo ships/scenes with example setup and gameplay

Features targeted for future releases:

AI improvements

  • Radar system for tracking allies and enemies
  • More default states and behaviours (let us know what you want!)
  • Individual AI characteristics (speed, skill, etc.)

Weapons

  • Allow projectiles to collide with DOTS physics colliders (NOTE: coming in version 1.1.1)
1 Like

SCI-FI SHIP CONTROLLER HELPFUL LINKS

Setup Basics Tutorial
Control Tab Tutorial
Damage Tutorial
Physics-based Tutorial
Weapons Tutorial
Radar Basics Tutorial
[Get Started with Ship AI]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-2#post-5368236)
[Damage Types]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-4#post-5486817)
[Damage and Health API]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-2#post-5375967)
[Location and Path Editor and API]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-2#post-5170517)
[Input Force Feedback]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-2#post-5406642)
[Input Sensitivity]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-2#post-5418522)
[Ship Respawning]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-2#post-5380092)
[Surface Turret Module]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-4#post-5500651)
[Auto-Cruise]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-4#post-5490720)
[Game Pause and Resume]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-5#post-5781205)
[Ship Docking Station setup]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-5#post-5769601)
[Tech Demo 2]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-6#post-6277157)
[Tech Demo 3]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-9#post-7487552)
[Tech Demo 4]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-9#post-7633393)
[Doors and Landing Gear]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-7#post-6387960)
[Tech Demo setup with (new) Unity Input System]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-7#post-6654862)
[Ship Entry/Exit with Sticky3D Controller]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-8#post-7299262)
[Create Custom Player Input at Runtime]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-7#post-6702046)
[HUD links, info and requests]( [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI... page-9#post-7496102)

Don’t forget to check the “Common Issues” chapter in our manual as it gets updated regularly.

To get to the manual click “Help” on the Ship Control Module.

Hello, fellow Unity developers!

I’m David, one of the developers of Sci-Fi Ship Controller. As mentioned previously, we are about to release a beta version of the product for people to test, so I thought I’d write a post to talk a bit more about what the workflow of Sci-Fi Ship Controller is like, specifically the Ship Control Module. It won’t be an exhaustive rundown of all features, but it should give a bit more information about whether it’s something applicable to your game.

Getting Started

With Sci-Fi Ship Controller, we’ve tried really hard to make the ship setup process as simple and easy as possible. As such, to convert one of your existing objects to use the ship flight mechanics of Sci-Fi Ship Controller, you simply add the Ship Control Module as you would any other script.

Once the Ship Control Module script has been added to the ship, the ship’s behaviour can be tweaked using the four tabs: Physics, Control, Thrusters and Aero.

The Physics Tab

The physics tab (shown in the screenshot above) is usually a good place to start when setting up a ship, as it contains a lot of the basics. Here you can specify the mass of the ship, as well as the strength and direction of gravity acting upon the ship. You can also specify whether Unity should set the centre of mass of the ship automatically or if you want to set it manually. Probably the most important value to start with is the one at the top, however: The physics model. The physics model determines what options are available for ship control and behaviour. There are two options currently available: Physics-based and arcade. Physics-based mode is best employed for games aiming to achieve a large degree of realism, or at the very least evoke a sense of realism from players. In general, only physically realistic options are available. Arcade mode, on the other hand, provides a number of extra options to enhance ship feel and gameplay while removing certain behaviours entirely in order to make ship setup and control easier. For example, the screenshot above shows the pitch/roll/yaw acceleration and turn acceleration options, which are only available in arcade mode. Pitch/roll/yaw acceleration values directly determine how quickly the ship rotates on each axis - in physics based mode rotations can only be achieved indirectly via the use of thrusters (more on that later). Turn acceleration adds force inputs to a ship based on its motion in order to make the ship’s velocity more in line with the way it is facing, which is common in a lot of flight games as it makes flight control and movement a lot more intuitive for players.

The Control Tab

The control tab (show in the screenshot above) is typically the next stop in the setup of a ship. For some ships, the control setup is very simple, while in others (such as the classic hovership shown in the screenshot above) the control setup is more complicated. Essentially, the control tab is used for used for setting up any input control that the computer will do instead of the player. This includes input assists (such as the rotational flight assist) which make flight easier for players, as well as control modifiers that allow more interesting behaviour to occur (such as stick to ground surface, which controls the pitch, roll and vertical inputs of the ship to allow it to orient itself to the ground surface and maintain a given distance from it). The control tab determines a lot of the behaviour of the ship related to gameplay.

The Thrusters Tab

The thrusters tab (shown in the screenshot above) is exactly what it sounds like: It’s where you set up your ship’s thrusters. Each thruster has a vector direction and a force amount specified, and is linked to the various player inputs via the selection of which force direction and (in physics-based mode) moment directions (read: rotations) the thruster is able to move the ship in (this can be set up automatically using the auto-populate forces and moments button). An effects object can also be specified for each thruster to link it with effects to be triggered when the thruster is in use.

The Aero Tab

The aero tab (shown in the screenshot above) is where you determine how your ship interacts with the air around it (its aerodynamic properties). This can be through altering environmental properties (the medium density), the drag properties (how moving through the air slows the ship down on each axis) or by adding wings and control surfaces. Wings simulate the effect of parts moving through the air generating lift (upwards force); their properties are controlled by changing the size and angle of attack (inclination) of the wing, as well as the stall effect (how much the effect of stalling affects the wings of the ship). Control surfaces are moving parts that change the aerodynamic properties of the ship in order to let the pilot control it, such as ailerons, rudders and air brakes. Control surfaces are automatically linked to the correct player inputs based on the type of control surface and where it is positioned relative to the centre of mass of the ship.

That’s it from me for now. However, if you have any questions about Sci-Fi Ship Controller feel free to ask them in the forum (or in the Discord channel linked in the first post!).

3 Likes

BETA REGISTRATION NOW OPEN

We are now accepting registrations for the Sci-Fi Ship Controller beta. Please private message me your name and email address (don’t post it directly in the forum). Shortly we’ll be providing you access to the beta version.

Hi again!

Today I’d like to show a bit more about how you can edit the ships of Sci-Fi Ship Controller directly from the scene view. Before I do however, I’d like to give a big thanks to everyone who has signed up for the beta so far. Your testing and feedback is really valuable to us - it’s great to have you on board.

In-Scene Editing

Sci-Fi Ship Controller has a number of features that support in-scene editing for more intuitive development. The screenshots below will hopefully show this more clearly.

The screenshot above shows the in-scene view for an arcade-styled exploration ship. As you can see, there are a number of coloured spheres and other indicators spaced around the craft. These can all be selected and moved/rotated/scaled (different options are available based on the context) using the standard Unity editor tools. The colours indicate what type of object or property each indicator controls. For instance, purple indicators are for thrusters while the yellow indicators are for control surfaces (in this case the yellow indicator in the screenshot represents an air brake).

The next screenshot shows a more complicated setup, this time for a more realistic representation of a jet airliner. This craft has a lot more control surfaces, as well as two wings (shown by the cyan indicators). The wing on the right is currently selected with the move tool, which can be dragged around in the scene view to adjust the wing’s position.

Here’s a quick video of the editing process in action:

In the video you can also see the aerodynamic guides in action (the dotted lines). The cyan dotted line represents the centre of lift of the ship, while the purple dotted line represents the centre of thrust of the ship. As can be seen in the video, they are updated in real time when you move ship components around in the scene. In conjunction with the centre of mass (the grey sphere) they can help you position your thruster and wing components correctly in order to get the desired flight behaviour.

That’s all for now, I’ll be back soon with some more forum posts with more information on the current features we have available in the beta and some of the new stuff we’re developing. Just a quick reminder that beta registrations are now open; just private message sstrong with your name and email address. Also, feel free to drop us a line in our Discord channel (linked in the first post).

Demo Video

1 Like

Rewired Support

We have just added Rewired support in our Player Input Module.

4049179--351808--upload_2018-12-31_8-39-50.png

If using SSC with Rewired and Xbox One controllers with Windows Standalone or UWP Store builds, you may wish to setup a Rewired Gamepad Template. This is not specific to Sci-Fi Ship Controller, but it may save you some time due to how Windows works with Xinput.

Here is a suggested mapping with the current SSC beta. The Player Input Module works for both Axis and Button input. It has been tested with Keyboard Maps and Joystick Maps in Rewired. If you see any issues, please let us know.

At runtime in the Unity Editor, the Player Input Module has a Debug Mode which will help you identify what input data is being set to the Ship Control Module based on your configuration.

1 Like

Oculus API support

We’ve added provisional support for the Oculus API. If anyone has any Oculus VR headsets and controllers and would like to help test that, please let us know.

Xbox One, UWP, Creators Program

We have tested Sci-Fi Ship Controller on Xbox One as an Universal Windows Platform app with Rewired as the Player Input Module input source. This was done on a retail Xbox One device in dev mode.

For more information on Xbox One, UWP and the Creators Program, see here.

Will this be compatible with the new input system that is coming in Unity 2019.1?

Yes. Currently we support direct keyboard input, the old unity input system, rewired and VR input (Oculus and Vive), but in the next few months before release we’ll be adding support for the new unity input system. If it’s a feature you’d get a lot of use out of, we can prioritise it as a feature and work on it sooner.

Primary and Secondary Weapon Fire inputs for Keyboard, VIVE, Oculus, and Rewired

We’ve recently added support for primary and secondary (weapon) fire buttons.

In VIVE VR, we’ve also added support for body actions. So, for example, the space ship could pitch up by looking up or down.

Beta 0.2.0 is available

There is a lot of new content which we’ll provide more details in future posts.

  • Unity 2019.1 support (also supports 2017.2+)
  • Damage system: Simple damage model
  • API calls to cause damage
  • Collision damage
  • Ship respawning system
  • Weapon inputs - keyboard, VR (Vive + Occulus API), Rewired
  • Projectile system - Non-pooled, pooling system, or DOTS [Entities, Jobs, Burst compiler]
  • Weapons components
  • Editor improvements
  • Support for HDRP and LWRP (requires 2019.1)

[HOW TO] Setup Projectiles for use with the Combat System

  • Create a prefab for the projectile (to get started you could use a small sphere)
  • Add the Projectile Module script to the prefab
  • On you space craft, in the Ship Control Module, go to the Combat tab
  • Add at least one Weapon
  • Add the Projectile prefab to the weapon
  • Set the Firing Button (this must also be setup in the Player Input Module)

[HOW TO] Setup Projectiles to use DOTS/ECS

  1. In Unity 2019.1.0f2 or newer open Package Manager
  2. Install the following packages (or newer)
  • Collections 0.0.9 preview 17
  • Mathematics 1.0.0 preview 1
  • Jobs 0.0.7 preview 10
  • Entities 0.0.12 preview 30
  • Hybrid Renderer 0.0.1-preview.10
  • Burst 1.0.0-preview.12
  1. On the projectile prefab, enable DOTS

We found a small issue with the Anti-gravity Racer Demo so have uploaded a new version (0.2.1 Beta 1a).

Progressive Ship Component Damage

For the next beta (0.3.0), we’re adding support for progressive and/or localised damage of components on the ship (thrusters, wings, control surfaces and weapons). So when the ship gets damaged, the performance of the parts on the ship also decreases to reflect that damage.

In the coming beta, you’ll be able to select the “progressive” damage model, allowing you to selectively mark components of your ship to “use progressive damage” (see the screenshot above for two thrusters). From there you can choose the minimum performance level (how badly the parts can be damaged) and their starting “health” value (how easily they can be damaged).

1 Like

Coming in v0.3.0

  • Fixed Projectile spawning rotation with DOTS (ECS, Jobs, Burst Compiler)
  • Effects for Projectile collisions (Pooled, Non-Pooled, DOTS)
  • Ship components or parts can have a progressive damage
  • Ships can have shielding (see Combat tab on the Ship Control Module)
  • When ships are destroyed you can add an optional effect (e.g. explosion FX)
  • Weapons and Wings can have custom names

Using Sony Dual Shock 4 with SSC

If you don’t have an Xbox One controller, but have a Sony Dual Shock 4, you are all set. You can use the legacy Unity Input method or, if you have the excellent Rewired asset, then the Sony controller will work with the suggestion config here .

To connect your Sony controller to a Windows 10 PC, follow these steps:

Wired

Use a micro-USB to USB cable, plug the small end into the controller and the regular USB into your PC. Your controller is now ready! How easy is that?!

Wireless

  • Make sure the Sony Dual Shock 4 controller is fully charged

  • Turn the controller off

  • On the Windows 10 PC make sure Bluetooth is enabled

  • On Windows 10 PC type “Bluetooth and other device settings” in search bar (bottom left of screen)

  • Click “Add Bluetooth or other device”

  • Click “Bluetooth”

  • On Sony controller, press the “Playstation” button (button between joysticks) and the “Share” button (just to the right of left arrow pad on the top left of the controller).

  • The light bar on the front of the controller should start flashing.

  • When “Wireless Controller” or “Input” appears, click on it. Windows 10 will then automatically pair the controller with the PC.

  • Now, you’re good to go!