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

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    1) Nothing happens
    2) I have RumbleManager
    3) I don't use VehicleCamera and I want only to vibrate the input controller.

    TNX !!!
     
  2. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    1. Are you using Rewired?
    2. Do you have the Rewired Vibration Manager in the scene, with the correct playerID set in the inspector?
     
  3. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    No Rewired.
     
  4. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    20190214-131044.JPG The pre-alpha tech demo is ready.
    3 scenes: first and last in the alien city, the second in the orbital alien space base.
    The 2nd and the 3rd scenes use SCK !
    There is a lot to do but i hope you'll have fun !

    Youtube
    Demo on indiedb

    PS: You need an XBOX controller to play the game.
     
    Last edited: Feb 14, 2019
  5. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    The vibration is only implemented for Rewired.
     
  6. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    |-/
     
  7. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    Unity doesn't expose any straightforward way of controlling vibration (besides many other functions) for all the different controllers out there. That's what makes an asset like Rewired useful, because the author has done an absolute ton of work making it easy to hook up many different devices in a very simple way. I'm certainly not going to attempt to do the same thing in this kit - and it would be a waste of time if all the asset creators did so.

    I'm using Rewired in my own game, and I highly recommend that other devs find a good input package too once they get to that point in their projects.

    PS don't forget that the RumbleManager simply exposes a value from 0-1, so you can use it to drive all sorts of things, such as camera shake (which is in the kit), image effects such as motion blur, and all sorts of other stuff.
     
  8. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    [QUOTE="I'm using Rewired in my own game, and I highly recommend that other devs find a good input package too once they get to that point in their projects.[/QUOTE]

    I'm waiting for a sale offer for Rewired. !!!
     
    Last edited: Feb 20, 2019
    ForceVFX likes this.
  9. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,458
    I'm waiting for a sale offer for Rewind. !!![/QUOTE]

    You should download the free trial version of Rewired and do an evaluation of it.

    http://guavaman.com/projects/rewired/trial.html
     
    frankadimcosta and Billy4184 like this.
  10. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    [QUOTE="You should download the free trial version of Rewired and do an evaluation of it. http://guavaman.com/projects/rewired/trial.html[/QUOTE]

    WOW !!! TNX !!!

    Edited: I think that the asset is overpowered for my project.
    I only need a module to allow user key bindings remapping and a vibration manager.
     
    Last edited: Feb 15, 2019
  11. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    Hi Billy. I found a (little) bug in Air Fighter AI. Planes weapons hit friendly planes (friendly fire).
    If you need it, I have a video showing this problem.
     
    Last edited: Feb 15, 2019
  12. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    Friendly fire is not a bug. Unless they are targeting their own team.

    Note that all projectiles and missiles pass to the damaged object (through the IDamageable interface) a reference to the GameAgent that fired it. So to prevent friendly fire you can go to the HealthGenerator script and check the Team of the GameAgent that is passed to the Damage function and only accept damage if it's the opposite team.
     
  13. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,458
    WOW !!! TNX !!!

    Edited: I think that the asset is overpowered for my project.
    I only need a module to allow user key bindings remapping and a vibration manager.[/QUOTE]

    Personally I like to have as much power as possible when it comes to input handling. Users always seem to want to as much flexibility as possible when it comes to input. What if a end user wants to use a controller instead of a keyboard?

    When it comes to remapping Rewired handles that also with control mapper. To me that is one of the nicest parts so I do not have to spend time handling remapping controllers, keyboard and mouse with my own code.

    http://guavaman.com/projects/rewired/docs/ControlMapper.html
     
  14. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    [QUOTE="What if a end user wants to use a controller instead of a keyboard?"[/QUOTE]

    My game will be released only for XBOX and UWP.
    Players MUST have a xbox controller.
    What i need and i asked for is a rumble/vibrate module (Xinput compatible).
     
  15. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    frankadimcosta likes this.
  16. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
  17. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
  18. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    It works !!!


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using XInputDotNetPure;
    5.  
    6. public class XInputVibrateBehaviourScript : MonoBehaviour
    7. {
    8.     float CurrenTime=0.0f;
    9.  
    10.  
    11.     IEnumerator VibrateHit()
    12.     {
    13.         Debug.Log("HIT");
    14.         GamePad.SetVibration(PlayerIndex.One, 0.50f, 0.4f);
    15.         yield return new WaitForSeconds( 0.2f);
    16.         GamePad.SetVibration(PlayerIndex.One, 0.0f, 0.0f);
    17.  
    18.     }
    19.     // Start is called before the first frame update
    20.     void Start()
    21.     {
    22.         CurrenTime = 0.0f;
    23.  
    24.     }
    25.  
    26.     // Update is called once per frame
    27.     void Update()
    28.     {
    29.         CurrenTime += Time.deltaTime;
    30.         if (CurrenTime < 5.0f) return;
    31.    
    32.         // GamePad.SetVibration(playerIndex, state.Triggers.Left, state.Triggers.Right);
    33.  
    34.         StartCoroutine(VibrateHit());
    35.  
    36.         CurrenTime = 0.0f;
    37.     }
    38. }
     
    Billy4184 likes this.
  19. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    A behaviour tree is a behaviour tree. Without having used it, my guess is that the only real difference is how easy-to-use is the interface.

    There's nothing that really makes a particular type of AI suitable or not for space fighters. You could use a Finite State Machine in a lot of cases (i.e. a bunch of if/else statements) for a solid but simple AI. It all depends on what you'd like your players to experience from the AI.
     
    frankadimcosta likes this.
  20. MMccathron

    MMccathron

    Joined:
    Feb 27, 2015
    Posts:
    12
    How effective would this kit be for an arcade style game featuring an airplane?
     
  21. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    What sort of flying mechanics are you looking for?

    The basic premise of this kit is that you have a (currently space) vehicle that has modules (e.g. weapons) that tracks targets and can lock onto them and shoot them. You can create your own flying game and use the structure, but the control script (for both the player and AI) would need to be modified.
     
    MMccathron likes this.
  22. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    MMccathron likes this.
  23. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    Hi everybody, the Space Combat Kit is on sale (50% off) as part of a bundle with some great-looking scifi cityscapes!

    BundleSale.png


    The update is going really great, and it's easier than ever to extract the parts of the kit you want from the rest of it. For example, yesterday I imported only around half a dozen scripts from the kit into my own game to get a full spaceship controller working.

    I am spending most of the development time finding the right balance between separation and structure for all the different parts. Separation is good for if you want to use small parts of the kit here and there, but too much of it results in a loss of structure and coherence. However, I can tell you that the kit is now much more of a 'box of toys' rather than a single rigid structure.

    I have also had fun integrating the third person character and car from the Standard Assets into the kit.



    I will be saying more about where I'm going with that soon. But if you are looking to make some kind of dystopian scifi combat game, this bundle might have a lot of the stuff you need!
     
  24. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    Really good news ! TNX !

    Meanwhile, I have to implement a sort of health line to activate video FXs depending on the value of health. What is the best way to get this feature ?
     
    Last edited: Feb 25, 2019
  25. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    I don't understand what you mean, can you explain a bit?
     
  26. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    Hey everyone, here's a video to show you more of what's coming in the update.

    Don't forget to take a look at the Unity Asset Store Bundle with the Space Combat Kit in it that gives you 50% off, only this week.

     
  27. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    I need to add to the vehicle a "damaged" FX effects: fire, smoke and so on.
    I need to know the current health of the armour of the vehicle.
    I tried this code, is it the right way or it's wrong ?

    Code (CSharp):
    1. MyHealtCS = GetComponent<VSX.UniversalVehicleCombat.Health>();
    2. Health.Value = (float)MyHealtCS.GetStartingHealthValue(HealthType.Armor);
     
  28. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    Instead of GetStartingHealthValue method you would use GetCurrentHealthValue or GetCurrentHealthFraction (latter is the fraction of the starting health that remains).
     
    frankadimcosta likes this.
  29. joshua_42

    joshua_42

    Joined:
    Jun 23, 2016
    Posts:
    78
    Hi Billy.
    I have separate colliders and health fixtures set up on my ship (fuselage and spacewings) and I need them to behave differently when their health reaches zero. When a spacewing health fixture is depleted I need just that part to explode (disabling the ship) and when the fuselage health is depleted I need all the fixtures to explode.
    Which scripts do I need to edit? Cheers.
     
  30. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    877
    Hey Billy,

    congrats for having had SCK selected for the Asset Store Bunde! Well done!

    -ch
     
    Billy4184 and frankadimcosta like this.
  31. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    Thanks!
     
  32. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    This is a very good question. The health setup in the kit is really not good right now and it's already mostly fixed in the new update.

    Background

    On a vehicle, you have HealthFixtures that have colliders etc and catch hit/damage events from projectiles, missiles and collisions. But they do not have any health value, they are simply a damage/healing interface for HealthGenerators.

    HealthGenerators actually store a health value, which changes according to damage/healing events sent from a HealthFixture that is linked to it.

    This separation is so that HealthGenerators (such as armor, shields etc) can be selected in the loadout menu with different costs/strengths/weaknesses.

    What Happens When Health Generator Reaches Zero

    Basically, in the ship's Health component, health fixtures and health generators are stored in linked pairs. When a HealthGenerator reaches zero health, it calls a function directly on the ship's Health component, which then takes care of deactivating the HealthFixture. This is a mistake, instead the Health Generator and HealthFixture should deal with eachother directly.

    Secondly, the HealthFixture does not get 'destroyed' as such, rather it is the HealthGenerator This is also a mistake, the HealthFixture should be destroyable. The reason why is that the HealthFixture, being an integral part of the ship prefab, can expose UnityEvents for you to hook up your functions when you are constructing your ship (such as the space wing exploding). On the other hand, since the HealthGenerator is loaded at runtime, you can't really wire up your own functions to it beforehand.

    This is all coming in the update. But if you want to go ahead and implement it, that's what I would suggest you do for your case. Otherwise, for a quick fix you can hack the Health component (where you have references to all of the HealthGenerators and HealthFixtures) to add you own specific functionality, but it would not help with separating and organizing the code.

    Hope this helps.
     
    joshua_42 likes this.
  33. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    Billy, capital ships are lost in deep space ? ;)
     
  34. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    No, not lost, it's coming in the update :)
     
    frankadimcosta, JFI66 and HeadClot88 like this.
  35. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
    Billy4184 likes this.
  36. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
  37. NlaakStudios

    NlaakStudios

    Joined:
    May 19, 2016
    Posts:
    12
    SOLVED

    Hmm, so I see nothing here on script errors right out of the box. Good to see a lot of activity and support in the thread.

    I'm sure this is minor but here it is:
    - Predator 17 Gaming / Dev Laptop running Windows 10 Pro
    - Latest Unity 2018.3.7f1
    - Latest Nvidia drivers (all drivers in fact)

    I open up GamePlayDemo scene and I get these errors:
    1) Assets/SpaceCombatKit/PostProcessing/Editor/PropertyDrawers/MinDrawer.cs(6,34): error CS0104: `MinAttribute' is an ambiguous reference between `UnityEngine.MinAttribute' and `UnityEngine.PostProcessing.MinAttribute'
    2) Assets/SpaceCombatKit/PostProcessing/Editor/PropertyDrawers/MinDrawer.cs(11,13): error CS0104: `MinAttribute' is an ambiguous reference between `UnityEngine.MinAttribute' and `UnityEngine.PostProcessing.MinAttribute'
    3) Assets/SpaceCombatKit/PostProcessing/Editor/PropertyDrawers/MinDrawer.cs(11,39): error CS0104: `MinAttribute' is an ambiguous reference between `UnityEngine.MinAttribute' and `UnityEngine.PostProcessing.MinAttribute

    ** UPDATE **
    Unity Bug? Here

    I'm sure this is something quick and EZ. I am just rusty, been away for a little over a year working in GoLang & Microservices. Here is the code:

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using UnityEngine.PostProcessing;
    4. using MinAttribute = UnityEngine.PostProcessing.MinAttribute; // <-- ADD THIS LINE AND SAVE
    5.  
    6. namespace UnityEditor.PostProcessing
    7. {
    8.     [CustomPropertyDrawer(typeof(MinAttribute))]
    9.     sealed class MinDrawer : PropertyDrawer
    10.     {
    11.         public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    12.         {
    13.             MinAttribute attribute = (MinAttribute)base.attribute;
    14.  
    15.             if (property.propertyType == SerializedPropertyType.Integer)
    16.             {
    17.                 int v = EditorGUI.IntField(position, label, property.intValue);
    18.                 property.intValue = (int)Mathf.Max(v, attribute.min);
    19.             }
    20.             else if (property.propertyType == SerializedPropertyType.Float)
    21.             {
    22.                 float v = EditorGUI.FloatField(position, label, property.floatValue);
    23.                 property.floatValue = Mathf.Max(v, attribute.min);
    24.             }
    25.             else
    26.             {
    27.                 EditorGUI.LabelField(position, label.text, "Use Min with float or int.");
    28.             }
    29.         }
    30.     }
    31. }
     
    Last edited: Mar 5, 2019
  38. MMccathron

    MMccathron

    Joined:
    Feb 27, 2015
    Posts:
    12
    The issue is a conflict with Unity 2018, I ran into the same problem myself. The solution is to change every affected script, or to quote the Developer himself;
    "These errors are conflicts between Unity's post processing stack and the Unity 2018 API. You can fix them by opening the offending script (by double clicking on the error message) and replacing every 'MinAttribute' with 'UnityEngine.PostProcessing.MinAttribute'."
     
    Billy4184 likes this.
  39. InGameGames

    InGameGames

    Joined:
    Mar 3, 2018
    Posts:
    33
    Anyone have any luck getting any of the demos to function in VR?
    The Camera isn't in cockpit when I force it over by switching the default camera to interior. The camera doesn't seem aligned with the interior either. Is there an update coming?
     
    Last edited: Mar 5, 2019
  40. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    Glad you got it solved! Yes, Unity's Post Processing Stack is unfortunately not 100% ready for Unity 2018. I will make those changes in the next update however, although it's annoying to have to modify a third party package to get it to run in Unity (Unity's own package no less!).

    Please send an email to the support (contact at vsxgames dot com) with screenshots of the issue and I will help you sort it out.

    The update is coming, I hope to have it ready by this weekend.
     
    joshua_42 and MMccathron like this.
  41. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    175
  42. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
  43. schaefsky

    schaefsky

    Joined:
    Aug 11, 2013
    Posts:
    29
    Really looking forward to the update, I already started digging in and modifying things in the SCK before I read this thread. Put that on hold now.
    Will capital ships and / or AI improvements be included in the update?
     
    JFI66 likes this.
  44. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,726
    For this update, capital ships yes, AI improvements no. However I'm well aware AI needs some work to make it more friendly and flexible.
     
    schaefsky and JFI66 like this.
  45. xsocomx

    xsocomx

    Joined:
    Apr 18, 2018
    Posts:
    30
    Can someone explain how we change the Players ship in the DemoScene? Iv followed the tutorials on you tube to create the player ship. But when I go to the demo scene there is no Ship in the player starting vehicle. These seems to get instantiated at run time. I cant figure it out. The documentation is useless :/
     
  46. schaefsky

    schaefsky

    Joined:
    Aug 11, 2013
    Posts:
    29
    You can change it via the loadout menu or modify the DemoManagerMain script.
    IMO one of the biggest problems with SCK at the moment is that there is a lot of functionality that is kind of bundled together to get things to work, which makes it sometimes hard to see where you have to change what for a desired effect.
    Looking forward to the coming update since it should adress some of these issues.
     
    Billy4184 and xsocomx like this.
  47. xsocomx

    xsocomx

    Joined:
    Apr 18, 2018
    Posts:
    30
    Thanks bud :)
     
  48. xsocomx

    xsocomx

    Joined:
    Apr 18, 2018
    Posts:
    30
    Im Just in the Loudout scene. Where exactly do we change this? Thanks in advance :)
     
  49. xsocomx

    xsocomx

    Joined:
    Apr 18, 2018
    Posts:
    30
    Never mind i just figured it out. All i had to do was add my ship to the Vehicles module in the Player Items prefab. Thanks for pointing me in the right direction!
     
  50. xsocomx

    xsocomx

    Joined:
    Apr 18, 2018
    Posts:
    30
    Is there a way to add a culling mask to the cameras view targets in the scene ?
     
    Last edited: Mar 16, 2019