Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Space Combat Kit (VSXGames) [RELEASED]

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

  1. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Hi! I already fixed this bug for the next update. Basically, I was using a singleton for the GameManager but decided against it, and forgot to update the integration packages.

    In both of the scripts that give this error, simply declare at the top:

    Code (CSharp):
    1. GameManager gameManager;
    Then in the Start method:
    Code (CSharp):
    1. gameManager = GameObject.FindObjectOfType<GameManager>();
    And then replace all the places where it says 'GameManager.Instance' with 'gameManager'.

    Hope that helps. Otherwise PM me and I will send through the updated integration packages.
     
  2. MMccathron

    MMccathron

    Joined:
    Feb 27, 2015
    Posts:
    12
    That did the trick, thanks!
     
    Billy4184 likes this.
  3. oznogon

    oznogon

    Joined:
    May 9, 2016
    Posts:
    2
  4. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Quick update on the multiplayer, it won't be finished until at least next week sometime. I just haven't had much time left over from some ongoing freelance work. It'll be worth the wait though!
     
  5. artCOR

    artCOR

    Joined:
    Jul 23, 2012
    Posts:
    287
    looks interesting and want to buy this, one question... is the Vehicle Combat Radar already integrated in this kit or do I need to buy that separate?
     
  6. artCOR

    artCOR

    Joined:
    Jul 23, 2012
    Posts:
    287
    I also see that the Vehicle Combat Radar is VR compatible, will the Space Combat Kit also be VR compatible?
     
  7. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Hi! Yes the Vehicle Combat Radar is in there, including all the features from its own package.

    The space kit has some menus (power management, loadout etc) that are not VR at the moment (I will be updating them very shortly) but the HUD is completely VR compatible.
     
    artCOR likes this.
  8. CoreyTunts

    CoreyTunts

    Joined:
    Mar 5, 2018
    Posts:
    1
    This is amazing, probably going to end up buying it when the networking support is taken care of. Nice work!
     
    Billy4184 and Neviah like this.
  9. jarpg360

    jarpg360

    Joined:
    Apr 20, 2015
    Posts:
    9
    will you add u-net support?
     
  10. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Very probably, but I will finish Photon first.
     
    JFI66 and Neviah like this.
  11. artCOR

    artCOR

    Joined:
    Jul 23, 2012
    Posts:
    287
    Bought it and this is so much fun to play! I will play the whole weekend and start working/ prototyping my game on Monday :) The VR is looking great BTW
     
    Billy4184 likes this.
  12. alex_m2000_cl

    alex_m2000_cl

    Joined:
    Dec 4, 2016
    Posts:
    10
    Hi. I am looking for a asset that allow me to move a 3d spacship from a point on a platform to a destination land point, avoiding any obstacle on the path. These obstacles could be big, medium or small. i Tried many differentes script and various assets but all of them failed with large obstacles. could be this asset useful on this case ?. please could you give more info about the AI, and specially the obstacle avoidance strategy and if it will work with big and small obstacles ?. Thanks in advance.
     
  13. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    The obstacle avoidance is a work in progress. It may need some amount of tweaking depending on the size and shape of your obstacles, and in fact I think it has some weaknesses for large obstacles.

    Basically the obstacle avoidance uses a spherecast, but the problem with this is that if the sphere begins inside an obstacle, it doesn't register. And according to the way that the obstacle avoidance steering works, I think that for large obstacles it might end up too close and run into them. A fix might be to use additional raycasts, but I'm hesitant to use patchwork solutions and would rather spend some more time to figure out something more elegant and standardisable.

    So basically at this point, I wouldn't recommend buying the kit only for the value of the obstacle avoidance. It's reasonably good, and there is so much more in the kit that I'm sure you'd really find really useful, but if obstacle avoidance is specifically what you want I can't guarantee it would work better than other solutions you've tried.

    If you send me a test scene with the sort of obstacles you'll have, I can try it out and let you know what happens.
     
    rubble1 likes this.
  14. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    263
    Hello,
    I'm considering buying this kit and had a quick question before I do. Is it possible to just have the A.I fight each other with this kit and have the player just watch?

    -Thanks
     
  15. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Hi! It sure is. In fact if you play the webgl demo, by default the AI is in control of the ship, and the player is spectating.

    In this kit, there is always a game agent (player or AI) that is essentially focused on by all of the scene components. That means camera, HUD, menus and others reference it. This focus is controlled by a single GameAgentManager script in the scene, and switching focus is as simple as calling a method and passing the new game agent reference.

    This way it's easily possible not just to do things like debug AI in a much clearer way, but also spectate in the (nearly finished) multiplayer that's going to be added.
     
    RealAspireGames likes this.
  16. juris3d_unity

    juris3d_unity

    Joined:
    Nov 14, 2017
    Posts:
    53
    Hello, Oznogon! This what you did really interests me - how does it feel as an planetary (aerial) vehicle? Did you maybe try, how AI behaves in such situation? Thank You!
     
  17. artCOR

    artCOR

    Joined:
    Jul 23, 2012
    Posts:
    287
    Do you have any idea when you will/can finish the VR ? I'm still busy playing with this kit and read the scripts but it would be nice to start building something in VR :)
     
  18. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    This weekend.
     
  19. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    217
    Saw a bug where sometimes the "Missing Incoming" alert will not go away.
     
  20. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Thanks, I'll check up on it.
     
    Neviah likes this.
  21. ariock

    ariock

    Joined:
    Jul 23, 2015
    Posts:
    23
    any idea when the photon version will be out?
     
  22. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    217
    Just purchased this asset hoping multiplayer will be added in the near future.

    I have one suggestion though:
    Is there a bounding box so the player can't continue off into infinite space?
    Can you have a bounding box that is a trigger where an event kicks in. The player, for 5 seconds, has their auto-pilot (AI) turned on, weapons off, so that they automatically go back towards the fight. This way instead of hitting an invisible wall, you can use the event to turn the player back around automatically, and even use a Sound trigger like "Let's get back in the fight". Looks more natural.
     
  23. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Quite soon. I've got almost everything functioning, but I need a couple of days to polish up.

    Basically I've modified a lot of scripts to a) trigger events and b) present public methods that call functionality in complete isolation from everything else.

    This is so that that the multiplayer scripts can hook into the local player's events, and RPC the functionality directly to remote ships in such a way that the remote ship can be completely passive, and not change state in any way on its own. Whereas before, the functionality was bound up with all the other systems in the ship and there were a lot of effects when something happened, which is bad when trying to sync the vehicles.

    This way the singleplayer code is not mixed up with multiplayer and they can be completely separated, and the event functions are a bonus because they can also be used to trigger more complex AI behaviour.

    I think it's best to avoid taking control away from the player in games whenever possible. I would go with the Battlefield technique, and present a message saying "You're leaving the combat area" and a timer to get back before they are destroyed.

    However if you want an autopilot, the script called Maneuvring.cs is what you need. There's a TurnToward function that you can simply pass in your ship parameters and receive steering and throttle values to make the ship turn and move toward a point in space.
     
    danreid70, rubble1 and Neviah like this.
  24. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Also as of today I'm pretty sure the kit is fully VR compatible, but I'll know for sure tomorrow when I get my hands on an S6 and a Gear headset.
     
    Martin_H, danreid70 and artCOR like this.
  25. Devision4

    Devision4

    Joined:
    Jan 12, 2013
    Posts:
    1,329
    Any planes to support VR?
     
  26. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Hi! The kit is now VR compatible, and I'll be sending off the update to the store very shortly.

    As far as multiplayer, I'm finishing creating a multiplayer 4v4 skirmish with enter/exit vehicles and bots that will be in the update too.
     
    danreid70, Lagunajam, artCOR and 3 others like this.
  27. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    217
    Oh man, can you imagine these multiplayer battles where players spawn from capital ships hangars, and both capital ships have their own AI turrets? Oh lawd jesus!
     
    artCOR, rubble1 and Billy4184 like this.
  28. Roachie

    Roachie

    Joined:
    Aug 2, 2009
    Posts:
    64
    That sounds amazing, cant wait for the new update.
     
    rubble1, Billy4184 and JFI66 like this.
  29. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    I was wondering have you seen this?

    Flagship (Pirates Attack)


    I guess what I am asking is w we be able to walk around giant Capital Ship in the 1st Person as as the 3rd person please? I am sure that would very very COOL
     
    Billy4184 and Neviah like this.
  30. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,655
    You can emulate that by rendering the interior on a scene and render the space battle like a skybox from a decouple objects POV, as long you don't seamlessly go from interior to exterior, all you need will be to synchronize effects and light (basically use the cubemap of the space battle).
     
    Billy4184 likes this.
  31. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    I want to focus on completing a full space combat/trading template right now, but if you've poked around the kit you've probably become aware that a lot of stuff is designed and named in a very abstract way. That's because I plan to develop the kit into a 'universal vehicle combat' system that will probably include first and third-person controllers as well as many vehicle types.

    At the moment, you can create you own characters and assign them a GameAgent component, and enter/exit vehicles like that. So it's technically not too difficult to integrate characters already. For walking around inside a ship, my suggestion would be this:

    • Create a ghost copy of your ship without meshes, just the collider structure, and keep it static (don't move it)
    • Create a ghost copy of your character without meshes, just the controller/rigidbody/collider structure, and put it inside your ghost ship, and have the player control it and move it around within the static ghost ship.
    • Now put your original (rendered) ship in the scene and drive it around however you like;
    • Now when you walk around inside the ship, transfer control to the ghost character, and use the position and rotation of the ghost character relative to the ghost ship to drive the position and rotation of the real character relative to the real ship. That way the actual character controller is moving around inside a static system and there are no physics problems.
    Hope that makes sense. I haven't had to implement it yet, but I've heard this is the best approach.
     
    danreid70, rubble1, Neviah and 4 others like this.
  32. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    Yeah but I want to be able to fly the Capital ship as well as allow the A.I to fly the Capital Ship amd fight in the Space Battles also you are going to have to show me that method in a video though I could see that working for like a Massive Space Station and there is a massive Space Battle outside with fighters and Capital Ships and you Control your A.I from the bridge of the Space Station an you can click on a telescreen and it connects to and R.T.S style camera so you can control your units and you making this a Universal Vehicle Combat System that is extremely COOL or sick as younger people say nowadays
     
    Last edited: Mar 22, 2018
  33. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    You can fly the capital ship. Think of it like this:

    1. You have a ghost character walking around inside a static (not moving) ghost ship, without any problems arising from ship movement, because the ship isn't moving.
    2. The real character copies the local position/rotation of the ghost character, except that this position/rotation is applied relative to the moving ship.
    So if the local position of the ghost character within the non-moving ghost ship is, e.g., (1,2,3), you set the local position of the real character as (1,2,3) relative to the moving ship. That way the moving ship can be driven around all over the universe, and the character appears to be walking around inside it.
     
    danreid70 likes this.
  34. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    I see so I have a moving ship and a static ship and just make the character seem as if they on the moving ship but really they are on the static ship and the ghost character is on the moving ship Is that what you mean? If there is any coding for this you will have to show me it I am afriad
     
  35. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    The ghost character is on the static ghost ship, and is being controlled by the player (walking around, bumping into walls etc) and does not suffer any physics problems because the ship is not moving.

    The rendered(visible) character is inside the real, moving ship, but is not being controlled by the player. It is a puppet with no rigidbody.

    Every frame, you look at where the ghost character is within the ghost ship, and then you go to the rendered character and set its position within the moving ship accordingly.

    So if your ghost character (controlled directly by player) is currently on Floor 1 of your static ghost ship, you would go to your moving ship and position the rendered character on Floor 1 of the moving ship. Since you are setting the position and rotation directly (probably even making the rendered character a child object of the moving ship), there is no issue with physics, and it does not matter where in the world the moving ship is, or at what speed it is moving around.

    Hope that clarified things.
     
  36. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    OK fine and I just bought the Space Combat Kit by the way and I would need no scripting for this? OK might be a dumb question but need to clarify that as it seems that I wouldn't need it. just trn of the renderer for the ghost player /A.I and ship and duplicate them in the scene but you never know
     
  37. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Thanks for buying! However it's not part of the kit. The kit does not include characters at the moment, just vehicles and bodyless components for the player and AI (GameAgent components). This is something you'd have to implement in your project, I was just explaining how I would approach the situation myself.

    If/when I implement characters, I will have a look at creating a straightforward way to set up walking around in ships.
     
    Vampyr_Engel and danreid70 like this.
  38. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    OK great thank you very much
     
  39. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    Oh yes I would like top make a small contribution as I have a Player and A.I script that can walk around a sphere so if you need it please get in touch, must warn you though they are very crude but they work
     
    Last edited: Mar 23, 2018
    Billy4184 likes this.
  40. rpg_gamer

    rpg_gamer

    Joined:
    Nov 28, 2012
    Posts:
    214
    is this VR compatible (replacing the camera with steamvr cam)? Can i use my own cockpit models?
     
  41. Roachie

    Roachie

    Joined:
    Aug 2, 2009
    Posts:
    64
    Replacing the cockpit is really easy As shown here

    http://i.imgur.com/p5DR8UQ.jpg

    VR is coming in the next update (which is hopefully this week) though you could probably put in your own solution easily if required
     
    Billy4184 likes this.
  42. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Hi! The next update as Roachie said is VR compatible, although it's pretty much just the game menus that need to be updated to world space. You can do that yourself by setting to world space canvas, scaling the canvas and placing it in front of the camera.

    The HUD and cockpit UI is already completely VR compatible.

    Changing the cockpit model is as simple as grabbing the ship prefab (the one referenced on the PlayerItemsPrefab prefab), swapping out the cockpit mesh and saving the prefab.

    I'm working hard to finish the multiplayer, some unexpected stuff came up last week and I've just got back to it after a few days off.
     
    rubble1 and artCOR like this.
  43. rpg_gamer

    rpg_gamer

    Joined:
    Nov 28, 2012
    Posts:
    214

    thanks for the quick reply. Im going to purchase this today. Going to work on making an all touch control cockpit... Somewhat like VTOL VR is, where you grab the throttle / yoke with your touch controls and control the aircraft that way.
     
    Billy4184 likes this.
  44. InGameGames

    InGameGames

    Joined:
    Mar 3, 2018
    Posts:
    33
    How achievable is the Itano circus effect with this module?


    If the video wasn't clear enough, the Itano Circus effect is basically homing missile/laser/whatever spam with numbers like "dozens" being standard if a little low for the modern effect, you're looking at hundreds of swarming projectiles following different paths converging on one or more targets for the full effect.

    I understand this would make multiplayer support basically impossible due to the mass of projectiles that have to be tracked, a problem compounded by every player or enemy added capable of launching more projectiles enmass. I have an interesting solution in mind to make dealing with that many incoming or outgoing projectiles engaging and fun provided I can find something to bolt it to that can handle basic game-play like flight handling, enemy AI and pathing, basic physics, etc.
     
    Last edited: Mar 26, 2018
    neoshaman likes this.
  45. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    Hi! So it's all a question of making sure you're not taxing things too much. There are a bunch of things you could try;
    • Have 1 'parent missile' with a MissileController component, and make multiple child missiles weave around the parent in simple patterns. That way only one missile component is actually doing guidance/collision calculations.
    • Fire multiple missiles, but update the guidance for each one in a different frame. So you might have 10 missiles but only one calculation each frame. Especially if your target is not too zippy this should work well.
    • You might create simpler guidance for your project, perhaps without even using physics.
    I'll have a look at the profiler on the missiles tomorrow and see if I can do a stress test.
     
  46. InGameGames

    InGameGames

    Joined:
    Mar 3, 2018
    Posts:
    33
    An example of what I'd like to be able to achieve is locking four separate targets with twenty four missiles in clusters of six, if you locked fewer targets you could either fire off less missiles or split the more missiles between them... Same thing goes for more targets, etc. Ideally that would go both ways to both extremes.

    Your first solution sounds like it could work provided collision detection was enabled on the child missiles so they are more than cosmetic and can still detonate when the parent missile has a near enough miss that one of the clustered missiles hits the target.

    Could the second solution be implemented on swarms of missiles, pulling information from a rapidly updated parent missile like in the first solution but less frequently update the child missiles so that they follow the path of the parent missile except if in extremely close proximity to the target(close enough for a proxy detonation)? The updates hitting each child missile separately would make them look like they're individually guided when they make course corrections outside of detonation range because they would become out of sync with the rapidly updated parent missile that is able to follow zippier targets through their motions better, right?

    Thanks for following up on my queries, you're a legend.
     
    Last edited: Mar 27, 2018
  47. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    I did a stress test on the missiles with 400 firing simultaneously. During flight, the 400 MissileController components in total consume about 5ms.
    • Approx. 1ms for lead target calculation - to hit potentially moving targets;
    • Approx 3-4ms for the maneuvring code (which incidentally is the same as what the ships use);
    I would say that for 24 missiles you're good to go. If you need optimisation, you can use much simpler maneuvring code instead.

    Note the huge spike on the profiler image below is because although missiles are automatically pooled, the pools are not initialized to such a large capacity and a lot of instantiation happens. You can set the starting amount on the pool though depending on your needs.

    untitled.png
     
  48. Keywise

    Keywise

    Joined:
    Mar 21, 2015
    Posts:
    29
    1) Out of the box, ships are displayed on the radar, but waypoints (the other iTrackable type) are not. How do I enable waypoints so they will be displayed?

    2) I want to add a new iTrackable type and get it displayed on the radar (e.g. space station location). What are the steps I need to take to do this (files to modify and the prefabs to update)?

    Great software, I'm really enjoying working with the kit. Thank you for the excellent work.
     
  49. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,736
    @Keywise hi! Waypoints work for me. If I open the demo scene, add a cube to the scene and put a DemoTrackable script on it with the type set to Waypoint, it shows up fine, does that work for you?

    To add another trackable type:

    1. Go to the ITrackable script and update the TrackableType enum at the top;
    2. Go to the HUDRadar3D component on your HUD prefab and fill in the inspector values for the new trackable type;
    3. Go to the HUDTargetTracking component on your HUD prefab and fill in the inspector values for the new trackable type;
    4. Save the prefab.
     
  50. Keywise

    Keywise

    Joined:
    Mar 21, 2015
    Posts:
    29
    Adding the DemoTrackable script to the waypoints worked. Thank you for the quick response.

    Note: I set the team of the waypoints to "Neutral" (they show up white on the radar), yet the AI on my ship automatically fired on them. Is that a bug or a feature?