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

Template Space Combat Kit (VSXGames) [RELEASED]

Discussion in 'Tools In Progress' started by Billy4184, Jul 14, 2015.

  1. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,605
    Rewired can handle throttles on recognized controllers in two ways:
    1. Throttles return a value of 0 when fully disengaged and +1 when fully engaged.
    2. Throttles can be set to return values from -1 to +1 if the option is set.

    See Throttle Calibration Mode.

    To detemine what's happening with your throttle, look at the live value being returned by Rewired for the Action that is mapped to it using Debug Information. If it's returning a 0 - 1 value and the game code is expecting a -1 to 1 value, change the Throttle Calibration Mode setting.
     
    Billy4184 likes this.
  2. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I have never installed the CH Products software. Just used CH controllers right out of the box. Plugged it and it found the right drivers automatically in Windows and installed those.

    The only thing for the CH Products you would have to map the slide (in flight pedals) to the same thing that twist stick is currently mapped to. Since CH Products and the Warthog are not twist sticks and require pedals for best results.
     
  3. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    1,556
    Here's an idea that I'll try to implement over the week-end, but maybe someone already has done this and can save me some time: SCK is great for controlling vehicle, but space combat may get up close and personal. That's why I also need to be able to use a first-person controller (for example when after exiting a ship I want to walk across the hangar bay, and enter another ship).

    Looking at the gameAgent script I see that the game agent does not track the agent's (player's) position at all, it merely links to the vehicle the agen is in. This means that the game agent itself does not provide spatial information relating to the contolled player unless you are in a vehicle, and at that time, you track the vehicle's position, not the players. So, to use an FPC, such a controller first must be converted into a vehicle. That should be easy enough by adding the relevant scripts - so has anyone already done this, r even better: is there easy integration for this in SCK that I have overlooked?

    Cheers,
    -ch
     
  4. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    You have the right idea, that is the design I had in mind. The vehicle component is a link to anything which can move around, carry modules and damage/get damaged etc.

    The kit is still just a space kit, I have not expanded it yet as a more general vehicle kit. But if I were you, I would start by creating a humanoid 'vehicle', add module mounts in the hands for weapons, create a script for movement that implements the IVehicleController interface, and has health fixtures for damage etc. You could also write a script that stores this humanoid 'vehicle' as only enterable by the player, and which enters it automatically when the player exits the ship.

    If you have specific issues or questions, I would be glad to give explanations and recommendations.
     
  5. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    Hey,

    I am interested in this asset, does it work in VR? I mean, no wonky stuff with billboards and the like and weird camera tricks?

    If it works fine with my Vive you have a sale. :)
     
  6. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    It should work fine. I don't have a Vive or Rift, but I have implemented the UI (including menus and all parts of the HUD) in world space to make it VR compatible.

    The HUD is shown on a separate camera (to avoid any clipping issues for example when using exterior view) but it is easy to remove it and render with only the main camera if you want to.

    If you do purchase and have any problems please contact me through my support email I will gladly help you sort them out.
     
  7. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    1,556
    Well, there is some wonky billboarding/normal stuff with the Vive, at least with some of the HUD stuff in the demo scene. One I get around looking at that I can say more (Billy: I did see your request for more info, I just didn't get around to look at it. This is with Vive).
     
    Billy4184 likes this.
  8. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    You got yourself a customer. :)

    Ok, first question: How do I use my Extreme 3d Pro? I don't have rewired, do I need a newer version?

    Edit: So I just bought rewired also, it was on the list anyway. :) Where do I find the templates? I downloaded your asset from the store but I can't seem to locate the rewired templates.

    I tried downloading the Rewired integration package from the link a couple of pages ago but that does not seem to work anymore.
     
    Last edited: Dec 7, 2018
  9. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    The templates are in the Rewired Input Manager. See this URL below for a screen shot ... look for step 10 .. "10. Now let's create a Joystick map. Click "Joystick Maps" in the navigation bar."

    http://guavaman.com/projects/rewired/docs/QuickStart.html

    For the Space Combat Kit - Rewired integration check out this message post and the associated file that is attached.

    https://forum.unity.com/threads/space-combat-kit-vsxgames-released.340962/page-15#post-3917341
     
    Billy4184 likes this.
  10. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    Yeah that file gives an 500 internal server error, that's the one I tried.
     
  11. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I get the same error as you. I guess the Space Combat Kit developer will have to fix that link for his Rewired integration.
     
  12. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    Glad it's not my machine. :) Thanks anyway.
     
  13. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    Thanks for purchasing! Sorry about the broken link, here's a dropbox link you can use. My website is a bit of a construction site at the moment as I'm preparing it for marketing of my upcoming game.

    When you can get around to it, I'd appreciate some info on the problem!
     
    Boemak likes this.
  14. brettmoody

    brettmoody

    Joined:
    Jun 25, 2015
    Posts:
    8
    How well does this play with Behavior Designer? Can most behaviors made in Behavior Designer be used by the AI space ships?
     
  15. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    At the moment, there's a Behavior Designer integration for the AI provided in the kit.

    The possibilities for creating different behaviors for your game are very flexible. The way input works in the game is that:
    1. The GameAgent script (which represents the player or AI) is separate from the vehicle, and can enter and exit vehicles.
    2. The GameAgent has access to different control scripts for different vehicles (which are stored in child transforms).
    3. When the Game Agent enters a new vehicle, it matches the vehicle type with one of the control scripts, and activates that control script.
    In this way, you can write an AI script (or player input script for that matter) whichever way you like, and simply by making it a control script (i.e. implementing the IVehicleInput interface) and setting the Vehicle Control Class variable to the type of vehicle it is for, the script will be run upon the Game Agent entering the vehicle.

    You still must still create the nodes for Behaviour Designer of course, by writing classes that extend Designer's Action base class for example.
     
  16. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    I got it working, very awesome. :) Thanks.
     
    Billy4184 likes this.
  17. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    For anyone who uses this with VR is there anything I need to keep a look out for? Or can I just put in the SteamVR camera rig and hook it up to the ship?
     
  18. brettmoody

    brettmoody

    Joined:
    Jun 25, 2015
    Posts:
    8
    Hi Billy,
    Where can I find the BehaviorDesigner integration? The Unity page is not working.
     
  19. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
  20. brettmoody

    brettmoody

    Joined:
    Jun 25, 2015
    Posts:
    8
    Hi Billy,

    I am getting the following errors in the BD integration:


    upload_2018-12-8_23-4-46.png
     
  21. brettmoody

    brettmoody

    Joined:
    Jun 25, 2015
    Posts:
    8
    How could I go about fixing these?
     
  22. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    I fixed the package so please re-download. Let me know how it goes.
     
  23. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    How would I go about making my spaceship drift? I've tried reducing the drag but that also makes the main engine less efficient because you have too much momentum for it to really make a difference to your direction, making steering too difficult. The drifting part does work pretty well though.

    Do I need to add extra thrusters or something?
     
  24. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    I'm not sure I understood the question. If you want your ship to drift, well it's not going to be too responsive to changes in orientation, because that's the whole point of drifting.

    If you want to drift temporarily, then I suggest binding a key to a change in the rigidbody's drag coefficient.
     
  25. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    Yeah I am wondering where I can get the throttle input inside the engine script so that I can set the drag lower when there is no trust input.

    I am guessing when there is no input from the joystick, SubsystemTotalPower is zero?

    Edit: They are currentTranslationInputs it seems.

    Edit2: It works, I created a bool "CanDrift" and if the CurrentTranslationInput.z is 0 I set the rigidbody to a lower drag. When you add thrust it goes back to the default.

    Pretty nifty.
     
    Last edited: Dec 9, 2018
    Rujash and Billy4184 like this.
  26. rgrlee71

    rgrlee71

    Joined:
    Sep 11, 2012
    Posts:
    37
    Hi,

    This asset looks great and I want to buy it. Does it work with Unity 2018.3? Thanks.
     
  27. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    I am running it on 2018.2.something, if 2018.3 is not that different it will probably be fine.

    Assumptions though. :)
     
    Billy4184 likes this.
  28. ArkadiuszR

    ArkadiuszR

    Joined:
    Jan 21, 2016
    Posts:
    22
    Can i get demo? Even standalone? Demo on assetstore WEBGL not work. :(
     
  29. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    I've uploaded for 2018.1, I don't see any reason why it wouldn't be fine in 2018.3. If there's any issue of course I will fix it for you.

    Sorry about that, the asset store demo link should work fine now. Let me know if you have any questions!
     
  30. urancle

    urancle

    Joined:
    Mar 28, 2018
    Posts:
    8
    Short question: (Only about the Radar/HUD part)
    Is it possible to "track" targets only by heading/bearing? I'd need to display a directional course to targets in very far distance (in real world coordinates, but not degree-like WGS84). Unity does not like working with such huge numbers and a reduction is not completely possible since it should be a location-independent feature.
    So could i use this asset somehow to show a target only by its direction, without a GameObject?
     
  31. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    Hi, my suggestion would be to use a gameobject, and relocate it relative to the player every frame. Let's say the direction is (0, 0, 1), then you would place the gameobject at <player position> + (0, 0, 1) * 20000 or something like that, and set ignoreTrackingDistance to True on the trackable script. Does that make sense?
     
    urancle likes this.
  32. urancle

    urancle

    Joined:
    Mar 28, 2018
    Posts:
    8
    Yeah it does, thanks for your input!
     
  33. urancle

    urancle

    Joined:
    Mar 28, 2018
    Posts:
    8
    So i just tried setting a empty scene up with Vehicle Combat Radar.
    I followed the instructions in the PDF and did:
    - Added Main Camera as "Player"
    - Added Cube as trackable target
    - Dragged RadarSceneManager.prefab into scene
    - Dragged DemoRadar.cs to the Main Camera
    - Dragged DemoTrackable.cs to Cube
    - Checked "Link to UI" in DemoTrackable.cs on Main Camera
    - Added HUDVisor.prefab to scene

    But it does not work, i get the no errors but the cube is not tracked. What am i missing?
     
  34. Sr-Liermann

    Sr-Liermann

    Joined:
    Jan 7, 2015
    Posts:
    68
    Hello, how are you Billy4184?
    Well what you think about capital ship?
    I'm would buy your kit, but need some info about the capital ship and multiplayer.
    It would be nice if we can control a capital ship in battle and use it for fight.
     
    Last edited: Dec 17, 2018
  35. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    Hi, the HUDVisor prefab needs the settings to be updated.

    1. If you're using world space HUD (the World Space UI value is checked in the inspector of the HUDVisor), then make sure that the canvas of the HUDVisor is set to World Space.

    2. Also if you're using a world space HUD, the HUDVisor prefab needs to be parked in front of the camera and scaled down to approximately fit the screen (doesn't need to fit exactly).

    3. Make sure that the UI Viewport Coefficients on the inspector of the HUDVisor are X=1 and Y=1.

    That should do the trick. Let me know how it goes.

    Note that many improvements in the HUD went into the space kit (which includes the radar) but not yet into the Vehicle Combat Radar package. I will fix that this week.
     
  36. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    Hi! The capital ship demo is delayed, but it's still coming.

    Multiplayer is something I am not going to definitively support right now. I have a 'pre-alpha' version that basically functions that everyone is welcome to, but it's buggy and unfinished. I may work on it here and there, but it's not on the roadmap right now. The main reason is that multiplayer is very complicated compared to singleplayer and especially difficult to debug, and I cannot provide the level of support that I'm providing right now to the kit if it involves multiplayer.
     
  37. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    Hey everyone, if you've been waiting to buy the Space Combat Kit on sale, now is the time! It's 50% off on the Unity Asset Store Holiday Sale.
     
    JFI66 likes this.
  38. vamky

    vamky

    Joined:
    Aug 9, 2014
    Posts:
    70
    Hi:
    I got this error message after importing the package into unity 2018.3 official release:

    Assets/SpaceCombatKit/PostProcessing/Editor/PropertyDrawers/MinDrawer.cs(6,34): error CS0104: `MinAttribute' is an ambiguous reference between `UnityEngine.MinAttribute' and `UnityEngine.PostProcessing.MinAttribute'
     
  39. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    Hi, this seems to be a known issue with Unity.

    Have you tried going to the script that produces this error, and putting UnityEngine.PostProcessing before the MinAttribute?
     
  40. coder168

    coder168

    Joined:
    Jun 10, 2015
    Posts:
    3
    Hi,
    I have a few questions about Space Combat Kit:
    1. Does Space Combat Kit include complete source code?
    2. What kinds of the documents available for Space Combat Kit? I can see there is a link of video tutorials in its asset store description. Are there other documents/user guides available somewhere?

    Waiting for the answers for considering purchase, thanks!
     
    Last edited: Dec 18, 2018
  41. vamky

    vamky

    Joined:
    Aug 9, 2014
    Posts:
    70
    Yeah, that solved the problem, thanks!
     
    Billy4184 likes this.
  42. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    Hi!

    1. Yes, no plugins, all code included.

    2. The kit comes with a User Guide, and here is full code documentation. There is also a very simple demo scene included which helps you to understand how to set up a player and a spaceship, and fly around in the scene.

    Let me know if you have any more questions!

    -----

    Grab the Space Combat Kit now at HALF PRICE on the Asset Store Holiday Sale!
     
    Last edited: Dec 19, 2018
    JFI66 likes this.
  43. coder168

    coder168

    Joined:
    Jun 10, 2015
    Posts:
    3
    Thanks for reply. I just buy this kit, but can not find its user guide. Could you tell me where the user guide can be located?
     
    Last edited: Dec 19, 2018
  44. Sr-Liermann

    Sr-Liermann

    Joined:
    Jan 7, 2015
    Posts:
    68
    Hello, can you post your road map to this kit?
    I had tested your demo webgl, and i see that the enemies AI never attack, only just flying.
    Any plan to do add a "Landing" Option that can allow we a make space stations?
    And Mining Option To Monetize Game Too?

    And the webgl demo scene come in the kit how a example?

    The Weapons are only fixed or have a option to use turrets that rotate to seek target?
     
    Last edited: Dec 19, 2018
  45. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    1,556
    I've now spent some time trying to get the HUD to work with VR. There are a cuple of observations with things that don't work.

    First, after reading the (sparse) docs and then watching your tutorial video on HUD (at least the parts that currently exist :)) and finally replicating them to get my own HUD up and running I have gathered the following (all based on the QuickStartScene in the asset):

    It seems that the HUD prefab, after instancing is positioned at the same position as the camera location. Since e.g. the VIVE camera rig locates the camera on the floor (at 0,0,0) and then, when you wear the HMD that gets lifted to 1.3m (sitting in a chair), for a HMD I need to lower the interior cam position by 1.3 meters (this is below the ship). This means that in order to make the HUD work I need to change the position of the individual HUD elements (cockpit, hologram, radar) inside the prefab. It also means that multiple camera positions in the same cockpit (pilot/copilot config) requires two differently set up HUD prefabs. It would be better if the kit allowed for a central HUD position just like camera positon

    Above is easy enough to fix - much more problematic is the radar blip itself, which - while it appears to be correct in scene view is completely off in game view / HMD. It seems to wander about with the HMD movement (if I look up, the blip goes down twice as fast, if I look left, the blip moves to the right at double speed), making me believe that there is something wrong with the canvas (world space) projection (see images below. Scene view is correct, Game view has the red blip wander about just because I move the HMD, and the blip is at the wrong location).

    upload_2018-12-19_14-41-16.png

    upload_2018-12-19_14-39-32.png

    Same issue with all target informtion (brackets, distance) that don't show up at all (haven't been able to find them yet).

    Thanks for any pointers.
     
  46. EmpireStudios

    EmpireStudios

    Joined:
    Oct 23, 2018
    Posts:
    24
    Errors on import: Assets/SpaceCombatKit/PostProcessing/Editor/PropertyDrawers/MinDrawer.cs(11,39): error CS0104: `MinAttribute' is an ambiguous reference between `UnityEngine.MinAttribute' and `UnityEngine.PostProcessing.MinAttribute'
     
  47. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    Hi, sorry about that! Seems like it was not included in the last upload. Here it is!

    I've been working on a better one for a while now and will post it up within the next 24hrs.

    -----

    Grab the Space Combat Kit now at HALF PRICE on the Asset Store Holiday Sale!
     

    Attached Files:

    Last edited: Dec 19, 2018
    JFI66 likes this.
  48. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    Hi, this is an error with Unity's post processing package which has been discussed on other threads. It can be fixed by putting changing MinAttribute to UnityEngine.PostProcessing.MinAttribute in the offending script. I will fix this for the next update, although this is something Unity should have fixed themselves.

    -----

    Grab the Space Combat Kit now at HALF PRICE on the Asset Store Holiday Sale!
     
    Last edited: Dec 19, 2018
    JFI66 likes this.
  49. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,008
    Hi, I just tested the demo here:

    http://vsxgames.com/Demos/SpaceCombatKit/index.html

    The enemies definitely attack the friendly ships as well as the player. Note that the enemies are not the ones that appear in green target boxes (who are your teammates) they are the ones in red who fly in when you press the Backspace key.

    Can you describe in more detail what you are looking for with a 'landing option'? Do you mean some kind of automated landing animation?

    Mining is not currently included in the kit, but I might add it along with a Cargo subsystem at some point. The kit definitely would benefit from an inventory system.

    I don't understand, please explain what you mean here.

    The kit features a Gimbal Controller, which was made for gimballed weapons, and is also used for the 'look around' camera mechanic. This gimbal can rotate incrementally, or track a world position in space, with whatever angle constraints you like. I can help you set up a gimballed weapon if you have any trouble with it.

    I will post a roadmap at the end of this week.

    -----

    Grab the Space Combat Kit now at HALF PRICE on the Asset Store Holiday Sale!
     
    JFI66 likes this.
  50. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    1,556
    I found out what caused this issue: the HUD camera is parented to the chase cam. With the Vive that will cause the HUD camera to move with the head, mesing up all normals and positions. Simply moving the HUD Cam to the the same level as the chase cam in the Vehicle camera resolves the radar dot issue.
     
    Billy4184 likes this.