Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Space Combat Kit (VSXGames) [RELEASED]

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

  1. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    492
    Hmm, getting the following error after importing the Radar asset:
    variable 'o' used without having been completely initialized
    Compiling Vertex program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA

    The error points to the HologramOutlined.Shader file, on line 68.
     
  2. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    492
    In case it helps, here is the function causing the issue:

    Code (CSharp):
    1.             v2f vert(appdata v)
    2.             {
    3.                 v2f o;
    4.                 o.pos = UnityObjectToClipPos(v.vertex);
    5.                 half3 norm = mul((half3x3)UNITY_MATRIX_IT_MV, v.normal);
    6.                 half2 offset = TransformViewToProjection(norm.xy);
    7.                 o.pos.xy += offset * o.pos.z * _OutlineWidth;
    8.                 o.color = _OutlineColor;
    9.                 return o;
    10.             }
     
  3. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    492
    Shield regen based on System power distribution.
     
  4. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Hey TonanBora, sorry for the late reply, not sure how I missed your comment in my notifications. FYI the best way to get in touch is via email: contact at vsxgames dot com.

    To fix this probem, simply add the line
    Code (CSharp):
    1. o.uv = v.uv;
    after Line 60, the one that says:

    Code (CSharp):
    1. v2f o;
    I will fix this shortly in an update, but the HUD has gone through some changes in the space kit that would be beneficial for the individual package as well (mainly related to loading and organisation of HUDs for different ships) so I'm going to wait until that's finished before making a big update to the radar package.
     
    Last edited: Nov 16, 2017
  5. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    I'm in a bit of a crunch with freelance stuff, but I'm working on polishing the features of the kit and setting aside at least 1-2 hours per day to work on it. The kit really needed a lot more testing, and I have found a bunch of design issues that need to be fixed that were not completely obvious during development.

    Here's an example. Before, I had shield and armor modules completely self-contained with their own mesh, collider, effects etc. The problem is that ship colliders and effects meshes are unique to each ship, so having these as part of a general module would not work. But at the same time, I did not want to interfere with the flexibility of separating functionality (modules) from managers (subsystems), and also did not want to declare completely new, intermediate classes for shield and hull fixtures that would complicate things by adding another layer of communication in between subsystems and modules.

    But there is already an intermediary between subsystems and modules: module mounts. These do not interfere directly with subsystem <--> module communication, just serve as storage points for modules.

    So to fix the problem, I made the ModuleMount class a base class, and extended it in the form of the class HealthGeneratorMount, which 1) Can only take health generator modules (i.e. shield generators) 2) Contains a reference to an effects mesh and collider and 3) connects the health generator with the shield mesh and collider.

    This way, different health generator modules can be linked to shield meshes unique to that ship, and can perform their unique visual effects on them. Also, module mounts can be clearly designated for a particular purpose.
     
  6. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    This has already been implemented! Power configuration in this kit is very customizable. Subsystems can be collectively powered (and power distributed by the player at runtime), independently powered, or unpowered.

    There is also the option to distibute power by the player:

    PowerManagement.png

    The red part of the bar is fixed power (you can set a certain amount of power to each subsystem that the player cannot change) and the blue part is distributable power.
     
    FusionSticc, TonanBora and JFI66 like this.
  7. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    492
    Can the targeting outline and info be set to only be active when you have a target selected?
    Because the radar demo is visually cluttered due to a lot of targets present in the scene, and I would like to avoid overloading the eyes of my players. :p
     
  8. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Very good point. Currently, the package is not set up for this, but if you like I can PM you a modified HUDVisor script. I will definitely add the option of switching off unselected target details in the next update.
     
    TonanBora likes this.
  9. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    More testing and polishing! Here's a quick look at the VehicleCamera script.

    Overview

    VehicleCamera.png

    The VehicleCamera component is designed to handle cameras for any kind of vehicle. Based on the camera view (VehicleCameraView enum) selected by the player, it smoothly follows the position and rotation of a CameraViewTarget, which is a component that is attached to a child transform of the target vehicle, and which represents the camera's orientation target for a particular view.

    VehicleCameraTarget.png


    Expanding the Views


    By expanding the VehicleCameraView enum, and adding camera view targets to the vehicle, it's easy to add more views.

    Looking Around

    The camera also uses a GimbalController script to manage looking around. This component can smoothly rotate toward a target position in space, rotate incrementally (i.e. when mouse is moved) or snap instantly toward a target position.

    Camera Shakes

    It's possible to add a shake to the camera by specifying a shake strength as well as attack, sustain and decay times, or by specifying a single shake value every frame.

    Multiple shakes can be added simultaneously (the strongest shake value is used every frame). There is a continuous per-frame shake added automatically for when boost is pressed, as well as an explosion shake when the vehicle is destroyed.

    When the vehicle is destroyed, the camera goes into Death mode which is an orbiting mode where it rotates around the vehicle's explosion.

    Field-Of-View

    The camera FOV changes during boost mode.

    Other Camera Stuff
    • The VehicleCamera script is integrated with the EventManager component in this kit, and any scripts in the scene can listen for an OnCameraViewChanged event, or an OnCameraUpdated event (in case something needs to be done after the camera has updated its position and rotation).
    • Like most scene level scripts, the VehicleCamera script listens for an OnFocusedVehicleChanged event to update the vehicle that it is focusing on. This event is driven by the GameAgentManager in the scene, which handles which game agent (player or AI) is being tracked. This way it's possible to easily switch views between game agents, such as in spectator mode, and to follow a game agent as it enters and exits vehicles.
     
    FusionSticc, JFI66 and TonanBora like this.
  10. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Here's the latest demo:

    WebGL Demo

    Demo.png

    I re-did the demo, mainly to check that creating a scene with the kit works the way I want it to. Found a lot of bugs and things that needed to be tweaked around, and some foundational stuff that really needed to be added as early as possible:
    • Entering/exiting vehicles (toggling between player/AI control in the demo);
    • Architecture of re-usable, separate control scripts for different vehicles that can be loaded at runtime according to vehicle type;
    • Much better AI/cleaner AI structure;
    • AI teamwork - groups and group managers (for formations, target distribution etc);
    • Event manager/system (it's really necessary for a kit like this!);
    • Better Editor workflow for creating vehicles and mounting modules (i.e. creating vehicle in inspector vs loadout menu);
    • Tested the module system with more module types;
    • Better system for loading and unloading HUDs for different vehicles at runtime;
    • Separating messages/alarms/sfx from the subsystems and into the HUD;
    • Lots of work re-working systems to be compatible with the possibility for completely different vehicle types;
    • Lots of debugging, tweaking and testing.
    Most of the stuff I've changed has to do with structure and workflow, so this kit will be much better to use now.

    Documentation is also coming along well and I'll be posting it here soon.

    I want to say that it will be ready by the weekend, but we'll have to see how it goes!
     
    Lagunajam, vamky, FusionSticc and 2 others like this.
  11. FusionSticc

    FusionSticc

    Joined:
    Mar 16, 2014
    Posts:
    49
    Wow! The wait is going to be worth it I can tell! This kit looks like it's come along way! Definite buy from me whenever it releases! Good job dude!
     
    Billy4184 likes this.
  12. Konst

    Konst

    Joined:
    Aug 26, 2013
    Posts:
    78
  13. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Konst likes this.
  14. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    75
    Yes, very cool.
     
  15. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Hi everyone, the Space Combat Kit has finally been submitted for review to the Asset Store! Although I wish things had gone a lot faster, I'm very satisfied with where it is, and I think there's a lot of opportunity for expanding it in updates.

    Screenshot5.png

    I've attached documentation that was submitted with the package so you can get a better idea of how the kit works.

    The thing I am most happy about is that I believe the foundation is about as good as I can get it in terms of providing an easy way for you all to morph the kit into whatever style of game you're creating. So much so that my aim over the next few months is to expand it into what will be named the Universal Vehicle Combat Kit that can deal with all sorts of different vehicles, Battlefront-style.

    AI

    Before I do that, the most important thing (based on your feedback of what you'd like to see) is improvement of the AI/obstacle avoidance. It is still not great due to a couple of things:
    • At the moment, the formation following (which primarily uses relative velocity rather than the vehicle's orientation in the calculations) is separated from the general maneuvring, which uses the vehicle's orientation. This will be merged to create one general-case maneuvring algorithm.
    • Although velocity is taken into account right now (at least in formation following) the maneuvring algorithm does not take into account the relationship between the vehicle's speed capabilities and the spatial characteristics (stopping distances, turn radius etc) of a maneuver. So for example when changing the power distribution to increase engine power, the AI can sometimes become somewhat erratic and has trouble with distances. This is due to hard-coded PID coefficients as well as various hardcoded values that are not flexible. To fix this, I will need to create a fairly complicated test scene and run a lot of tests, which would delay the first release too much.
    • Obstacle avoidance uses Spherecast mainly, which means that if the spherecast intersects an obstacle at the point that it starts from (the ship position, if it is too close to an obstacle) the obstacle is not detected. This means that if the ship gets too close to something it cannot 'see' the obstacle. I need to figure out a way to improve this efficiently with raycasts that support the spherecast.
    Capital Ships

    I will also add a demo in the first update showing capital ship combat (Dreadnought style). The kit (including AI) is already perfectly compatible with it, so all I have to do is create the scene stuff, a couple of specific HUD features and camera controller.

    -
    I'm looking forward to feedback (especially critical feedback) once the kit is released so that I can improve any weaknesses quickly. I would have liked to do a bit of beta-testing but things changed too fast and it was never 'ready enough'. So let me know anything that you think could be improved.

    Thanks to everyone for the interest, feedback and patience - it was a while in the making, but I hope it fulfills all your expectations!

    Don't forget to check out the documentation, and let me know if you have any questions.

    Billy (VSXGames)
     

    Attached Files:

    Last edited: Dec 31, 2017
    FusionSticc, rubble1 and JFI66 like this.
  16. JFI66

    JFI66

    Joined:
    Aug 25, 2015
    Posts:
    28
    Thank you!
     
    Billy4184 likes this.
  17. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    203
    This looks like one very sweet asset, thanks for working on this. Is Photon multiplayer integration going to be a feature?
     
    rubble1 and Billy4184 like this.
  18. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    It certainly will. Not sure when, but probably the first update.
     
    Neviah and rubble1 like this.
  19. SuperNewbee

    SuperNewbee

    Joined:
    Jun 2, 2012
    Posts:
    175
    Hello. I just stumbled onto this thread. I was about to buy the Vehicle Combat Radar, but now I am interested in this.

    What is the price? Will it be a separate pack than Vehicle Combat Radar or an upgrade?

    thanks
     
  20. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Hi, thanks for stopping by! The initial price is just $35 (although it will increase significantly once bugs are fixed/first few updates have been made).

    Since the radar is part of this kit, anyone who has bought the radar package will be able to upgrade for the difference in price ($20). I'm not sure if this will always be the case, depending on how much the packages diverge in future, but that's how it will be at the beginning.
     
    SuperNewbee and JFI66 like this.
  21. JFI66

    JFI66

    Joined:
    Aug 25, 2015
    Posts:
    28
    Does it always take so long to release in the ?
     
  22. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    There seems to be a backlog of submissions over christmas for Unity to get through, unfortunately.
     
  23. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    203
    As soon as Photon multiplayer is ready I'm going to town on this asset! lol
     
    rubble1 likes this.
  24. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    386
    I still don't see this on the Asset Store. Do we have an ETA for release / approval?
     
    JFI66 and Neviah like this.
  25. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Unfortunately I'm not sure when it will get approved. There seems to be a huge backlog of stuff built up over christmas, and there's been a bunch of threads about long review times where a Unity team member has basically said as much.

    In any case, I've started work on a capital ship demo (Dreadnought style gameplay) for this kit, and I will also be implementing Photon multiplayer very soon, so stay tuned!
     
    FusionSticc, rubble1, JFI66 and 2 others like this.
  26. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    203
    Oh god... I need a change of pants. This makes me so happy!
    Will you have scripts that will allow any character controller to walk up to a docked ship that has like a collider/trigger that allows you to go in the ship to fly it (Like, "Press E to Enter")? It should also disable the character controller and enable the ship controller scripts :3

    I want to be able to move around with a character in a capital ship (inside of it), run to the hangar, and board a ship to fight outside. multiplayer style!
     
  27. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Let me explain a bit how the kit works (you can check out the attached documentation for more info):

    1. The player and AI are represented by GameAgent scripts, which is separate from any particular vehicle/ship;

    2. A GameAgent can enter and exit vehicles/ships (this is what happens when, in the current demo, you toggle between the player and AI - basically you are calling GameAgent.EnterVehicle(Vehicle newVehicle) for the AI and GameAgent.EnterVehicle(null) for the player, or vice versa).

    3. So to make your character enter a vehicle, you basically would walk up to the ship, detect when you hit some kind of trigger collider, and call GameAgent.OnEnterVehicle() for your character.

    That's a basic explanation of what the kit does so far. It's not completely ready yet to fully handle the transition between a character walking around and getting into a ship (I'll update/add a demo with the Unity fps character very soon, thanks for the reminder). But the main point to remember is that, according to the architecture of the kit, a character is a form of vehicle, and getting into or out of a ship is simply a transition between two vehicles.
     

    Attached Files:

    Last edited: Jan 17, 2018
    FusionSticc, JFI66 and Lagunajam like this.
  28. JFI66

    JFI66

    Joined:
    Aug 25, 2015
    Posts:
    28
    Hi Billy,
    is there a chance that you ask a Unity guy about a status of the asset to get an ETA or a status?

    Best regards
    Jürgen
     
    Neviah likes this.
  29. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Hi Jurgen, I just sent off a support ticket, so I'll post here if I hear back.
     
    FusionSticc, Neviah and JFI66 like this.
  30. Miclebrick

    Miclebrick

    Joined:
    Dec 31, 2014
    Posts:
    38
    Is this asset available for purchase yet? I've tried and failed to make a quality AI dogfighter that works good in 1v1s, 100v100s, and 20v100s, etc, without e.g. chasing eachother in huge geometrically interesting shapes, being impossible to kill or evade in a 1v1 dogfight, ETC. I really like the concept of a pre-built AI. I already bought the radar thing, it's very good.
     
  31. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Hi! Not yet unfortunately, it's taking a long time for publishers to get their stuff on the store at the moment.

    Did you try the demo? I'd like to hear any feedback you have on the AI, positive or negative.
     
    Miclebrick likes this.
  32. Miclebrick

    Miclebrick

    Joined:
    Dec 31, 2014
    Posts:
    38
    Wow, the demo is great. I like the graphics. The AI seemed really easy to kill, although it felt like I had superior numbers on my side. Would it be difficult to make a quick demo where if you kill one, two more spawn, and you have no teammates on your side? Or maybe just disable the allies?
     
  33. Miclebrick

    Miclebrick

    Joined:
    Dec 31, 2014
    Posts:
    38
    Nevermind, I just killed all of my allies like the evil Sith Lord I am and then fought the enemies. At first, I had to get the hang of actually hitting them, although I think I had dodging down. Then, I crashed into some asteroids and took a few missile hits. Then, I killed 2-3 of them and died. Seems pretty good :) I definitely like the controls and AI a lot more than my attempt at it!
     
    Billy4184 likes this.
  34. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Glad you liked it. Let me know if you've got any suggestions.
     
  35. Miclebrick

    Miclebrick

    Joined:
    Dec 31, 2014
    Posts:
    38
    Well, I think joystick compatibility would great. Also, maybe make the AI actually stay on your tail when they chase you somehow. It seemed like they didn't do that currently. You can basically just run and they don't shoot your rear.
     
  36. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Good point. At the moment the AI cycle between evading, and attacking directly from whichever direction they are from the player, which I implemented because I think it's the best default mode - stuff that happens on your tail is harder to see and harder to balance. But yeah it definitely would improve it to mix things up a bit more.
     
    Miclebrick likes this.
  37. Miclebrick

    Miclebrick

    Joined:
    Dec 31, 2014
    Posts:
    38
    Definitely agree on hard to balance and hard to see... from firsthand experience ;) Nevertheless, it really makes it that much more fun IMO, and gives it a more Star Wars type feel, since that's largely how starfighter dogfighting works in Star Wars.
     
  38. Miclebrick

    Miclebrick

    Joined:
    Dec 31, 2014
    Posts:
    38
    Oh, would also like to say that I spent tons of time trying to find something like this. Finally found it by searching: "unity space combat ai"
     
    Billy4184 likes this.
  39. Miclebrick

    Miclebrick

    Joined:
    Dec 31, 2014
    Posts:
    38
    Another issue is that in third person, the reticle isn't actually accurate to where the shots go. I otherwise love the third person control, reminds me of Battlefront. If you could get it to where it's more like Battlefront where the reticle is where it actually shoots that'd make it even better.
     
  40. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Good idea, I'll give that as an option.
     
    Miclebrick likes this.
  41. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    I got a reply saying that the asset store submission queue is long at the moment and it's being worked through as fast as possible, so nothing to do really but wait unfortunately. Hopefully it's near the front by now.
     
    FusionSticc, Miclebrick and JFI66 like this.
  42. JFI66

    JFI66

    Joined:
    Aug 25, 2015
    Posts:
    28
    Thanks a lot!
     
  43. Miclebrick

    Miclebrick

    Joined:
    Dec 31, 2014
    Posts:
    38
    There's a bug where if you edit any script and unity reloads script, the radar just completely breaks. Also, how do I set up my ship movement so it's compatible with the lead calculation or whatever?
     
  44. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Can you explain a bit more? I'm not clear what the problem is here.

    Do you mean about the target reticle following where the weapons are aiming?
     
  45. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    I'm not sure what this post is about, please post in english. Thanks.
     
  46. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    The package was declined due to a couple of things related to the Rewired and Behaviour Designer integrations. After emailing the asset store team and getting clarification I have re-submitted the package.

    I've been told the review process for the second submission will be much faster, so hopefully it'll be up very soon!
     
  47. JFI66

    JFI66

    Joined:
    Aug 25, 2015
    Posts:
    28
    Is the usage of Behaviour Designer a must have or can I use the asset also without it ?
     
  48. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,703
    Definitely not a must-have, every listed feature of the kit is provided first as an original implementation, and then there are .unitypackage files with integrations for those with BD and rewired.
     
    FusionSticc and JFI66 like this.
  49. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,454
    Looking forward to this release. I think @Steve-Tack will like this too.
     
    Billy4184, FusionSticc and JFI66 like this.
  50. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Indeed. Rewired integration is N-I-C-E.
     
    Billy4184 likes this.