Search Unity

Deftly - Flexible Top Down Shooter System

Discussion in 'Assets and Asset Store' started by LaneFox, May 27, 2015.

  1. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I already tried commenting that out then got this instead 'Assets/Deftly/Core/Editor/E_PersistentHandler.cs(12,13): error CS0246: The type or namespace name `PersistentHandler' could not be found. Are you missing a using directive or an assembly reference?' at which point i didn't know how to proceed, having used find in files in VS to find other occurrences of 'InControl'
     
    Last edited: Jul 12, 2016
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    Thanks, I'll clean it up. The file should be in co-op package instead of core.
     
  3. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    Okay, I cleaned up the errors and changed the PlayerController to be extendable.

    If you want to use InControl now, the CoOp unitypackage contains the InController.cs script which will replace PlayerController. It's an override class so will be a lot easier to maintain and PlayerController is now really easy to extend if you wanted to override something or remap controls. I looked for a way to prevent having to replace the script but I did not find that anything else was as clean and maintainable as doing it this way.

    I fixed all the bugs I could dig up in the co-op demo, so give it a try. The same link in the beta group is updated and valid.
     
    TonyLi likes this.
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    I haven't tested Deftly's built-in co-op yet since I had already implemented my own co-op, but after following the update steps in the beta release notes everything seems to be running great!
     
    LaneFox likes this.
  5. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    This is coming along really nicely, very tempted to do something regarding commitment with it. One odd bug i found was in the main demo at least, you could swap through weapons (i added a few to the list) but when you got to the last weapon via scrollwheel, or even new keys i bound the control to, you can't switch back, although switching between weapons when not the last on the list is fine
     
  6. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    Hmm weird I look into it, thanks for reporting it :)
     
  7. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Upon reading the manual I saw that vertical aiming was 'somewhat' working but not fully supported, do you have any plan as to where to take that? And can I use it as it is and see how much mileage I can get? This to my mind the only real issue I can think of so far that makes it a little awkward for my ideas
     
  8. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    Do you mean in the Limitations section about varying height? It's referring to movement vertically (slopes, etc.) which you can support by changing how your Rigidbody's are setup. The original demo's deliberately locked them on the Y for stability, so it appeared to be unsupported. Vertical aiming is more to tackle, unfortunately.

    To explain, Weapons create Projectiles at their Spawn Points position/orientation. If you use IK then a direction is fed into Mecanim to position and aim the character's Hand (holding the weapon) directly forward. If you don't use IK then it falls on the Animations to aim.

    The first scenario (IK, humanoid, data driven) should be somewhat straightforward to do - modify IKProxy to take into consideration where the character is aiming and align the IK target position to the new direction. I do plan to add this at some point. The biggest problem I can think of is when using Controllers you can't really dictate how far out you are aiming so it becomes a bit ambiguous where you are actually intending to aim, whereas a Mouse position is absolute.

    The other scenario (animation driven) is not something I have a solution for right now because of all the possible scenarios like non-humanoid rigs, inaccurate animations, etc so there are several solid things in the way of a proper implementation of varying vertical height aiming. I don't have an ETA, but it is on the roadmap.
     
  9. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    0.7.5 is issued for Review. Look for the update in the store in a few days.
     
  10. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    Hi wanted to check if shooting enemies is click/tap on enemy to shoot.
    How the player animations like walk, shoot are triggered.
    Also about mobile support.
     
    Last edited: Aug 4, 2016
  11. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    There isn't any special built-in mobile support right now. Everything is designed for controllers or keyboard/mouse.
     
  12. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
  13. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    323
    Can anyone suggest the best way modify the code so that when the asset gets updated my custom code isn't wrecked? Thanks
     
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Ask Lane to add hooks so you don't need to modify the code directly -- things like UnityEvents or C# events. What are you modifying? I'm just curious since I've made my own modifications, too -- most of which I haven't needed to add back in after updates because Lane has been awesome about adding them into Deftly itself (such as custom damage types and damage resistance).
     
    LaneFox likes this.
  15. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    The best way is by making the core scripts have hooks and more extension support where needed like @TonyLi mentioned. Changes to make it extendable are generally pretty easy to add - and good for the product. If its new features then it might be something that fits into the core scope and I could implement it directly - like Damage Types were, for example. Either way I try to be aggressive with modifying the product to support your needs, just let me know what it is you need or what you're aiming to do.
     
  16. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    FYI If you're using Unity 5.4.x you will probably get an error when importing the CoOp demo. Not exactly sure why it doesn't seem to happen in lower versions, but an update is on the way to the store to fix it. It probably won't ping you as an update since there is no version change.
     
  17. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi! your asset looks very interesting. Only one thing is worrying me before buy - NavMesh. In my game players can construct levels in runtime, is there any option for AI to use some dynamic pathfinding like breadcrumbs?
     
  18. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    It uses built in nav mesh which doesn't support runtime baking. You can use a custom solution, you'll just need to replace the code in the intellect script.
     
  19. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    323
    Has anyone tried implementing click to move like Diablo? Would it be possible? or maybe feature request?
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    I had a free minute to check out Deftly's root motion controller for Pistol Animset Pro (looks great, btw), and I thought I'd mention a tip for anyone else planning to use root motion. The demo character's Animator component is on a child GameObject. If you're using root motion, move the Animator to the character's root GameObject. Otherwise the root GameObject won't move with the character. You'll know this is the case if the camera fails to follow your character, since the camera follows the root GameObject. Also remember to tick the root motion options on the Animator and PlayerController (or InController if you're using InControl).
     
    LaneFox and hopeful like this.
  21. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    Quick FYI (co-op)
    Make sure InControl is imported, then import it by using the .unitypackage in the Addons folder. Make sure the two demo scenes are first and second in the build settings or else the menu wont render correctly. A dumb limitation I overlooked and didn't document when I made the demo.

    Feedback request for hooks
    I'm getting more requests for hooks, but they're non-specific. If you would like certain variables and methods to be virtual then me know which specific ones you need or what areas you're generally working on, or give some examples of other parts of the code you've had to change which could be solved by a hook or change to core code.

    Thanks
     
  22. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Hi, I am really liking the features in the deftly shooter. I wanted to add a dodge/roll/evade feature . So the player can evade in the direction the player wants. Can you guide me how to implement it ? I have the roll animation ready and I have set up a isdodging bool in the animation controller below the overrides layer . I need your help with the physics part and also where to add the input. I am using the inController.cs for input .

    Here is a link to what I want to achieve .



    Also please check the answer on this link if this will work . And please also guide me where I can add the input key for dodging .

    http://answers.unity3d.com/questions/618735/rolldodgeevade-system.html

    Thank you .
     
  23. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    If your animations are using Root Motion you can setup an input to modify isDodging on your Animator and let the animations move the character. Make sure to toggle InputPermission off while you're playing the animation.
     
  24. xagarth

    xagarth

    Joined:
    Sep 7, 2016
    Posts:
    17
    Hi Lane,

    First of all, many thanks for the module. It's really cool.
    I've been playing around with it for a while, added some custom stuff, like bonus stats and made the damage be affected by stats and so on.
    I've been thinking of how to implement a flame-thrower weapon and I was wondering if maybe you could give me some hints?

    I'm using raycast type weapon, I've been able to attach a particle system to a spawn point (not ideal yet, but it's there).
    Then, there's the question of fire type. I want this particle to be continuous. I've tried to add new firing type and handle that in weapon type ranged, but it seems a bit tricky.
    Also do you think there's a way of making particles actually do damage instead of a raycast?
    That would be more natural. I've tried simply attaching projectile script to it, but no luck.


    Hmm... I just realized that I could change RayFX() and instead of this simple renderer put a particle system in.
    Interesting.

    Anyway, can we have particle system act as damage dealer?
     
  25. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    Glad you're liking the framework and making use of the stats foundation!

    I've thought a bit about how a flamethrower might work in the past, but never got around to making one. I figured there are quite a few ways to approach it and a lot of viable options but I think the best options IMO would require a custom script on a regular projectile. Fortunately the Projectile is just a Prefab so you can basically customize them however you want.

    I would start with using a slow traditional projectile with no visual representation that handles hits, then have a separate particle system on the weapon that sprays particles into world space at a rate and speed that follows those slower projectiles as well as possible. You'd just have to toggle the firing on and off by observing the Weapon script. If you had a metaball system that could actually be pretty amazing with that kind of setup. This is probably the simplest, quickest and one of the cheapest ways to do it.

    I believe you can hook into the Particle System's collision per particle but there are issues with doing so. I would imagine that could get expensive if you have a lot of particles - they already can be and often miss collision checks, and it would be difficult to control how much damage the flames do since more particles would probably mean more damage. Pretty flimsy without some extensive custom management.

    I've seen other games do it where the flame is a child to the character and is very consistent in size, spraying out in local space to the max distance quickly and staying there so you can use a static trigger size to check for damage. You could also do it with world space particles but the key is getting to a consistent shape quickly so you can just use a simple box as the damage volume. This is a pretty cheap way to do it and really controllable. Other methods will probably require the particles to be separate from whatever system you have to actually detect hits and apply damage just for the sake of performance. Maybe there is some particle bounds variable in the Particle System that might help determine the area for damage?

    But, this is also getting more custom so I'd suggest sticking to what you have or trying the slow projectile way with a small custom script that handles turning on and off a separate flame particle spray.
     
    Last edited: Sep 7, 2016
  26. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    Also, you'll be happy to know that the next update makes all methods virtual so you'll be able to maintain and extend with your own custom scripts while not risking the code being demolished when I update the package and Unity overwrites the core scripts on import.
     
    TonyLi likes this.
  27. xagarth

    xagarth

    Joined:
    Sep 7, 2016
    Posts:
    17
    Hi LaneFox,

    Many thanks for your prompt reply!
    I'll try this out tonight and during the weekend.

    I'm not entirely sure what you mean by observing weapon. Like a, C# observers? I haven't seen that in the code. I'll try to figure this out.
    Maybe I'll just hook some some custom functions to FireRanged().
    As for collision, I was thinking more about this big, think ray, instead of projectile.
    Anyway, I will try out your suggestion.

    Many thanks!
     
  28. xagarth

    xagarth

    Joined:
    Sep 7, 2016
    Posts:
    17
    P.S

    You might want to tune Projectile.cs a bit to check if muzzleflash actually exists, otherwise it throws gazillion of errors.


    private void DoMuzzleFlash()
    {
    if (AttackEffect)
    {
    StaticUtil.Spawn(AttackEffect, transform.position, transform.rotation);
    }
    }

    You might also want to have a look at PopFx(). If you remove all the impact effects it will fail. You need to check if list length - 1 is >= index, otherwise it will fail.

    2nd P.S

    I do have some issues with attaching things to weapon spawn point and making this spawn point a parent.
    My object (particle system in this particular case) has ok position and rotation when it doesn't have any parent attached and it's spawned with spawn point position and rotation, but if I'll attach it to spawn point, it's getting crazy position and rotation. I think this has something to do with IK, weapon positioning, hand rotation, etc.

    Any hints how to use it properly so my stuff will not point in the sky?
    Sorry for n00b questions, but... I'm n00b in Unity ;-)

    As for now I update particle system position and rotation in Update(), but I don't think it's how it's supposed to be.
     
    Last edited: Sep 8, 2016
  29. Sanaichi2115

    Sanaichi2115

    Joined:
    Dec 26, 2012
    Posts:
    4
    Allright, just bought this module, its very neat, it's all nice..
    But. How do I make that image with weapon/ammo/health/armor?
    i presume it is used with another camera that looks upon the image, or what?
     
  30. Sanaichi2115

    Sanaichi2115

    Joined:
    Dec 26, 2012
    Posts:
    4
    Nevermind, scratch that, just got it working with everything.
    Have I said already that this kit is great?
    Very versatile, very versatile indeed. I'm most curious to see how good it is. :)
     
    LaneFox likes this.
  31. Sanaichi2115

    Sanaichi2115

    Joined:
    Dec 26, 2012
    Posts:
    4
    I've ran into a bit of a trouble. I hope I'm not hogging the thread?
    I cant get restart of the scene to work with yours CharacterUI. Everything comes up when I die, that's alright. But.
    The button itself will not light up when I mouse over it. And, when i click the button, nothing happens.
    As if the button itself is not active.. but it is.
    Have no scripting errors, so dunno. Gotta be that I have configured it wrong.
    The most misterious part is, I configured it the samee as in demo scene. In demo scene it works, but in my scene - nope. :)
    How to configure it properly? Haven't found any documentation on the subject..
     
    Last edited: Oct 14, 2016
  32. gamedevluuk

    gamedevluuk

    Joined:
    Jun 23, 2014
    Posts:
    12
    Hi!

    I was just trying out this package with some mech models.
    I have tank movement already working (turret rotates while the base does the movement) but now want to have multiple weapons. Is it correct that you at the moment only support one Weapon Mount? My mech has a gun on each side with double barrels.

    As far as I saw I can do the double barrel part with multiple spawnpoints just like the SMG example, but what about multiple weapon mounts? I know I could make one weapon with 4 spawnpoints but the mech uses upgrades so each barrel can be replaced by another weapon.

    Thanks!
     
  33. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    Correct, only one weapon mount is supported. When I considered supporting that I didn't think the feature would have much application and decided not to do it. I figured if I wanted to equip multiple weapons then they would likely be the same type and I could just make a second prefab and double the weapons and spawn points, making something like the SMG with multiple barrels but on different weapons. Basically faking it.

    You could make your own Weapon class and observe the firing bool. Use one normal weapon in a 'primary' slot, then all the others your observer weapons. There are other things to consider if doing this, but it might be worth looking into.

    The next update makes all classes Virtual so it'll be easy to derive. Actually I haven't had any bad feedback in a couple of months so with a couple of minor requests pending in my emails the next update will probably be 1.0.
     
  34. gamedevluuk

    gamedevluuk

    Joined:
    Jun 23, 2014
    Posts:
    12
    Thanks for the fast reply!
     
  35. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    Just sent an update to the store, this makes all methods virtual and adds a couple of requested Get methods and minor changes. There are still some outstanding known issues, but stability is reportedly good and the virtual method change is a significant step for making it easy for you to extend the core scripts so making this update 'version 1.0' felt appropriate.

    BACKUP YOUR MODIFIED SCRIPTS BEFORE UPDATING FROM THE STORE TO 1.0 WHEN IT LANDS!
    Since everything was touched, Unity will replace all the scripts on import. You'll need to do some legwork here to merge your code and setup override scripts. Also, when replacing scripts with overrides remember that you can Copy/Paste components (values) in the inspector in their entirety. That makes data updates pretty easy.
     
  36. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Does this update include Rewired support? I see Rewired listed on your trello. Is there a list on your website that shows what asset integrations you have or support?
     
  37. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    No rewired support yet, InControl is the only official supported addon at this point. I did get a version from the author though, so I'll look into rewired next.
     
  38. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Thanks. Looking forward to the Rewired integration.
     
  39. ShadowFenix

    ShadowFenix

    Joined:
    Nov 11, 2016
    Posts:
    7
    i have problems with de co-op demo,i cant enter to de second scene after i choose de characters.
    Also i dont know why but i cant use INControl(Demo,UnityProject)
     
    Last edited: Nov 11, 2016
  40. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    You have to add the demo scenes to the build settings, the Menu as scene 0 and the other coop demo scene as scene 1.
     
  41. ShadowFenix

    ShadowFenix

    Joined:
    Nov 11, 2016
    Posts:
    7
    i dont know why buti dont know why but i cant use INControl. i change Player controller with In Controller and nothing happen. (Sorry for my bad english)
    aLSO I CANT MAKE A DEFEAT STATE.
     
    Last edited: Nov 14, 2016
  42. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    What is specifically not working? Is there any warnings or errors in the console?

    If you only have one player then you can just use 0 as the input device and it will use any active controller, so as long as there is an InControl Manager script in the scene, it's going to work. Try one of the demo characters, if you made one from scratch there could be other issues preventing movement like 0 speed or bad animations or bad animator parameter names.

    If you want more than one player then you'll need to check out how the Co-op demo scenes handle sorting the registered controllers and attaching them to Players. Make sure the two scenes in the Coop demo folder are in the build settings, then run the Menu scene and it should respond to any controller inputs. Check out the gameobject named '_Persistent' to see how it is setup.
     
  43. ShadowFenix

    ShadowFenix

    Joined:
    Nov 11, 2016
    Posts:
    7
    i want with one player, and follow the steps and the player doesnt move( i am using Eleanor of the demo), i dont know why because in de co-op demo works fine
     
  44. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    Did you add an InControl Manager to the scene with Eleanor?
     
  45. ShadowFenix

    ShadowFenix

    Joined:
    Nov 11, 2016
    Posts:
    7
    in a new scene with Eleanor
     
  46. Rozx

    Rozx

    Joined:
    Mar 24, 2015
    Posts:
    8
    Hello LaneFox, just bought the asset, it's really amazing and i love it.
    One thing you seems forgot to do is make all functions and classes in editor virtual, therefore i have to change them myself.
    Or did i do it wrong? Is there anyway to inherit a class with same editor view?
    Also, it seems copy/paste component value between original and driven components is not available, anyway to figure it out?

    BTW, there is a debug.log(GetSprint) in the player controller script. I think you should remove it in the next update.

    Thanks : )
     
  47. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    I think the reason I did that was because OnGUI is always virtual so you can just override it but you're right, they should also be virtual as well for easier extension. I'll send the update today, but the Store team will have to review again. I can get you a package sooner if you PM me your email address.

    Sorry about that! Fixed - thanks for letting me know =)
     
  48. Rozx

    Rozx

    Joined:
    Mar 24, 2015
    Posts:
    8

    Great! I will PM you now. :D
     
  49. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,518
    Sent it over, thanks =)
     
    Last edited: Nov 16, 2016
  50. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    i got the latest update but i was unable to pick weapons from the ground by tapping space