Search Unity

Deftly - Flexible Top Down Shooter System

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

  1. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532



    Deftly

    A flexible system for creating Top Down Shooter styled games like Dead Nation, Helldivers and Gauntlet.


    The goal is to provide a base script for each typical asset and offer enough options within them to feasibly create any type of Character, Weapon, Projectile or AI Behavior within reasonable constraints by using nothing more than the Inspector. As it stands, this is done with 4 primary scripts: Subject, Intellect, Weapon and Projectile. These scripts compose the majority of the gameplay. Other scripts include a flexible Movement controller which you can easily control the feel of the character as well as a Camera controller that allows you to modify the angle and position of the camera in editor mode without breaking any of the control setups.


    Drag-n-drop ease of use
    The current workflow is to create a prefab, add the corresponding script, customize the settings and simply begin using it in the game. While the inspectors are robust and might seem daunting, the design goal in Deftly is to have excellent output from minimal input. Once you are familiar with them you will be able to build prefabs quickly.

    With the currently exposed options in the scripts you can compile a character with a weapon, projectile, basic sounds and effects in a matter of minutes. Below are some [old] images of the major components.



    The Intellect's actually use all of the relevant data from their Subject script. For instance, Weapons that you give them. No need to build that in the Intellect, just give the Subject weapons and the AI will figure out the rest.

    Other features include...
    • No Bullet-through-paper issues. Use Physics or Translation methods.
    • Raycasted (aka hitscan) or Instantiated projectiles (traditional) can be used.
    • Prefab driven system, drag and drop interfaces.
    • Weapons can easily eject shell casings using a cheap particle system.
    • Lots of optional debug returns on every script.
    • Team based AI intelligently sorts friend from foe.
    • Also sorts most threatening target, including its allies (friendly fire). Prioritizes enemies.
    • 60+ fps in stress test with 50 vs 50 AI's instantiating projectiles.


    Minimizing the need for Complex Animation setups
    A fundamental part of the framework is a using the Mecanim IK system to handle weapons.

    Deftly allows you to define an offset from a joint (like Hips, or Shoulder) how far the weapon should be from this bone. The IK system will take it from there and you'll need no animations for your ranged weapons. The IK Proxy system will sort out where weapon should be positioned and pointing. Melee weapons still require animations.

    The demo has an example for that setup and you can always use one of the support channels to ask for additional help and clarification.

    It requires that you use the Humanoid rig option in the import settings to take advantage of Mecanim's generic bone mapping. You can use Non Humanoid - there is an example scene using Unity's Minebot.


    What about a demo?
    A demo is in the works. Until then, you can check out the trailers above or watch the gifs below.

    AI pursuit, Procedural IK weapon cycling and Eleanor (included model)






     
    Last edited: Jan 3, 2017
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    This looks like a kit I would consider.
    Only because you mentioned Gauntlet! :)
    Nice work Lane.
     
  3. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Thanks! I think you'll like the updates in the pipe. =)
     
    theANMATOR2b likes this.
  4. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    The Weapon IK system handles hands correctly, you can specify orientation and how they're placed on the weapon.

    Check out the gif!
     
    Last edited: Sep 4, 2015
  5. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    323
    This framework looks really useful and would fit my game idea perfectly. Look forward to getting it asap.
     
  6. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Such bullets. very spray. much wow

    Check out the gif!
     
    Last edited: Sep 4, 2015
    BackwoodsGaming and theANMATOR2b like this.
  7. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Tag Based collision system now lets you pop unique FX and Audio for each type of material the projectile hits! =)

    Check out the gif!




     
    Last edited: Sep 4, 2015
    cg_destro and theANMATOR2b like this.
  8. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532


    Just a quick video from the latest beta.

    All of the custom inspectors are ready to go, lots of easy buttons, toggles, sliders and tooltips to explain how things work. Currently everything is stable and working as intended. After I finish some simple demo scenes and video tutorials I'll submit to the asset store.

    =)
     
    theANMATOR2b likes this.
  9. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    They're learning.. =)

    Check out the gif!


     
    Last edited: Sep 4, 2015
    theANMATOR2b likes this.
  10. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Stress Test of 60 vs 60 AI with all features on.

     
  11. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Playing with UI for the Demo mini-game.

    Check out the gif!
     
    Last edited: Sep 4, 2015
  12. Brian-Ryer

    Brian-Ryer

    Joined:
    Mar 5, 2013
    Posts:
    43
    This looks really cool, based on how you are making the system to be easy and inspector based (thumbs up for that)
    I take it would be a straight forward proccess for me and other devs to implement other assets like our own AI and inventory etc?

    Either way this looks cool and waiting for it to reach the asset store.:)
     
  13. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Sure, it would be easy to replace the ai. There are no dependencies on the Intellect class so it's simple to strip out. The weapons and everything would continue to work normally if it was removed.

    Generally I know you guys will want to customize this and swap things out so I'm working toward making that as painless as possible. The design is simple enough for beginners to read and understand. All of the code is all explicitly written with easy readability in mind.

    I'll submit to the asset store this week once I wrap up a demo level with UI. :)
     
  14. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Submitted Beta 0.5.1 to the asset store for review.

     
  15. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    323
    Awesome! Looking forward to this on the asset store. What's the price?
     
  16. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Cool! It's $45.
     
  17. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Melee! Deftline Miami :p


    You can now create Melee weapons and use them on the player. You basically Create the weapon model/prefab and setup the collider, create prefabs of the attacks, specify stats (like dmg), type in the name of the Animator Event that fires when the attack is used, save the prefabs, then drag the prefabs onto the weapon in a list. Once you put the animation and setup transitions in your Animator its ready to go.

    Check out the gif!
     
    Last edited: Sep 4, 2015
  18. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    323
    Looking good. Any word on the asset store yet? Been checking for it.
     
  19. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Finally got word back but it was declined because all of the docs are Online. I've made an offline PDF getting started document and decided to add Melee support before I submit it again so it's probably like 2 - 3 weeks out, depending on how long the review process takes again.
     
  20. arkhament

    arkhament

    Joined:
    Jan 24, 2015
    Posts:
    114
    hi @LaneFox, your asset look really good.
    Why you dont make a web for sell ? Remember that Unity asset store get 30% from your sell..
    So if you made a web and sell in the web via paypal you can get the absolute 45 us$
     
  21. arkhament

    arkhament

    Joined:
    Jan 24, 2015
    Posts:
    114
    You can also provide faster updates to your clients, because the UAS also take a time to approve updates
     
  22. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    I thought about using something like FastSpring but I'm not sure I want to deal with maintaining two separate storefront methods when there is still so much stuff on the roadmap. I guess if there was more interest I would consider it but there isn't really much way to measure that until I get the asset onto the store and see how it sells.
     
  23. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    Yeah because of the lengthy update problems I grab anything off store when I can.
     
  24. arkhament

    arkhament

    Joined:
    Jan 24, 2015
    Posts:
    114
    not yet in store?
     
  25. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Not yet, planning to resubmit next week.
     
  26. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Super duper pewpew floating damage now added to the 0.6.0 beta.

    Check out the gif!
     
    Last edited: Sep 4, 2015
    arkhament likes this.
  27. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532


    Powerups!

    Powerups are super easy to configure, they even translate their purpose into plain english so it's clear what they will be doing. You can currently affect Health, Armor, Ammo and Magazine count.
     
  28. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    323
    This is looking even better.
     
  29. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    How extensible and open to modification is this system? For eg i'd like to use my own character controller (based on AnimFollow) and my own IK (FinalIK) and maybe drop in functionality from adventure game creator (which handily you can turn off and on at runtime) or dialogue/lovehate systems. How flexible is the AI and it it open to further modification or augmentation with other systems?

    Another thing is can it adapt smoothly to multiple players, and even in my case, one player controlling two characters, one on each stick of a gamepad?

    Given those specifics do you think it would be faster just to roll my own or can i still benefit from your system? I'm kind of looking for something that can take care of weaponry, pickups, stats, camera control (when non-cinematic and considering the need to contain two characters on one screen) level loading and save games and some fallbacks for AI and level generation while still being able to work well with other, focussed systems, do you think i'd be able to do this without a headache?
     
  30. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Currently I use an IK Proxy script on the Animator which receives data and commands from the Subject based on its state. I suppose you could probably strip it and stick your own implementation for IK in without too much trouble, a little digging into the Subject script.

    In general I've been compartmentalizing so that it will be easy to replace things with your own implementations. Controls would be a pretty simple replacement, IK would be more difficult as its tied into the Subject class which handles the weapon swapping. AI would be easy because nothing relies on the Intellect class. Just replace with your own stuff and modify it to talk to the Subject class for information. The Subject has a bunch of events you can subscribe to for feedback in other scripts.

    The Subject script looks like this.

    Partly. I have roadmap features to cover doing that but it requires a more elaborate Input system (On roadmap) than I currently have and a couple other features like camera frustum constraints. A lot hinges on the Input system, and its fairly bare-bone right now. I would avoid doing that, since you would have to addon to the input system which I'll be upgrading in the future anyway.

    The camera subsystem does handle multiple/unlimited target tracking based on averages and a couple of inspector options. Realtime modifications to its target set are no issue. I'll probably add weighting and other stuff to it later.

    I think in its current state you would be better off rolling your own. Deftly will eventually be what you want at 1.0 but it sounds like you'll have to do more integration than you would like - with how things are laid out at the moment. Also note that while there are some foundations for stat based characters and such, Deftly is more catered to single session hack-n-slash shooter games based on a semi static dataset. That means no gamestate save/load, leveling, cinematic tools, interaction system etc on the roadmap. If there's enough requests for a feature then i'm interested in designing something but this isn't an aRPG kit. I suppose you could use all of the systems as a base for that, but you'd have to do some legwork to bridge the genre's feature sets.

    You are welcome to join the Beta Group by PMing me your email address; I would be interested in your feedback and you would get a first hand look at things.
     
  31. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I can't promise i'll get round to it but then again i dont see why not, it might give me a chance to get something more finished than usual and the kit looks like a lot of fun anyway, i'll pm you
     
  32. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Ive had a quick look, it looks like a very nicely thought out system, certainly gone for a certain mindset in structure but i guess it does feel incomplete as expected. To be updated regarding my needs would end up making it ridiculously specialized so i wouldn't be making too many feature suggestions, for eg. my character controllers are Kavorkas PBC system which is somewhat a ragdoll following a mecanim state machine of canned anims, and IK as needed, and to control one in a non-fps situ is tricky, i currently have the input move a target which the character follows, rather than moving the character directly (it's a little nightmarish trying to convert all those velocities and transforms to be relative to the camera in a top down sense), and weapon switching, using etc might end up having to be pretty bespoke as the mecanim graph by necessity has a structure to deal with ragdoll to canned transitions, specifically when fallen down and getting back up, and there's no point in implementing weapons that don't take advantage of the PBC system, such as melee connects producing a proper physics based reaction to the attacker as well as the attacked, based on limb strength etc

    That said, most of my subjects end up silly ambitious and lose their way a bit, i may try and put something together using your system just to feel it out, but probably after an update or two when you're more satisfied that your system reflects your roadmap. It's pretty neat though and i can see it producing some slick results so i reckon people should keep an eye on it at the very least.

    Umm, only general suggestions i can give at the moment are probably on your list, but a greater variety of weapons, ideally with an integrated weapon creation system, so you can have the regular modern combat mainstays and rounds that will ricochet or have different ballistic properties, but something like a bulletml system, if a bit cut down, to create some really interesting firepower, and it's not currently evident of any emergent behaviour from the AI, and their properties are a little cut down at the moment. What you have is par for the course in a top down shooter which is great, but abilities like dodging, hiding (summed group morale?), friendly fire and so on would be good.. and i suppose to add to that, pathfinding done by alternatives to Unity's navmesh, i'm a bit of an aron granbergs a* fan myself

    I ended up saying more than i meant to then but hey
     
  33. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Cool, I'm glad you felt positive about it. =)

    Yeah, I've considered a lot of that but don't feel that they are critical right now. Intellect will grow in features over time, like everything else, it kind of depends on what the users are looking for though. If everyone really wants to use a separate solution for AI then I probably won't be extending it much.

    Thanks for the feedback.
     
  34. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
  35. cg_destro

    cg_destro

    Joined:
    Aug 13, 2013
    Posts:
    142
    cool! congrats on release ! :)
     
    LaneFox likes this.
  36. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Thanks! =)

    Remember if you own the package already or just want to prioritize some specific feature before buying, anyone can vote on the Trello Board.
     
  37. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
  38. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    I did Ludum Dare 33 using Deftly.

    Didn't get to spend much time on it, probably like 15 hrs total or something I think. Made a mockup Conversation system and that took most of my time. Found some practical ideas to make the Framework more useful, though.

    Check it out if you want. It's a bit terrible with a lot of bugs but hey, thats what a game in 15 hours gets you ;)

    Check out the gif!
     
    Last edited: Sep 4, 2015
  39. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Loading up on features and fixes for 0.6.5 beta!

    For instance picking up and dropping weapons on the fly, grenade style projectiles, conversation tools and more.

    Check out the gif below!
     
    600 likes this.
  40. pixelone

    pixelone

    Joined:
    Apr 16, 2010
    Posts:
    157
    @LaneFox I see you have the Simple Military character working with your shooter kit. Can you share how did that? I am running into errors. Trying to bring in my Simple Character to setup with your kit. Thanks. The animations are not playing.

    Error 1:
    NullReferenceException: Object reference not set to an instance of an object
    Deftly.Subject.CreateNewWeapon (UnityEngine.GameObject weaponPrefab) (at Assets/Deftly/Core/Subject.cs:223)
    Deftly.Subject.Awake () (at Assets/Deftly/Core/Subject.cs:161)

    Error2:
    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[UnityEngine.GameObject].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    Deftly.Subject.GetCurrentWeaponGo () (at Assets/Deftly/Core/Subject.cs:448)
     
  41. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Error 1 could be because there weapon slots, but they are empty. Check to see if your Subjects have any empty weapon slots. There should be a warning for this on the subject script. I'll look into fixing it more effectively.

    Error 2 is related, something is trying to get info on the current weapon, but there isn't any.

    Check into that and let me know.
     
  42. pixelone

    pixelone

    Joined:
    Apr 16, 2010
    Posts:
    157
    Thanks for responding, but none of those are the issue. I needed to change the Animator "Avatar" to Animations_IKAvatar. It got rid of all the errors. The new issue now is: Where do I swap our the Elanor weapon hold animations to use my weapon hold animation. For some of the weapons this is okay I don't need to change but for the other weapons, it looks weird. You seem to have a "simple character" setup already, can you share that as a custom package?

    Thanks
     
  43. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    You should be able to just use the default generated Avatar for each character. In the Import Settings for that model check to confirm that it's set to Humanoid Rig type, Generic hasn't been tested and Legacy is non-mecanim.

    If you are using the IK system then there are no Animations to swap out for holding weapons. The weapons should be configured with Targets for the left and right hands to reach to on each Weapon prefab. If you're not using the IK system and have your own animations for weapons and such I haven't got into supporting that fully yet. If you have an animation set that I can use to experiment with this then that would be great, currently I don't have enough animations to effectively test any implementation I make for it.

    I made a quick tutorial for swapping out character models:
     
  44. pixelone

    pixelone

    Joined:
    Apr 16, 2010
    Posts:
    157
    Thank you! Exactly what I was looking for. Way easier than what I attempted earlier.
     
    LaneFox likes this.
  45. pixelone

    pixelone

    Joined:
    Apr 16, 2010
    Posts:
    157
    One more thing, not related to my previous thread. I notice this error sometimes: It happens when the player gets killed as she's firing. It's refering to this line: 45 in the Move.cs script (Physics.IgnoreCollision(GetComponent<Collider>(), Owner.GetComponent<Collider>());)

    Any ideas?


    Error:
    Ignore collision failed. Both colliders need to be activated when calling IgnoreCollision
    UnityEngine.Physics:IgnoreCollision(Collider, Collider)
    Deftly.Mover:Start() (at Assets/Deftly/Core/Utility/Mover.cs:45)
     
  46. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Any plans to add multiplayer support through UNet?
     
  47. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Yup I'm aware of that one, not a major/breaking bug so don't sweat it too much. Should be fixed in the upcoming patch. :)

    It's on the wishlist, but pretty far down. There will be local multiplayer and sorting out local issues like controllers, better camera tracking and constraints, easier designer features etc before online support. You can check the Trello board for the current scope and status.
     
    pixelone likes this.
  48. pixelone

    pixelone

    Joined:
    Apr 16, 2010
    Posts:
    157
    Yes, I miss Local multiplayer. Nothing like playing locally with friends at a pub. Looking forward to these expansions.
     
  49. pixelone

    pixelone

    Joined:
    Apr 16, 2010
    Posts:
    157
    @LaneFox how difficult would it be to convert the Input into a twin stick controller? I plugged up my 360 controller and I go tit shooting with "A" and movement with Left Stick. The right stick does nothing, so wondering how much messing around I'd have to do to get it to work. I would like to keep Left stick for movement, right stick for rotation. Any help and thanks.
     
  50. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    Probably fairly simple. All of the scripts that use Inputs look for a PlayerController script for their data so all you have to do is modify the PlayerController script as needed to pull data from your controller inputs.

    I don't know how well Unity supports controllers, but technically if it goes through the Input manager you can just set them up there and reference the name of the input you want to use in PlayerController. I know they have improved this feature but Controllers are notoriously hard to work with sometimes so I'm not certain.

    Other than that you would have to change the aiming to use the stick facing direction instead of the mouse ScreenToWorldPoint. That might be tricky if you aren't much into C#.

    If I have enough time this weekend I can get the next patch done and look into some controller features.