Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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,462
    Can you elaborate on the problem?
     
  2. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
  3. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
  4. ShadowFenix

    ShadowFenix

    Joined:
    Nov 11, 2016
    Posts:
    7
    all my charecter in a tower one above the other one or one inside an other. what i want is that the players sapwn in a area around the spawn Spot.

    error 1.png error 2.png
     
  5. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
    @LaneFox I open the exe file, after that I just click the Play button.
    The Unity logo appears, then a black screen and the crash. see the image below
    https://snag.gy/yHOCen.jpg
     
  6. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    It works fine for me on windows 10. Are your GPU drivers up to date?

    The demo is really old, I should probably just make a new one..
     
  7. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
    @LaneFox All my drivers are updated, I run all my Unity games in my Windows 10 PC. I am very interested in purchase this asset, but I want to play and see how things works.
    I test the demo in another PC running Windows 7, it gives the same error.
     
  8. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Not sure why it isn't working for you. Runs on all the computers I've tried.

    I'll try to get another demo uploaded this weekend.
     
    fabiobh likes this.
  9. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
    @LaneFox Thank you. I will be waiting.
     
  10. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Give this a try. This is the Co-op demo, and requires a controller.

    Download.
     
  11. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
  12. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Do you want verticality? Because thats how you get verticality.

     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Nice! Any thoughts on how to implement this with a gamepad? Check vertically in the aiming direction and select the best target?
     
  14. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    It's tricky! I have to do a lot of experiments to figure this out.

    I'm building it with gamepads in mind but haven't done the implementation yet. There's an intermediate Input system that creates separation from gameplay and input so I have to build the Input Injector for InControl/Rewired. The gamepad should act 1:1 like the mouse, but that isn't the best solution.

    In the end the avatar is just responding to an input direction. I've got a high level Player class that translates raw inputs from the input system into some directions that make Avatar implementations very standardized and consistent. The tricky part is finding out the best way to use the controller input to scan the world. Deftly did this already, but when you add verticality its no longer just a matter of distance and direction, eg are you aiming at the top of a tower or at the other side of the tower? I'm looking at several ways trying to find a bulletproof solution to that issue.

    I'd be interested if you had examples of games that have this type of gameplay scenario so I could check them out. Most of the games I can think of off-hand have less extreme deviations in verticality and games like Gauntlet did level design as such that it had -some- verticality that mostly looked cool but didn't truly affect gameplay.
     
  15. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462


    Went ahead and implemented InControl to test this.

    This is what it's like with 1:1 implementation but is a real strain to accurately aim at the same place because you have to constantly apply specific pressure to the stick. It essentially behaves in the world just like the mouse but tries to keep the last input direction you used when the stick drops to zero.

    The 'bridge' scenario is a typical use case. I think one solution here might be doing a raycast to see if we can actually aim at the goal position. If not, maybe retry in a loop of rolling back the magnitude in steps and retrying until it reaches a point the player can see. At least that why it may solve the issue of "I just wanna slam the stick in that direction and hope it aims where I want" to some extent. Perhaps some vertical height limitations could be used to prevent obscure scenarios.
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    I haven't given it too much thought. Most of the games I can think of, like Helldivers and Gauntlet, design their levels fairly flat and then add a little vertical checking for stairs and the like.
     
  17. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    What is the purpose of having an intermediate input system layer? It seems like it just adding to the support burden for the asset rather than reducing it. This appears especially true if you are concentrating on gamepad support.
     
  18. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Yeah I've found most Topdown's do that. Gauntlet actually seems locked to XZ plane and ignore the Y (found a really cheap way to do this without layers/rays!) for aiming and its pretty hard to tell, even when fighting on stairs. Running With Rifles is something I stumbled across which uses more verticality but it does a basic ray to the goal and aims at it like I'm already doing here. Not sure if they support controllers though, I just played it with the mouse.

    It actually makes it simpler. Everything points to the input layer for information so when you want to implement some other 3rd party solution for input you only have to code up new InputSource to inject values into the input layer - which everything else in the game looks at. As an example, I wrote a UnityInputSource to get values from Unity's default InputModule, then spent about 10 minutes creating one that produces the exact same result for the game but uses InControl. They can be swapped out in one field as they are just ScriptableObjects.

    The value is that low level users can easily integrate new InputSources while high level users can easily swap out modules with zero risk. Most likely I'll ship it with integrations for the popular systems, so you'll never have to deal with it anyway.
     
  19. TechSins

    TechSins

    Joined:
    Feb 16, 2015
    Posts:
    142
    Any news on a new update?
     
  20. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Making progress, aiming for October.
     
    frbrz, OG_Jacob and digiross like this.
  21. fnpulido

    fnpulido

    Joined:
    Mar 17, 2016
    Posts:
    8
    Hi, I've doing some test and I can't get that the character falls when she is in the air, the character has a Rigidbody whit mass and use of gravity (really, she is Eleanor, fom the demo).

    What's wrong?

    Thanks in advance,

    Fernando.

     
  22. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Lower the drag on the rigidbody.
     
  23. fnpulido

    fnpulido

    Joined:
    Mar 17, 2016
    Posts:
    8
    Thank you @LaneFox, I do that, but I've some problems becouse the player floats when fall. I'm playing with combination of mass, drag and angular drag and works better. I'm going to try more test with the values.

    One question about InControl integration:

    I've installed InControl, imported the module and created a touch interface with a stick and one button. The stick works fine, but the button doesn't work. I see the InControl documentation and I see that I can bind any control with any action on my game.

    I've working with the demo.

    The question is: Need I to bind the button with a function that make the shoot? or Can I asssign to InControl the action that the demo uses to shoot? what is this action/function?

    Sorry because I supose that this is a very newbie question, but I've trying to know how works the framework, InControl and twoo other assets and integrate all and I've a bit of confusion.

    Thanks in advance,

    Fernando
     
  24. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    To change the mapping you modify InController.cs to suit your needs - for instance GetInputFire1() and GetInputInteract() return MyDevice.RightTrigger and MyDevice.Action1, respectively.
     
  25. fnpulido

    fnpulido

    Joined:
    Mar 17, 2016
    Posts:
    8
    OK. Thank you very much for your help.
     
  26. Relazumo

    Relazumo

    Joined:
    Jun 14, 2017
    Posts:
    4
    @LaneFox First of all Deftly has been great, I have been able to learn a ton from your code! Now I have a strange issue though. When making a weapon from scratch, the accuracy field is not working for me. I have reduced the accuracy to start at .6, but it shoots in a perfect line. I have tracked down the issue to FireRanged() function in Weapon.cs. If I remove

    if (Stats.Accuracy < 1.0f)

    The projectiles will then be properly inaccurate. Note: the accuracy function still works properly on prefab weapons you have provided, with the above code left in, so I haven't mess up the script. Do you have any idea why the script is reading the Accuracy stat on my weapon as 1 even though the curve says otherwise?

    Thank you!
     
  27. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Glad its working out for you!

    That is a pretty small optimization added so that it can bypass calculating inaccuracy rotation when the accuracy is perfect. You can safely remove the if statement and likely see zero impact, but it's weird that it would be causing the accuracy to not work in the first place.

    If your value is somehow over 1.0, or there is some weird cache/serialization problem on that prefab (value is stuck at 1.0, maybe an inspector refresh issue, or un-updated prefab) then it would be causing that behavior
     
  28. Relazumo

    Relazumo

    Joined:
    Jun 14, 2017
    Posts:
    4
    Thanks for the quick reply. I will probably just leave the line disabled then until a time where I need to optimize more. Another accuracy question. In FireRanged() as rot.y approaches -1 the accuracy modifier seems to be dampened. At -1 any gun seems perfectly accurate. Are you aware of this? If so, do you have a way to correct it?

    This is from FireRanged()
    I added the print commands in to see what was happening. "a" seems to be calculating predictably no matter character rotation, I wanted to rule that out as a problem. The second print rot.y is always very close to the first one when rotation is close to -1. I don't understand why the +Random.Range doesn't want to work in this case.

    Edit: actually it does look like it is moving the rot.y but it is still too accurate. Wasn't looking at the right digits.

    Code (CSharp):
    1.                 Vector3 pos = Stats.ProjectileSpawnPoints[_nextSpawnPt].transform.position;
    2.                 Quaternion rot = Stats.ProjectileSpawnPoints[_nextSpawnPt].transform.rotation;
    3.  
    4.                 print(rot.y);
    5.                     float a = Mathf.Clamp(Stats.AccuracyCurve.Evaluate(_timeTriggerDown), 0, 1) - 1;
    6.                 print(a);
    7.                     rot.y += Random.Range(-0.2f*a, 0.2f*a);
    8.                 print(rot.y);
     
  29. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    IIRC accuracy should be a normalized value clamped between 0 and 1. What are you expecting -1 to represent in terms of accuracy?
     
  30. Relazumo

    Relazumo

    Joined:
    Jun 14, 2017
    Posts:
    4
    Sorry if it isn't very clear.

    I was referring to the value of rot.y approaching -1. I am expecting it to represent aiming directly towards the bottom of the screen, not necessarily anything that should effect accuracy.

    I have been messing with it some more. The problem is when I aim facing the world's negative side of the Z axis all guns are perfectly accurate.

    I noticed this when setting up a shotgun weapon that shoots multiple projectiles. Aiming in other directions I can see the spread, but the closer I get to facing down the negative Z the projectiles start to stack up on top of each other. It appears it is always the same axis regardless of me rotating the game camera around. Might be an issue in the way aiming is handled?
     
  31. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Thats really weird, I definitely have not seen that issue. Have you changed any other parts of the code that would affect aiming, rotation or accuracy?

    All this really does is add a small number (within a range, based on how bad accuracy is) to the y rotation of the projectile, causing it to spawn and go either more left or more right. The facing direction of the character has no bearing, but given that you saw the Accuracy stat acting weird it seems like there are some other problems that are causing this side effect - Accuracy is basically a static value. The calculations use it as a reference over time on the curve.
     
  32. Relazumo

    Relazumo

    Joined:
    Jun 14, 2017
    Posts:
    4
    I just tested it with a fresh load of Deftly. The problem seems to still be there. Most your prefab weapons aren't inaccurate enough to really notice except the SMG, and that is only once it gets to the later part of its accuracy curve. If you up the mag cap to 90, hold down the trigger and face directly down on the Shooting Range scene you can see it. Also I dragged Eleanor outside of the building to give the bullets more room to move.

    While shooting you can aim to either side and the inaccuracy goes back to working as intended, but the closer you get to facing -Z the more accurate it gets.

    Also I am using mouse and keyboard.
     
  33. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Hmm weird, I'll try to reproduce it later tonight - thanks for reporting the issue!
     
  34. reddo1987

    reddo1987

    Joined:
    Aug 1, 2014
    Posts:
    35
    Hi,
    I found "Deftly: Top Down Shooter Framework" in the asset store and I like it very much. But before I buy I have some questions:

    1)The version in the asset store is 1.1 released 8 months ago and the Trello web page shows a lot of wishlist features but there is no one "in progress" state. I have read in the forum that you are working on it and the next release will be in October. On what are working right now?

    2)In the Trello wishlist features on the left there are the "ReWired support" but the asset store shows that your plugin support "ReWired" and "InControl". Are both supported? Is that correct?

    3)The Trello webpage is not updated?

    4)Considering that my project is for mobile and the "mobile support" in the Trello webpage is in the "Shelved (Future)" state, if Deftly support those 2 controls plugin (ReWired and InControl), is it possible to have your asset working with mobile touch controls?

    Sorry for english I'm not a native speaker.
     
    blackbird likes this.
  35. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    The Trello board is not up to date. InControl and Rewired both work. Deftly works on mobile, but is not optimized for it and there is no mobile control example scene although this is probably pretty easy to do.

    Recent work is time spent on the upgrade version, the current version of deftly on the store is stable and probably won't get any updates, there will be an upgrade price if you already own deftly 1.x, but they're definitely separate projects.
     
  36. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    how much is the upgrade price ?
     
  37. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Dunno yet.
     
  38. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    I recorded some footage from the free Alien Swarm on how the character aims. It looks like they are normally keeping vertical, and then when the cursor is over an enemy, the character automatically aims appropriately.

    http://imgur.com/iZAKG3c

    Its also a race between you and Shooter Template asset over who can implement a good Z axis aiming system first :)
     
  39. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    The vertical aiming is already implemented and working well with Kubold's animation packs. I have an animator working on custom animations but there have been some hiccups along the way in their personal life. Mine too. More like earthquakes.

    I'm pretty stoked that there is finally some decent competition for TopDown templates =) . I feel like they're still fairly different in terms of what their goals are. Deftly II is leaning heavily toward aRPG and highly flexible ScriptableObject design while it seems like this kit is more geared toward the traditional shooter like the current Deftly release is.
     
  40. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Thanks for the response. Sounds good. I tried out pistol animset pro, but was not satisfied with the animations. The character does not move naturally in my opinion. I believe they also should have used a more generic humanoid model in their videos to show off each animation. The MoCap online packs look a lot better, but perhaps because of the high price they are not as popular, and they might be missing some specific movements, particularly attacks.
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Are you sure it's Pistol Animset Pro and not the way the animations are configured on your models with Deftly? The Pistol Animset Pro animations are pretty darn close to AAA quality. You might want to check that you're using root motion, and try tweaking a couple other animation and/or Deftly movement settings.
     
  42. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    The Pistol animset animations are great (AAA) quality, but the animation controller in Deftly is mostly what makes them feel a unnatural. The Controller plays a huge role in making the animations showcase well. I'm really working to overcome this issue with the base release of Deftly II.

    For Deftly it's always going to be difficult if you use the IK system because it takes control of the arms and thus reduces cost and increases flexibility at the price of naturalness. This is true for the current release and the stuff in progress. I'm doing a lot of experimenting on the controller to try to soften up the IK system and help make it feel more natural but I'll admit that it's pretty difficult to get something generic, flexible, natural and retargetable all in a controller that supports a wide range of animations and can fallback on non-ik animations as needed.
     
  43. BilginSahin

    BilginSahin

    Joined:
    Jul 2, 2012
    Posts:
    48
    Hey LaneFox,
    1. in the "vertical" video you have a Iso Perspective. I tried this at my game by simple rotating the camera but the mouse and shooting position/direction dont match. how did you do it?

    2. when will v2 come? ;)

    thanks for help
     
    Last edited: Oct 14, 2017
  44. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    1. Can you clarify?

    2. I live in Houston and there have been some life delays recently, unfortunately.
     
  45. BilginSahin

    BilginSahin

    Joined:
    Jul 2, 2012
    Posts:
    48
    No problems with the delays ;)
    I think the problem is, that the mouse is on the ground and the character is rotating toward the position. but because he is a few meters high the shoot position should be at the mouse positon. i hope i can clarify it and here is a screenshot to help. as you can see the mouse should be at the lazer ray posi but its on the ground. maybe it has something to do with the screen position of the mouse?

    https://imgur.com/a/jxVRq
     
    Last edited: Oct 15, 2017
  46. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Thats the way the aiming is supposed to work.
     
  47. BilginSahin

    BilginSahin

    Joined:
    Jul 2, 2012
    Posts:
    48
    is there a way to fix it maybe? in your video with vertical aim it seems to working. is it from v2?
     
  48. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    It's not broken, thats how the current release works and is working as intended.

    In the update in progress, there is verticality.
     
  49. claudiorodriguescampos

    claudiorodriguescampos

    Joined:
    Jun 23, 2017
    Posts:
    98
    There's any resource in Deftly that allow the player use a shield?
     
  50. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    There is no built-in support for that.

    Also, there seems to be some bugs with Deftly + latest Unity release. Looking into it.