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. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Yes, everything is done with physics. Turn rates are determined by torque application and thrust by linear force application.

    On the SpaceVehicleEngines component, you'll find settings that determine the amount of force applied to the ship, which is of course then divided by mass to determine acceleration. The Default settings are for when you want to set the exact force in the inspector, and the Power Coefficients section for when you are using a separate powerplant which can, for example, be affected by damage.

    untitled.png

    Note that for the AI, if you want larger ships not to roll too much when turning, you can set the z component of the max rotation angles on the AISpaceFighterControl component:

    untitled.png
    On the AI, everything is also applied in terms of forces and physics.
     
    JFI66 and danreid70 like this.
  2. antsonthetree

    antsonthetree

    Joined:
    May 15, 2015
    Posts:
    102
    Hello - thanks for the quick answer and that is good to know. I looked through the documentation pdf, but I do not see a place in Vehicle inspector where I can set the mass. Where might I find that value? In my case I will want it to be a calculated value based on the mass of the components and the ship frame. Your typical Elite type deal.
     
  3. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    The force is applied through Unity's physics to the rigidbody. So the mass is get/set on the Rigidbody component.
     
  4. Wetw0rx

    Wetw0rx

    Joined:
    Jun 30, 2017
    Posts:
    125
    Permission to come aboard captain!

    Just purchased the kit and I must say it has me rethinking my strategy on structuring and organizing my project. Very clean and extensible.

    I'm hoping to integrate your excellent AI, radar and ship loadout/management systems with my scifi RPG. I've been doing all my prototyping with the Game Kit Controller asset and this seems to perfectly complement it.

    I'll let you know how it goes. I haven't really dissected your kit thoroughly yet but the Game Kit Controller is massive so integration will be a doozy. I'm looking forward to the challenge though cuz this could be the start of something epic.

    Thanks for your hard work, bro.
     
    Billy4184 and JFI66 like this.
  5. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Welcome aboard ;)

    If you have any questions about the kit, or need advice on the best way to integrate something don't hesitate to ask.
     
    Wetw0rx likes this.
  6. FusionSticc

    FusionSticc

    Joined:
    Mar 16, 2014
    Posts:
    49
    How's it going billy :) Any progress on capital-ship based ai?
     
  7. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Multiplayer is coming along slowly, though I'm juggling a couple of freelance jobs right now.

    What exactly do you mean by capital ship AI? The only thing I believe needs to be added is a script for making capital ships attack broadside rather than front-on, which I will add in next update. Do you have any other needs that would not be specific to your game?
     
    FusionSticc likes this.
  8. FusionSticc

    FusionSticc

    Joined:
    Mar 16, 2014
    Posts:
    49
    Ahh, sorry I was mistaking myself. At this moment no, but thanks for asking!
     
  9. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    As mentioned before though, I will be making a demo with capital ships, just that I had not planned on adding any specific AI code except for combat maneuvring. It is more about creating a capital ship camera, showing how to set up gimballed weapons, handling different ship sizes on the loadout screen, etc.
     
    FusionSticc and danreid70 like this.
  10. kyuss

    kyuss

    Joined:
    Oct 19, 2013
    Posts:
    12
    Hi there! I have bought your superb kit, but I must learn Unity first :p. I have some questions: Is there any tutorial about using this? and, I am not sure about the radar module; is this the updated one you said?
    Thank you.
     
  11. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Thanks for purchasing! At the moment the documentation is still lacking and I have not yet made video tutorials, which I have planned. I will fix both in the very near future, and in the meantime, I am always ready to respond to any questions you might have via email (contact at vsxgames dot com) or here on the forum.

    The Space Combat Kit includes the radar package (with some modifications).
     
  12. ariock

    ariock

    Joined:
    Jul 23, 2015
    Posts:
    23
    Hey Billy,
    any status update on the MP? We really need it.
     
  13. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    I wasn't able to work on it for a few weeks, but I've continued on it since last week. To be honest I sort of burned out on trying to figure out all the ways that the kit might be used and how that would affect multiplayer. But I have made a determination of how I will configure things for now, and we'll have to see how it goes. So I don't have a particular date for it, but it is progressing along and hopefully won't be too long.
     
  14. ariock

    ariock

    Joined:
    Jul 23, 2015
    Posts:
    23
    perhaps it would be better to release the network stuff as a "beta" and let some of us in the community help with it. something is better than nothing, and if you find new ways to make it better, release those upgrades.
     
  15. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Believe it or not, it's really coming along well. It's my fault that it's very late, but it has had little to do with technical difficulty. It's just lack of organisation and planning, which is improving. I'll show something by this weekend, either a video or a webgl.
     
    rubble1, JFI66 and danreid70 like this.
  16. Joker1980

    Joker1980

    Joined:
    Nov 28, 2015
    Posts:
    22
    I would buy the asset if you made the asset to work with the Alien sky Asset.
     
  17. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    At the moment, my approach to integration with other assets is to focus only on those which do one specific task (or at least a range of tasks that are smaller and more specialized in scope than my own asset) in a complete and outstanding way, and which are designed specifically to integrate easily and modularly into a project. Rewired and Behaviour Designer are those kind of assets. I'm considering Opsive's character controllers too.

    However, while Alien Sky seems to be a great asset, it comes across as something like a complete game template that is not designed as such to 'fit into' anything else. Likely it has its own way of dealing with characters, weapons, vehicles, cameras, environment setup etc. That means that there are potentially many points of breakage when the developer updates things according to his/her own methods and approaches, and in fact it seems more reasonable for that developer to integrate the Space Combat Kit than vice versa, because my asset seems to have a far more specialized scope right now, and because of that is possibly designed with more of a modular perspective as well.
     
    rubble1, Adrad and JFI66 like this.
  18. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Allright, here's a PC build of a multiplayer 'Free For All' demo where you fly around and engage other players on sight. There are no bots right now, so you'll need someone else to play against - PM me if you can't find someone and I'll try to be available for a quick test.

    NOTE: You can go back to the respawn menu when playing the game by pressing X

    https://www.dropbox.com/s/n6qkgztvnfdklux/MultiplayerDemo.zip?dl=0

    Bear in mind - it's only a bare skeleton of a multiplayer implementation. You just get one ship with the default loadout and that's it. Still to go includes:

    - Loadout selection;
    - AI bots;
    - Lead target calculation when tracking network-controlled vehicles;
    - Missile hit syncing polish;
    - Stats menu;
    - Lots of polish;
    - Etc.

    Let me know what you think, and it'd be great to hear about any bugs you find while playing it.

    Untitled.png
     
    Last edited: Jun 19, 2018
  19. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Fixed the lack of data folder, the demo should work now. Interested to hear any feedback.
     
    JFI66 likes this.
  20. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Hi @Billy4184, just wanted to throw out a "thank you" for publishing this asset. I haven't had time to really dig in, but tonight I implemented my own 3D radar for my game, and it was super handy to have a reference for a couple of things in your code. Having a space sim resource is a rare thing!

    I had started to go down a path with some strange math until I looked at your 3D radar code. Translating world space target positions to local space with InverseTransformPoint is something I should have known about, but didn't.

    My radar shows the orientation of targets (little arrowhead meshes) and I was able to adapt your orientation code from the target hologram logic. There may be a cleaner way to do it, but I ended up doing this and it worked:

    Code (csharp):
    1. Quaternion temp = Quaternion.LookRotation(this.transform.forward, this.transform.up);
    2. Quaternion rot = Quaternion.Inverse(Quaternion.Inverse(targetShip.transform.rotation) * temp);
    3. radarContact.ShipContact.localRotation = rot;
    (where "this" is the player ship and "targetShip" is the target)

    The time I saved just on those two things made the purchase well worth it.
     
    Billy4184 likes this.
  21. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Glad the kit is useful for you! That's a great idea actually, having some kind of orientation on the 3D radar widgets. I'll add it to the todo log.
     
    astearon likes this.
  22. owen_proto

    owen_proto

    Joined:
    Mar 18, 2018
    Posts:
    118
    Thanks for this asset!

    I have a scene where the background is on a separate layer and being rendered by a different camera from the vehicle chase cam. The result is that when using the boost, all of the objects in the scene shake except the background, which looks strange. I was poking around the Vehicle Camera script on the Vehicle Camera object trying to find a simple way to apply the camera boost shake to my background rendering camera, but could use some help if you know the best way to go about it.
     
  23. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    The VehicleCamera script has a delegate 'onCameraUpdatedEventHandler' which you can attach methods to that are supposed to run when the chase camera has finished updating its position/rotation etc.

    I've attached a script for you.

    1. Attach this script to your background camera and fill values in inspector;
    2. Your background Camera should render the skybox in Clear Flags setting in the inspector (or render whatever you're using for the skybox).
    3. The chase cam (the one provided in the kit) should render Depth Only with a higher Depth than your background camera;
    4. The HUD camera (child of the chase camera) needs to have a higher Depth than everything else, and is already set to Depth Only.
     

    Attached Files:

    owen_proto likes this.
  24. hjohnsen

    hjohnsen

    Joined:
    Feb 4, 2018
    Posts:
    67
    I have a question about the target tracking ; the target boxes are drawn above the view of the cockpit, I wanted to have them 'in front' of the cockpit view. I tried to change the canvas render mode to 'Screen Space - Camera' in order to control the render order of the UI, but now the targets are not drawn at the correct position. I suspect a problem in the GetCanvasPosition() function of HUDTargetTracking but I don't see how to correct the calculated positions or targets.
     
  25. owen_proto

    owen_proto

    Joined:
    Mar 18, 2018
    Posts:
    118
    Thanks Billy!!!!!
     
    Billy4184 likes this.
  26. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Which camera are you using as the Render Camera? It should be the HUD camera (child of the chase camera).

    I did a quick test and found that although the rotation of the widgets are wrong with Render Mode Camera, the positions were correct. This makes sense since in both cases the Canvas is resized to fit the screen (technically, in the case of Render Mode Camera, it's the camera frustrum, but it works out the same way).
     
  27. LunarLabs

    LunarLabs

    Joined:
    Dec 21, 2016
    Posts:
    17
    ** edited because I accidentally quoted your last reply on a completely separate topic. **

    // My first ever unity post!

    Great Kit, loads of fun - Picked it up today and immediately started looking at networking it as a learning project for something else I'm working on at the moment. I'll down tools on this just for now seeing as it looks like there's a multiplayer update coming shortly for this! (very exciting).
     
    Billy4184 and rubble1 like this.
  28. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Glad to hear you're enjoying the kit!

    Yes, there's a multiplayer add-on coming soon. It's going to be a separate package that hooks into all the functionality of the original kit, and they will be updated in sync.
     
  29. ariock

    ariock

    Joined:
    Jul 23, 2015
    Posts:
    23
    hey billy, i really like the idea of the opsive controller as we use that as our tps/fps framework. you MP demo does not show any type of entry/exit which is where we are on hold at. because of our conversations, we have put that on hold as we were having problems using your focus method via multiplayer. we could really use the code instead of a pre compiled demo, as that dosnt even give us any clues on how to proceed.
     
  30. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Sometime next week I will get to the point where I can share an 'alpha' multiplayer package with people who have already bought the kit. Right now the code and the architecture hasn't been finalised and would probably give you more questions than answers.

    When the multiplayer package is released, it will be discounted heavily for a short time so that people who have waited for it on the forums can get it for a low price, and then it will go up.

    At this point I will almost certainly integrate Opsive's controller, but not until all of the core space kit updates, such as the capital ship update etc, have been done.
     
    Legorobotdude and astearon like this.
  31. ariock

    ariock

    Joined:
    Jul 23, 2015
    Posts:
    23
    also, we were using photon and have switched to unet. if you can show us some code that handles entry/exit with photon(setting and changing focus on instantiated objects), we will give you our code for unet to release with your photon version with out credit. so that would be a win for us, for you and the community.
     
  32. ariock

    ariock

    Joined:
    Jul 23, 2015
    Posts:
    23
    cool, looking forward to it. :):):)
     
    Billy4184 likes this.
  33. hjohnsen

    hjohnsen

    Joined:
    Feb 4, 2018
    Posts:
    67
    Thx, I was not using the correct camera (my scene structure is a bit different then yours).

    But I also added that in AddWidget() for the correct positioning after the parenting
    Code (CSharp):
    1.             t.localPosition = Vector3.zero;
    2.             t.localRotation = Quaternion.identity;
    3.  
     
    Billy4184 likes this.
  34. LunarLabs

    LunarLabs

    Joined:
    Dec 21, 2016
    Posts:
    17
    Great, and thanks for the quick response :)

    If you're trialing a bare bones alpha to existing patrons then count me in, I've nothing but time on my hands this week as my better half is out of town, and I choose to squander it sat in this here dimly lit room.
     
    Billy4184 likes this.
  35. LunarLabs

    LunarLabs

    Joined:
    Dec 21, 2016
    Posts:
    17
    Ah yes I can see how the checking in/out system is problematic within multiplayer framework. It's definitely worth leaving it to Billy with his intimate knowledge of the inner guts of the scene handling stuff, spent a lot of time pulling at threads last night !
     
  36. Legorobotdude

    Legorobotdude

    Joined:
    Feb 19, 2016
    Posts:
    41
    Opsive is working on the next gen of their controller, so you may want to wait until thats out before integrating: https://forum.unity.com/threads/bet...ller-ufps-2-third-person-controller-2.533637/
     
    Billy4184 likes this.
  37. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    LunarLabs and Legorobotdude like this.
  38. Legorobotdude

    Legorobotdude

    Joined:
    Feb 19, 2016
    Posts:
    41
  39. LunarLabs

    LunarLabs

    Joined:
    Dec 21, 2016
    Posts:
    17
    Hey Lego, I actually use InControl for some stuff, I've plugged it into this pack and it works as expected, I might be missing something though in your question, just thought it was worth mentioning as a fellow InControl person (Billy the creator will likely have a more advanced take on this). For universal control you might have to just peep into the playerflightcontroller and playergeneralcontrols scripts and replace the key designations with InControl's axis variable names, which is a very quick job.

    As far as I can tell, native controllers are just the ones that Unity supports I think - I use an xbox 360 pad for testing, and thats just a case of mapping the axis in the input manager. That is; unless you're using something like rewired (https://assetstore.unity.com/packages/tools/utilities/rewired-21676) which is listed in the pack as an integration.
     
    Last edited: Jun 27, 2018
    Legorobotdude likes this.
  40. ariock

    ariock

    Joined:
    Jul 23, 2015
    Posts:
    23
    hey Billy,
    Just as a note on Lego's post. Opsive is making a whole new product, not updating TPC. We will not be using their new product as it will not be implementing networkables till next year. I would imagine that im not the only person that is not going to change to their new product because of this.
     
  41. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    I'll have to think on this one for a while. One thing I really want to avoid is managing integrations rather than adding core features to the kit. I feel that if two products are designed well, there should not be a ton of trouble making them work together in a specific instance. Whereas managing a ton of integration 'demos' is cumbersome. Not to mention that multiplayer is something that adds 10x work to any job.

    One thing I will certainly do is integrate the first and third person controllers from standard assets, and in doing so I'll try to create the most flexible and easy to use interface possible, and make a tutorial for it. We'll see how that turns out in terms of being used to connect other character controllers to the mix such as Opsive's.
     
    LunarLabs, Legorobotdude and JFI66 like this.
  42. LunarLabs

    LunarLabs

    Joined:
    Dec 21, 2016
    Posts:
    17
    Hey Billy, do you still think you're likely to have a photon integration alpha this week that we can look at?
     
  43. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Should be ready by the weekend at this point.
     
    Legorobotdude, LunarLabs and JFI66 like this.
  44. LunarLabs

    LunarLabs

    Joined:
    Dec 21, 2016
    Posts:
    17
    :) Great stuff as always
     
  45. LunarLabs

    LunarLabs

    Joined:
    Dec 21, 2016
    Posts:
    17
    Maybe next weekend eh? ;)

    I looked into a Unity Networking integration for this kit, for me the point at which it surpasses my skillset is when handling the OnFire event, the pool manager and so forth. I appreciate it's no quick job to add networking functionality with the way it is currently configured, seemingly not without large chunks of code rewrites to implement Command, RPC and Server Callbacks.
     
  46. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    It will be a couple more days, unfortunately I found some stuff that is not working properly. I won't be adding any more to the demo though until I have something you can start digging into.
     
  47. YX_Iain

    YX_Iain

    Joined:
    May 4, 2014
    Posts:
    31
    Hi, is there a basic example scene file (compatible with Unity 5.6) which uses the default folder structure of the asset as downloaded from the Asset Store, which demonstrates only the implementation of the radar functionality on a player ship WITHOUT any of the extra stuff which are included with the GameplayDemo or the QuickStartScene scenes included with the asset?
     
    Last edited: Jul 9, 2018
    JFI66 likes this.
  48. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Hi, there isn't a demo of the radar by itself. What is it exactly that you are looking for clarification on?

    The radar setup is fairly simple.
    • To make an object trackable, it must have a component implementing the ITrackable interface;
    • Trackable objects are found by querying the RadarSceneManager scene-level component, which stores all trackable objects in the scene.
    • The vehicle has a Radar component which periodically queries the RadarSceneManager for trackable objects;
    Let me know if there's something you'd like me to explain in more detail.

    On a different note, the multiplayer stuff is almost ready. There were some problems with the way bots were synced for new joining players, there were some things that just weren't a great way of doing things, and also the scripts were just not up to standard in terms of clarity and formatting. And I have been in a bit of a crunch with a freelance job. Sorry for the delay, but it's going to be worth it.
     
  49. LunarLabs

    LunarLabs

    Joined:
    Dec 21, 2016
    Posts:
    17
    Great Stuff Billy
     
    JFI66 likes this.
  50. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,009
    Hang in there guys. Just finished a crunchy freelance job for comic con, and got over a winter cold. I'm tearing through this stuff as we speak!