Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Controller [Released] Sci-Fi Ship Controller - A versatile physics-based controller with playable demos, AI...

Discussion in 'Tools In Progress' started by sstrong, Dec 7, 2018.

  1. ericsteimle

    ericsteimle

    Joined:
    Dec 26, 2017
    Posts:
    3
    Is there any documentation on how unity input system buttons are tied to the input actions? I can control a prefab ship with my xbox one controller just fine (using new unity input system). It seems to use trigger left and right as brake and thrust, but I don't see where that's configured. Also a little confused about how the fire projectile system works and how I can map it to my controller buttons (and maybe remap trigger to be guns and not thrust :) If it's in a script somewhere that's fine, just can't find it yet.

    Thanks for any help you can send my way. I have read through the doc at least the first half before AI, and started watching the videos.

    Thank you
    -Eric
     
  2. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Actions in the Player input Module, map to Actions stored in a Unity Input Action asset (e.g. MyShip) that are stored in the Project. The Player Input component, not to be confused with Sci-Fi Ship Controller’s Player Input Module, contains a link to the Unity Input Action asset. Double-clicking on this will open the Unity Input Action editor. This is part of the (new) Unity Input System and is not part of SSC.

    The Default Map setting (e.g. ShipActions) in the Unity Player Input component will determine which Actions are visible to the SSC Player Input Module. The Unity Input System can have multiple sets of Actions in what Unity calls “Maps”. The SSC Player Input System will only use one of those maps.

    upload_2020-3-12_9-34-49.png upload_2020-3-12_9-35-5.png
     
  3. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    SnapToMesh

    If you are procedurally generating planets or terrains or any ground surface (mesh), it can be useful to update Paths in the scene at runtime. One scenario, is you have one or more Paths that your AI Ships can use. Once the terrain has been generated, the Path heights now don't match the terrain.
    Code (CSharp):
    1. sscManager = SSCManager.GetOrCreateManager();
    2.  
    3. PathData path1 = sscManager.GetPath("MyPath1");
    4. if (path1 != null)
    5. {
    6.     path1.snapMinHeight = 0f;
    7.     path1.snapMaxHeight = 2000f;
    8.     sscManager.SnapPathToMesh(path1, Vector3.up, ~0, true);
    9. }
    We have also added a button for each Path in the SSCManager so that you can manually update Paths in the Editor.

    There is also a method for individual Locations.
    Code (CSharp):
    1. sscManager = SSCManager.GetOrCreateManager();
    2. LocationData locn = sscManager.GetLocation("Sqdn1 Dest2");
    3. sscManager.SnapLocationToMesh(locn, 10f, 0f, 2000f, Vector3.up, ~0, true);
    This will be available in v1.1.4 or in the latest Beta.
     
    Last edited: Mar 13, 2020
  4. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Ship Docking

    As part of our next Tech Demo, we're working on a docking feature. The initial concept is that a smaller ship can be in 3 different states:
    • Docked
    • Not Docked
    • Docking
    We're interested in hearing from anyone who has any requirements or ideas specially about the "Docking" state. This is when the smaller ship is in the process of landing / docking or say leaving the hanger or docking port of a larger Spacecraft.
     
    docsavage likes this.
  5. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Creating HUDs with Sci-Fi Ship Controller

    Head-up Displays (HUD) are very common in games that use Sci-Fi flying craft. The typical approach is to provide a somewhat configurable HUD in an asset. However, these will most fail due to what I call in my IT Consulting role, the Green Wavy Line Syndrome (GWLS).

    So, what is the GWLS? Basically, for every configurable variation, someone will always think of 7 other ways to do it "better". There are two main approaches:
    1. Attempt to build every variation
    2. Provide the tools to let people do what they want
    We have taken the second option as we truly believe it is more flexible and will stand the test of time as screen layouts, and HUD designs change over time.

    We want to make sure you have all the data you require, when you require it, so that you can design a HUD that suits your game style.

    Sci-Fi Ship Controller does provide some placeholder on-screen items like touch controls (see Player Input Module with Unity "new" Input System). There is also the Radar system which contains a sample mini-map. However, the radar system is fully API driven so you can display the radar "data" however you like.

    That is not to say we will never provide sample HUDs (they are on our roadmap). However, first we want to make sure you can build any HUD you like using our data. If you have any problems accessing what you need, please ask.
     
  6. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Coming in Sci-Fi Ship Controller v1.1.4

    Here is what is in the current Beta:

    [NEW] Surface Turret Module supports effects objects
    [NEW] Turrets have optional inaccuracy
    [NEW] Paths - Snap To Mesh option in SSCManager Editor and runtime API
    [NEW] Locations – Snap to Mesh option in SSCManager (runtime API only)
    [NEW] Radar - query options to include/exclude ship squadrons
    [NEW] Call your custom method when a ship is respawned
    [FIXED] Surface Turret Module - NullReferenceException before Turret Pivot X added
    [FIXED] Surface Turret Module - ships targeted by radar do not consider their velocity
    [FIXED] Ship Control Module - PID controller regression
    [FIXED] Ship Control Module - damage regions in the editor are not rotated correctly
    [FIXED] Radar - Locations Visible to Radar may not appear on mini-map when scene starts
    [IMPROVED] Surface Turret Module - automatically receive damage when a Damage Receiver is attached
    [IMPROVED] Turret precision for ship targets
    [IMPROVED] Player Input Module - Initialise on Awake option
    [IMPROVED] Ship collision damage is now automatically scaled based on the mass
    [IMPROVED] Radar - Ships and Locations can have individual blip sizes

    We're also working on a pretty cool ship docking solution that will be part of our next Tech Demo game.
     
    docsavage likes this.
  7. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Useful Forum Links

    We've updated our useful links to help people find things a little easier. They are available here.

    Also, don't forget the manual which is accessible from the "Help" button on the Ship Control Module.
     
  8. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    New content coming in Sci-Fi Ship Controller v1.1.4

    We're busy working on some great new content. This includes areas like:
    • New Ship AI states like "Docking" and "Strafing Run" for attacking ground targets
    • New radar query options for more granular targeting with less code
    • Ship Docking Stations with customisable departure and arrival paths
    • More in-built API functions (less coding for you)
    • More callbacks for API power users who want greater flexibility
     
    docsavage likes this.
  9. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Unity Supported Versions Announcement

    As you may know, Unity have recently dropped support for Unity 2017.4 LTS. The minimum version they now support is 2018.4 LTS.

    The next release of Sci-Fi Ship Controller will support Unity 2018.4.3f1 (LTS) or newer. We will also endeavour to help anyone who is testing on the latest Unity 2020.1 Beta.
     
  10. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Runtime API update

    Here are just a few of the things you can do with our runtime API in version 1.1.4 (coming soon). Almost every day we're adding new API-driven features, allowing you to create rich mission-based games using Sci-Fi Ship Controller.
    • Spawn Non-Player-Character (NPC) friendly or enemy ships
    • Move NPC ships with our built-in Ship Artificial Intelligence (AI) system
    • Move NPC ships with your own AI code
    • Set targets for turret weapons on ships
    • Set targets for surface (ground) turrets
    • Update game scoring whenever a ship is destroyed
    • Fire weapons automatically from code
    • Change the behaviour of a ship as it enters, exits a planet’s atmosphere
    • Enable or disable “Stick To Surface” in code
    • Prevent weapons from firing during certain gameplay
    • Assign or unassign a ship from a squadron
    • Run queries against the Radar API
    • Add or remove Ships and Surface Turrets from radar
    • Make your own gameobjects visible to radar
    • Assign targets to turret weapons and/or AI ships using the radar data.
    • Get an AI ship to follow a path
    • Dock or undock Ships on a Ship Docking Station
    • Have AI ships attack enemy ships or surface turrets
    • Switch the camera module to different ships
    Please let us know if there is something you'd like to do in your game with Sci-Fi Ship Controller. Many of the above items are already available in version 1.1.3.
     
  11. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Ship vibration after adding a new model

    [ISSUE] After I create a new Ship prefab or replace the model on an existing prefab, my ship jitters or vibrates once it gets moving.

    [SOLUTION] Ensure you have a least one Collider on your model. On the Physics tab in Ship Control Module, either turn off Set CoM Manually or click “Reset Centre of Mass”. On the Aero tab, click “Calculate Drag Properties”.

    We have a "Common Issues" section in our manual (click "Help" on any Ship Control Module) which explains how to resolve things in Sci-Fi Ship Controller. Most of the time they are simple configuration changes.

    If you can't find a solution, we're here to help in this forum or on our dedicated Discord channel.
     
  12. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Tip for Re-enabling Ship Camera Module

    Often you will want to pause your game and then un-pause it. This could be when a user wants to bring up a menu or when the user just wants to pause the game. When you go to re-enable the Ship Camera Module the best option is to wait until the next frame. Here is a simple example of how to do that.
    Code (CSharp):
    1. private bool enableCameraNextFrame = false;
    2.  
    3. private void UnPauseGame()
    4. {
    5.     // unpause projectile, effects, ships etc...
    6.  
    7.     enableCameraNextFrame = true;
    8. }
    9.  
    10. private void Update()
    11. {
    12.     if (enableCameraNextFrame && shipCameraModule1 != null) { shipCameraModule1.EnableCamera(); enableCameraNextFrame = false; }
    13.  
    14.     // Other gameplay logic here...
    15. }
     
  13. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Sci-Fi Ship Controller version 1.1.4

    We have submitted this latest version to Unity for review. It should be available from the asset store shortly. Here is what is included:

    [NEW] Surface Turret Module supports effects objects
    [NEW] Turrets have optional inaccuracy
    [NEW] Paths - Snap To Mesh option in SSCManager Editor and runtime API
    [NEW] Locations – Snap to Mesh option in SSCManager (runtime API only)
    [NEW] Radar - query options to include/exclude ship squadrons
    [NEW] Call your custom method when a ship is respawned
    [NEW] Ship API - EnableShipMovement and DisableShipMovement methods
    [NEW] Ship Control Module - Respawning can be paused or resumed via API
    [NEW] Projectiles - guided projectile prefab
    [NEW] Ship Docking Station system [Technical Preview]
    [NEW] AI States: Docking and Strafing Run [Technical Preview]
    [NEW] Docking AI Input Behaviour [Technical Preview]
    [NEW] Added current state stage index for AI, to keep track of what has been completed in an AI state
    [FIXED] Surface Turret Module - NullReferenceException before Turret Pivot X added
    [FIXED] Surface Turret Module - ships targeted by radar do not consider their velocity
    [FIXED] Ship Control Module - PID controller regression
    [FIXED] Ship Control Module - damage regions in the editor are not rotated correctly
    [FIXED] Radar - Locations Visible to Radar may not appear on mini-map when scene starts
    [FIXED] PlayerInputModule - Oculus VR secondary fire button held down not set in editor
    [FIXED] Ship AI Input Module - renamed Pitch Yaw Bias to Roll Bias
    [FIXED] Projectiles - Effects may occasionally not work when colliding with an object
    [IMPROVED] Surface Turret Module - automatically receive damage when a Damage Receiver is attached
    [IMPROVED] Turret precision for ship targets
    [IMPROVED] Turrets automatically stop targeting a ship that has been destroyed
    [IMPROVED] Weapons that have no health, cannot aim, reload or fire.
    [IMPROVED] Player Input Module - Initialise on Awake option
    [IMPROVED] Ship collision damage is now automatically scaled based on the mass
    [IMPROVED] Radar - Ships and Locations can have individual blip sizes
    [IMPROVED] Manual - greatly expanded Runtime and API documentation
    [IMPROVED] Full 3D Flight can now match an up direction passed by an AI Behaviour Output
     
    docsavage and julianr like this.
  14. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Expanding items in the UI

    When Unity updated the Editor UI they modified the behaviour of items like fold out elements. Previously, clicking on the arrow expanded them. Now, you need to click slightly to the right where the text begins. See below.

    upload_2020-4-21_8-26-19.png
     
  15. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Sci-Fi Ship Controller version 1.1.4 is now available in the asset store
     
  16. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Throttle response in Sci-Fi Ship Controller v1.1.5

    upload_2020-4-23_13-27-25.png

    We have added two new items to Thrusters
    • Throttle Up Time
    • Throttle Down Time
    Defaulting to 0, meaning instant response, these allow your thrusters to throttle up or down over a period of time. As thrusters can also be connected to Effects Objects containing particle system(s) and/or sound FX, you will be able to get a very smooth sound and visual transition too.

    These are per-thruster settings so on say a capital ship, thrusters can respond differently based on their purpose.
     
  17. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Brake Flight Assist in Sci-Fi Ship Controller v1.1.5

    upload_2020-4-24_10-2-5.png

    This of Brake Flight Assist as a computer-controlled auto-braking feature. When there is no input in the forwards or backwards directions, the ship will automatically slow down using the thrusters. All aero forces and physical controls still apply.

    The effective Minimum and Maximum Speeds allow you to control when it is operational. When the strength is 0 (the default) it is disabled.

    By setting the min/max speeds to values near zero it can be useful to help bring (and hold) a ship at a complete stand still.
     
  18. tgamorris76

    tgamorris76

    Joined:
    Apr 24, 2013
    Posts:
    292
    How would this affect cruise mode, at higher speeds it wouldnt cut in?
     
  19. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    So, at the moment (in 1.1.5 Beta 1), auto-cruise on the Player Input Module will override the Brake Flight Assist in the forwards direction. Backwards is unaffected by auto-cruise.

    There is a warning that appears in the Player Input Module when both are enabled at the same time. There is also a note about this in the manual. It "might" be possible to restrict auto-cruise from operating at low speeds - however, we've not tried this yet.
     
  20. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Radar Basics Tutorial

    Here is a 5 minute tutorial on the basics of setting up Radar in a scene.

    We also have an extensive API that allows you to, amongst other things, run custom Radar queries, create custom UIs, interact with the Radar System and data in your C# game code.
     
  21. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Docking Station Basic setup
    1. Add a ShipDockingStation script to a gameobject in the scene (this could be a static object like a hanger or a (mother)ship which includes a ShipControlModule component.
    2. Configure one or more Ship Docking Points in the ShipDockingStation. These can be manually configured in the Inspector or can be manipulated in the scene view using gizmos and the Unity Move and/or Rotate tools.
    3. Add a ShipDocking script to the ships that you wish to dock with the ShipDockingStation. NOTE: A mothership does not need a ShipDocking script unless it too will dock with a bigger ShipDockingStation (this scenario will be shown in Tech Demo #2.
    4. A ship has an Anchor Point. This is the location on the ship that docks with the ShipDockingStation’s docking points. Typically, this anchor point would be at the base or bottom of the ship and face downwards so that it could “land” on a Station’s docking point. However, many other orientations are possible so that you could say have a ship dock with an airlock of a space station.
    5. Ships can start in a scene as Docked or Undocked. Ships can also be assigned to a Docking Point on a docking station.
    6. AI Ships can depart from a station using an Exit Path or can enter on an Entry Path. Paths are created in the scene using the SSC Manager and then selected in the ShipDockingStation’s docking points.
    7. Ships can be assigned or unassigned to a station docking point in game code. They can also change their state from Docked, to Undocking, to Undocked, and/or Docking.
    8. Player ships can Dock or Undock using a button configured in the Player Input Module.
    More details can be found in the help manual.
     
    tgamorris76 likes this.
  22. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Sci-Fi Ship Controller version 1.1.5

    The following update has been submitted to Unity for review and should be available shortly from the asset store.

    [NEW] ShipControlModule - Thrusters have optional throttle up/down time.
    [NEW] ShipControlModule - Brake Flight Assist
    [NEW] Radar Basics Tutorial
    [NEW] Tutorials link from ShipControlModule editor
    [NEW] 2 new thruster effects and 1 new thruster sound
    [FIXED] ShipAI Follow Path - Argument is out of range when Path has less than 2 assigned Locations
    [FIXED] Radar - ships may stay on the radar after being destroyed
    [IMPROVED] ShipControlModule - (F)ind button will enable gizmo
    [IMPROVED] ShipControlModule - search filter for thrusters in the editor
     
    julianr likes this.
  23. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Pausing and Unpausing a game with Sci-Fi Ship Controller

    Here are some code snippets from our Tech Demo #2 which is coming soon. These help to explain how a game could be paused and resumed.

    Code (CSharp):
    1. private bool enableNextFrame = false;
    2.  
    3.  
    4. // Update is called once per frame
    5. void Update()
    6. {
    7.     if (enableNextFrame) { UnPauseGame(); enableNextFrame = false; }
    8.  
    9.     // Check Pause/UnPause
    10.     if (Input.GetKeyDown(KeyCode.Escape))
    11.     {
    12.         if (!isGamePaused) { PauseGame(); }
    13.         else { UnPauseGameNextFrame(); }
    14.     }
    15.  
    16.     // other code here
    17. }

    Code (CSharp):
    1. /// <summary>
    2. /// Pause the game by:
    3. /// 1. Pausing the camera
    4. /// 2. Pausing the player ship
    5. /// 3. Pausing all AI squadrons
    6. /// 4. Pausing the Capital Ship if it is escaping
    7. /// </summary>
    8. private void PauseGame()
    9. {
    10.     //Debug.Log("Pausing game at " + Time.time);
    11.  
    12.     // Change UI
    13.  
    14.     // Pause Cameras (assumes the camera is enabled) - this may not always be true...
    15.     // Disable camera movement, making sure to perform camera movement for this frame
    16.     if (shipCameraModule1 != null)
    17.     {
    18.         shipCameraModule1.MoveCamera();
    19.         shipCameraModule1.DisableCamera();
    20.     }
    21.  
    22.     // Pause ships
    23.     // Assume the player ship is always enabled. This could be a problem
    24.     // if the ship is respawning...
    25.     if (player1Ship != null && player1Ship.IsInitialised) { player1Ship.DisableShip(false); }
    26.  
    27.     // If this is the first time paused, reserve enough capacity for all the AI Ships
    28.     int numSquadronAShips = squadronAShips == null ? 0 : squadronAShips.Count;
    29.     int numSquadronBShips = squadronBShips == null ? 0 : squadronBShips.Count;
    30.     int numSquadronCShips = squadronCShips == null ? 0 : squadronCShips.Count;
    31.     int numSquadronDShips = squadronDShips == null ? 0 : squadronDShips.Count;
    32.  
    33.     if (pausedAIShips == null) { pausedAIShips = new List<ShipAIInputModule>(numSquadronAShips + numSquadronBShips + numSquadronCShips + numSquadronDShips); }
    34.  
    35.     AddSquadronToPausedList(numSquadronAShips, squadronAShips);
    36.     AddSquadronToPausedList(numSquadronBShips, squadronBShips);
    37.     AddSquadronToPausedList(numSquadronCShips, squadronCShips);
    38.     AddSquadronToPausedList(numSquadronDShips, squadronDShips);
    39.  
    40.     // If the Capital Ship is moving, need to also disable it
    41.     if (demoSectionIndex == 4 && enemyCapitalShip != null && enemyCapitalShip.IsInitialised && enemyCapitalShip.ShipIsEnabled())
    42.     {
    43.         enemyCapitalShip.DisableShip(false);
    44.     }
    45.  
    46.     // Pause game music (if any)
    47.  
    48.     AudioListener.pause = true;
    49.  
    50.     // Pause Projectiles and effects
    51.     sscManager.PauseProjectiles();
    52.     sscManager.PauseEffectsObjects();
    53.  
    54.     Time.timeScale = 0f;
    55.  
    56.     isGamePaused = true;
    57. }

    Code (CSharp):
    1. /// <summary>
    2. /// Set the game to be unpaused during the next frame.
    3. /// When timeScale has been set to 0, ships and camera modules
    4. /// will error with NaN if we attempt to set the timeScale to
    5. /// non-zero and then immediately try to calculate moment and
    6. /// force.
    7. /// </summary>
    8. private void UnPauseGameNextFrame()
    9. {
    10.     Time.timeScale = 1f;
    11.     enableNextFrame = true;
    12. }
    13.  
    14. /// <summary>
    15. /// Unpause the game by:
    16. /// 1. Unpausing the player ship
    17. /// 3. Unpausing all AI squadrons
    18. /// 4. Unpausing the Capital Ship if it is escaping
    19. /// 5. Unpausing the camera
    20. /// NOTE: We don't want to do this in the same frame
    21. /// that timeScale was changed from 0 to say 1.0.
    22. /// </summary>
    23. private void UnPauseGame()
    24. {
    25.     enableNextFrame = false;
    26.  
    27.     // Unpause projectiles and effects
    28.     sscManager.ResumeProjectiles();
    29.     sscManager.ResumeEffectsObjects();
    30.  
    31.     // Unpause ships
    32.     if (player1Ship != null && player1Ship.IsInitialised) { player1Ship.EnableShip(false, false); }
    33.  
    34.     int numPauseAIShips = pausedAIShips == null ? 0 : pausedAIShips.Count;
    35.  
    36.     for (int i = 0; i < numPauseAIShips; i++)
    37.     {
    38.         ShipAIInputModule aiShip = pausedAIShips[i];
    39.  
    40.         if (aiShip != null && aiShip.IsInitialised)
    41.         {
    42.             ShipControlModule ship = aiShip.GetShipControlModule;
    43.             if (ship != null && ship.IsInitialised)
    44.             {
    45.                 if (ship.IsRespawning) { ship.ResumeRespawning(); }
    46.                 else { ship.EnableShip(false, false); }
    47.             }
    48.         }
    49.     }
    50.  
    51.     // If the capital ship was taking off or escaping, re-enable it
    52.     if (demoSectionIndex == 4 && enemyCapitalShip != null && enemyCapitalShip.IsInitialised)
    53.     {
    54.         enemyCapitalShip.EnableShip(false, false);
    55.     }
    56.  
    57.     // Enable to the camera
    58.     if (shipCameraModule1 != null) { shipCameraModule1.EnableCamera(); }
    59.  
    60.     // Unpause game music (if any)
    61.  
    62.     AudioListener.pause = false;
    63.  
    64.     // Change UI
    65.  
    66.     if (numPauseAIShips > 0) { pausedAIShips.Clear(); }
    67.     isGamePaused = false;
    68.  
    69.     //Debug.Log("Resumed game at " + Time.time);
    70. }

    In start or awake you will also need the following:

    Code (CSharp):
    1. isGamePaused = false;
    2.  
    3. // Get or create the SSC manager components
    4. sscManager = SSCManager.GetOrCreateManager();
     
    Last edited: Apr 29, 2020
  24. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Thruster FX updates

    In Sci-Fi Ship Controller we are giving you even more control over thrusters. In version 1.1.6 you will be able to change when thruster effects are active based on the velocity of the ship.

    upload_2020-5-15_15-6-53.png

    For example, in our Tech Demo 2 (coming soon) we have a huge 1 km long Capital Ship that uses the Physics Based model. Once the ship has lifted off and starts to move forwards the effects for the lift-off thrusters are phased out while the forward thruster effects are still in use.

    To do this, we go to the 4 lift-off thrusters, enable "Limit FX on Z Axis" and set the Min/Max FX on Z Axis. Values are in metres per second. These values can be adjusted in real-time in the editor to get a feel for what values work best.
     
    Last edited: Jun 5, 2020
    julianr and Blackbox514 like this.
  25. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Screen shots of our next Sci-Fi Ship Controller fully playable Tech Demo are starting to emerge. You can see the first one here.

    Everything you see in the scene (including what's in the citadel) will be included in the next major release of Sci-Fi Ship Controller.
     
    julianr and Blackbox514 like this.
  26. Blackbox514

    Blackbox514

    Joined:
    Apr 8, 2016
    Posts:
    22
    Hi folks,

    First off, great job communicating what you are working on in upcoming releases as well as your continued efforts keeping this forum active. This was a deciding a factor in my purchase.

    I do however, have a few questions regarding some use-cases I have for my project.

    1. I'm wondering if this asset provides some sort of "floating origin" functionality to circumvent the annoying floating point precision issues for larger map sizes?

    2. Is it possible for turrets to be configured in an "upside-down" configuration so that they can be mounted underneath a ship?

    3. Can turrets also fire "laser beam" type weapons that cause damage over time?

    4. Can turrets also fire missile-type projectiles from something like a player controlled fighter jet? I'm asking as I foresee potential issues if the turret moves before the missile clears the silo so I'm wondering if something like this has ever come up before.

    Looking forward to taking the asset out for a spin later this week.

    Cheers!
     
    julianr and sstrong like this.
  27. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    We haven't implemented any floating point functionality at this point as it is generally game-centric although we're always happy to research and implement features that help our customers. Do you have a particular scenario in mind for your game?

    Here is a quick example of turrets configured to be upside down. The in-editor visuals for turning and firing arc are in the current beta but are not required to make this work.
    upload_2020-6-3_14-38-28.png

    We don't have a "laser" weapon type as such (at the moment) but you can simulate most of this with something like the ProjectileBasic5 prefab and changing weapon reload time. If we did have such a weapon type, how do you envisage it working? i.e. what options would you like?

    To configure a missile-type projectile, create a new projectile prefab and select "Guide to Target" and either use our radar system and/or your own guidance code via our API which includes a callback method.

    upload_2020-6-3_14-44-34.png

    Check out the API runtime section in our manual.
     
    Blackbox514 likes this.
  28. Blackbox514

    Blackbox514

    Joined:
    Apr 8, 2016
    Posts:
    22
    Thanks for the quick response!

    1. Re: floating-point precision
    I think my question should be rephrased to be more generic. If my vehicle is represented by a 1 meter cube, how large can the map be in meters before floating point precision becomes an issue? For example, in the case of a single-scene scenario, if I have two planes dog-fighting against one another, how far out can I go before precision becomes an issue for physics&collisions?

    2. Re: Upside-down turrets
    Great!

    3. Re: Beam weapons
    The behaviour I'd like is something along these lines:
    A. If Enemy Target is within range and within firing-arc
    B. Fire the laser animation (ie fade in the beam or have it grow over time from the muzzle point)
    C. While looping the laser "on" animation, keep aiming at the current target until some condition or event is triggered (ie. the energy reserves are depleted or gun overheats, current target is destroyed or moves out of range)
    D. Turn off laser and play laser "off" animation

    Ideally, I don't want the turret to create new laser beams every frame, although I supposed with clever pooling or using dots maybe the projectile creation penalty isn't much of a problem anymore.

    4. Re: missiles
    Great. I've run into problems launching missiles from moving vehicles and turrets in the past where the projectile intersects the launchers geometry. I solved the problem by essentially first launching the projectile in local space of the parent and then switching it to world space after it clears the launcher after 1 or two seconds.

    Cheers!
     
  29. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    1. There are many, many contradicting ideas about this issue that has been in Unity for a long time. We have a test environment (Tech Demo 2) which is 64 km x 64 km. Most of the action happens within 15 km of the origin and we've not seen too many issues to-date.
    The most common "solution" is to move all the objects as the player travels around the game world. This could be via dynamic streaming the content around the origin or actually moving the objects in the scene (there are numerous sample scripts around that do this). In Sci-Fi Ship Controller you'd also need to tell ships, projectiles, docking stations, and cameras that this has happened. We currently have some methods and variables that could help with this however we probably should create some dedicated API methods for this purpose. If you decide to go down this path and don't mind doing some testing we're happy to create the appropriate API methods.

    3. I've added Beam Weapons to our roadmap.
     
    Blackbox514 likes this.
  30. Blackbox514

    Blackbox514

    Joined:
    Apr 8, 2016
    Posts:
    22
    1. Yes, the 15KM limit is consistent with what I've experienced with Unity in past projects. For the time being, I'll start by integrating the package into one of the projects I'm working on and see how it goes.

    3. Excellent!
     
  31. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    We recently received an email from someone claiming Sci-Fi Ship Controller was “similar to unity standard assets flying ships”. Just to be clear, here are some of the features included in the current version of Sci-Fi Ship Controller:
    • Advanced physically-accurate configurable flight dynamics
    • Realistic aerodynamic simulation
    • Flight Assist options for arcade mode
    • Comprehensive Ship AI system
    • Radar system
    • Location and Path system with editor
    • Visual in-editor experience for ship setup and configuration
    • Weapons and Turrets
    • Projectile system including support for pooling and DOTS
    • Customisable guided projectile system
    • Weapon auto-targeting using radar
    • Configurable thrusters and effects support
    • Ship Docking system
    • Extensive API for integration with your own code
    • Playable demos
    • Extensive Input System including support for New Unity Input system, Rewired, Oculus, and Vive.
     
    Last edited: Jun 5, 2020
    julianr, docsavage and Blackbox514 like this.
  32. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    For built-in render pipeline users, we're adding support for a second camera in our Celestials demo script. This will be available in Sci-Fi Ship Controller v1.1.6.

    While we were developing a point of view camera (to display on a second monitor if you have one) for the Tech Demo 2 scene, we wanted to be able to display stars in the background on both monitors.

    upload_2020-6-6_14-27-50.png

    There is also a way to initialise the second camera at runtime (which we will do in Tech Demo 2).
     

    Attached Files:

    docsavage and julianr like this.
  33. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Looking forward to the v1.1.6 update - keep up the good work! :)
     
    sstrong likes this.
  34. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Optional Muzzle FX coming in Sci-Fi Ship Controller v1.1.6

    upload_2020-6-11_12-17-15.png
     
    Blackbox514, docsavage and julianr like this.
  35. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Some people have asked about keeping a player ship inside the area of a game. One approach we've taken in Tech Demo #2 (which will be included in the next major release), is to use a simple cube or boundary. Here is a code snippet.

    Code (CSharp):
    1. public MeshFilter gameplayArea = null;
    2. public ShipControlModule player1Ship;
    3.  
    4. private Bounds gameplayAreaBounds;
    5.  
    6. void Start()
    7. {
    8.     // Set up the game play area based on the area defined by a simple cube in the scene
    9.     // The cube should have the renderer and collider disabled. The collider remains so that
    10.     // it can be visualised in the editor for design purposes.
    11.     if (gameplayArea != null && gameplayArea.mesh != null)
    12.     {
    13.         // Typically we'd use the MeshRenderer bounds but that is not available
    14.         // so will need to use the mesh and the scaled value
    15.         gameplayAreaBounds = gameplayArea.mesh.bounds;
    16.         // This works because we have a 1x1x1 cube
    17.         gameplayAreaBounds.size = gameplayArea.transform.localScale;
    18.     }
    19.     else
    20.     {
    21.         gameplayAreaBounds = new Bounds();
    22.     }
    23. }
    24.  
    25. // Main gameplay loop
    26. void Update()
    27. {
    28.     // Check if player is outside gameplay area
    29.     if (!gameplayAreaBounds.Contains(player1Ship.shipInstance.TransformPosition))
    30.     {
    31.         // take action - like display a message
    32.         // or call player1Ship.DisableShip(false) etc.
    33.     }
    34. }
     
    Blackbox514 likes this.
  36. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Nice! A bit of ship flying and rotation code in there to turn it around would be pretty cool.
     
  37. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Player Input Module Override (axis) in Code

    This is a new feature coming in Sci-Fi Ship Controller v1.1.6. It is the result of a feature requested by a customer. Sometimes you want the power and flexibility of the Player Input Module (including support for New Input System, Rewired, VR setups etc) but you want to take control of a particular axis.

    So, we let you override one or more axes in your own C# code. There is a check box for this in the Player Input Module or you could even set that too in your code. We have included a "Sample Input Override" script (Demos\Scripts folder) that will get you started if you need that feature.

    In this setup included here, we've also set the "Minimum Effects Rate" for the forward thrusters so that as the player manoeuvres around the thruster effects will not just flicker on and off as the override code makes small speed adjustments.

    upload_2020-6-12_14-14-50.png
     
    Blackbox514, Solkitte and julianr like this.
  38. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    In version 1.1.6 we're adding a sample script to help you aim weapons at the mouse position. The script is SampleAimWithReticle.cs and will be in the Demo\Scripts folder. There is already an API included that lets you adjust the fire direction of fixed weapons (if you need it), however this goes one step further and supplies most of the background coding to support that.

    This script uses the ShipDisplayModule (aka HUD) which is in Technical Preview - more on this later.

    upload_2020-6-17_17-25-37.png

    * The screenshot is from our Tech Demo #2 which will be included with the next major release of Sci-Fi Ship Controller.
     
    Blackbox514 and julianr like this.
  39. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    SSC Manager - cannot add location or path

    We have had a report of not being able to add a Location to the SSC Manager in the scene in some versions of Unity. You will also see a NullReferenceException in the Unity console window.

    Workaround - (< version 1.1.6) Add SSC Manager to the scene 3D Object, Sci-Fi Ship Controller, SSC Manager. Then run the scene with Maximise On Play enabled in the Game view.

    Fix - Apply 1.1.6 Beta 5a or newer
     
  40. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    The first version of our Ship Display Module (aka Heads-Up Display or HUD) is now ready for Beta testing for those in the program (v1.1.6 Beta 5c or newer).

    Our design philosophy is to create a core capability backed by a great and easy to use API. This will allow you to extend the system and integrate it with your own game code. As we receive feedback from you, like other things in Sci-Fi Ship Controller, we'll add more features.

    As we have discussed before in this forum and on our Discord channel, visual aspects of a game are very subjective. Wherever possible, we want to leave the visual creativity up to you and your team. That being said, we'll always endeavour to provide you with placeholder assets and visuals to get you started. Our HUD solution is no exception.

    We have also provided decent Editor and API documentation in the manual for the Ship Display Module.
     
    julianr likes this.
  41. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Sci-Fi Ship Controller v1.1.6

    The latest version includes the following and should be available in the Asset Store shortly.

    [NEW] 2 new thruster effects
    [NEW] Thrusters - Effects can be enabled based upon ship velocity
    [NEW] Thrusters - Effects can enabled or disabled via API for different performance levels
    [NEW] Ship and Surface Turrets - in editor visuals for turning and firing arc
    [NEW] SurfaceTurretModule - callback for when turret is destroyed in API
    [NEW] ProjectModule - Muzzle FX Object option (particle system and/or sound)
    [NEW] Player Input Module - ability to override an axis in code (sample script included)
    [NEW] Ship Display Module (HUD) with API in technical preview
    [FIXED] ShipDockingStation - scene is not updated when all docking point gizmos are toggled
    [FIXED] SSCManager - NullReferenceException when adding new Path or Location
    [IMPROVED] Path gizmos are enabled when Activate for editing is clicked in the editor
    [IMPROVED] Effects on included Ship prefabs have less performance overhead
    [IMPROVED] Ship AI Input Module - debugger can display velocity in km/h and m/s
    [IMPROVED] Celestials - demo script supports a second camera
    [IMPROVED] Ship Camera Module - suggest using Target Rotation if Aim To Target is selected
    [IMPROVED] HideCursor demo script is now New Input System aware
    [IMPROVED] Added Ship API methods to the manual
     
    docsavage, tgamorris76 and julianr like this.
  42. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Nice! Can't wait to try this out.
     
  43. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Going to be using this asset soon, just creating the space environment for it. Can AI turn around do a flyby and blast you with a laser or rocket? Or do they just follow a path - wondering whether or not to add in some mechanics for this - unless you already have it implemented or planned?
     
  44. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Absolutely. The Ship AI system is very powerful and customisable.

    There is an extensive description of the AI system in the manual. This includes a chapter devoted to Ship AI System and a runtime and API reference subsection called "Ship AI Input Module API Methods and Properties".

    Additionally, there are chapters and API reference sections on using the SSC Radar system which can be used with AI Ships.

    There is also a 3-part tutorial in this forum by David that begins here.

    In our Tech Demo #2 scene (which is coming soon) we have friendly AI ships doing flybys on enemy ground turrets (which are also AI and radar controlled, firing back). Enemy ships are attacking the friendly ships and vis versa.
     
    julianr likes this.
  45. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Awesome thanks!
     
  46. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Unity 2019.4 and 2020.1 compatibility

    We've seen some editor issues in Unity 2019.4 or newer. Essentially Unity have changed how inspectors interact with dialog boxes. If you can't seem to delete an item in a list, this is most likely the cause. We have a patch.

    You need Sci-Fi Ship Controller 1.1.7 Beta 4c or newer. We'll be pushing out a new version to the Asset Store soon. If you don't have access to the Beta program and need the patch before it is released, let us know.
     
    Last edited: Jul 4, 2020
    julianr likes this.
  47. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Nice! Thanks for this - I upgraded my project from 2017.x to 2019.4 the other week :)
     
  48. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Ship Docking

    We've done a bunch of updates to our Ship Docking code. We're also working on a tutorial so that you can get started using Ship Docking Stations. Here is what is in the latest beta (1.1.7 Beta 5d).

    [NEW] Ship Docking - editor runtime debugging option
    [FIXED] Ship Display Module - calling Initialise twice may result in incorrect HUD layout
    [FIXED] SSCManager.Initialise - could not get entities World
    [FIXED] SSCManager - cannot delete locations or paths in U2019.4+
    [FIXED] ShipDockingStation - NullReferenceException when adding docking point and DOTS is enabled
    [FIXED] ShipDocking - adapter should not remain selected when Gizmo is turned off
    [FIXED] ShipDocking - ship may not dock with a ship docking station
    [FIXED] ShipControlModule - cannot delete wing, control surface, damage region or weapon in U2019.4+
    [FIXED] ShipDisplayModule - cannot delete reticles in U2019.4+
    [IMPROVED] Ship Docking Station - unselected docking points are slightly transparent
    [IMPROVED] Ship Docking Station - new docking points are automatically selected in the scene
    [IMPROVED] Ship Docking Station - docking and undocking
    [IMPROVED] Ship AI Input Module - roll bias
     
    julianr likes this.
  49. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Here is a really simple docking manoeuvre using Sci-Fi Ship Controller. Changes required for this will be in v1.1.7.



    Sorry for the placeholder assets.
     
    julianr likes this.
  50. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Version 1.1.7 is now live in the Asset Store.
     
    julianr likes this.