Search Unity

[RELEASED] TopDown Engine by More Mountains [new v3.0 : damage types, damage resistance, and more!]

Discussion in 'Assets and Asset Store' started by reuno, Oct 9, 2018.

  1. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    If you want also to change your Player animation you would require to setup the animation (in the animator) accordingly (in each direction you want) and then create transitions between those based on the parameters conditions (in the example still: it's Slash1, Slash2 and Slash3 - you need to add those parameters in the player animator first).

    It's basic Animator stuff, it's just that in the 2D example the Sword has its own animations separated from the player. In 3D you would animate only the character having different sword attacks. I guess in 2D you could too but it's just how the example was made

    Disclaimer: I totally don't have any 2D knowledge, it's just based on what I saw on the Koala example
     
  2. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    For the fade object example I don't think this can really be covered by the engine (Or can it?)
    I managed to reproduce the same effect with a shader on the store (don't want to make publicity even though it's not competition. But it has Dissolve in the name and it's quite popular)
    Then I attached an invisible cylinder on my camera (make it always point forward) and use that cylinder as a dissolve mask for any materials touching it. It's really like in DOS:2, really cool effect.
    Didn't manage to integrate the shader to my trees so I was using the camera rotation for forest environments so far or any objects that doesn't use the Dissolve shader.
     
    reuno and Muppo like this.
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @CHOPJZL > I guess the easiest way to do that would be to create another class, possibly extending MeleeWeapon, just to pass that info when moving the damage area, as by default the damage area won't rotate in each direction.
     
    CHOPJZL likes this.
  4. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    In addition to the question abovr about animation flipping, does the system use unitys mecanim animator controller or is it running on the legacy style anim list?
     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    uberwiggett likes this.
  6. lobsterhat

    lobsterhat

    Joined:
    Jan 26, 2014
    Posts:
    14
    Just started playing around with the Top Down engine and I'm having trouble getting the main camera to stop swaying in the Minimal 2D scene. I can get it to stop if I tick of the Cinemachine Brain, but then a lose all the other neat features Cinemachine provides. Is there a way to switch this off?
     
  7. Koodetat

    Koodetat

    Joined:
    Apr 11, 2014
    Posts:
    14
    @reuno Do you plan to add grenade weapons ?? It would be great !
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @lobsterhat > You just have to select the CM vCam and disable (or tweak to your liking) the noise component :
    upload_2018-11-2_20-43-42.png
    @Koodetat > I'll add that to the todo list, thanks for the suggestion.
     
  9. lobsterhat

    lobsterhat

    Joined:
    Jan 26, 2014
    Posts:
    14
    There it is! Thanks, friend!
     
    reuno likes this.
  10. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88
    @reuno
    I've been a long time Corgi user and just bought this asset as well. I can't wait to dig in and use it! I'm not seeing the roadmap link. Could you point me toward it? Sorry if it's in an obvious spot and I'm missing it!

    First thing I was planning on modifying is to is facing direction change the animation being used so that the character could face left, right, toward and away from the camera (in 2D of course) so I wanted to check if that's already on the roadmap.

    Anyway, congrats on the release. I'm sure this asset is going to be just as rad as Corgi.
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @NAiLz > There's no public roadmap. That said, you can already do what you're after, without adding one line of code. Your animator already gets the x and y speed of your character. Based on that, it's easy to setup transitions to the facing animation you want.
     
    NAiLz likes this.
  12. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88
    @reuno Thanks for the reply! Good to know there's no public roadmap yet. Ahhh I like your solution better than the approach I was going to take. I wasn't thinking about it that way. Thanks for the tip! I was thinking in terms of the Corgi engine for right and left facing but this way is totally better for this. ;)

    I wondered one more thing: Do you have plans for a character selection screen for local multiplayer (like in the Corgi Engine)? If not that's fine. I'll do my own but if it's coming down the pipeline I'd rather just focus on other aspects of the game project. Thanks again!
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @NAiLz > Yes, it's been requested before, I'll add your vote to that.
     
    NAiLz likes this.
  14. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    so just picked it up but realised after fiddling with the demo that the majority of my characters are animated with arms etc, so the floating weapon system doesn't quite work. Any tips on how to tackle this issue? Should I change the weapon anims to have premade arms holding it that rotate with the weapon? or is there a way to assign the joints of the 2d character to follow the angle of the weapon? or as a third option, keep the weapon aimed left or right and not change it's angle?

    edit: not to mention they have attack animations, I assume I will need to add this in to the animator controller, but is the template already set up to allow for this?

    2nd edit: just had a more in depth look via documentation and I see you can assign the animations in the weapon itself, so for melee weapons it's all good to go, but still unsure how to handle the arm moving for guns.
     
    Last edited: Nov 4, 2018
  15. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88

    @uberwiggett I had a similar problem with my characters in the Corgi Engine. The way I solved it is to add the arms to the actual weapon sprite and changed the center of pivot to be where the shoulders would be for both the weapon sprite and the weapon attachment object in the character, like what you suggested as your second option. Then, in each of your projectile weapons you should see a script called Weapon Aim 2D. In that script you can set a minimum and maximum angle. You should be able to tweak that so that the arms don't rotate backward and the player can only fire at an angle that makes sense for your arms. Hope that makes sense!
     
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @uberwiggett > The engine is agnostic when it comes to animation. There are thousand of ways to setup a character, and the engine can't include an example of each. For the arms, you could use IK, or a dedicated script that has them look at the weapon (that'd be one line of code), or have the arms part of the weapon model as @NAiLz suggested.
     
  17. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    hey guys thanks for the responses, both answer my questions directly :)

    "a dedicated script that has them look at the weapon (that'd be one line of code)"

    I'd probably aim for this one as I'm looking to have several characters and armour sets that would alter the look of the arms, so I'd want to avoid drawing the arms with the weapons. With this one line of code, it is as simple as referencing a function built into the template or is it just a simple universal unity code? I apologise if it sounds noobish but coding is not my strong suit, and neither is 2d code :)
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    uberwiggett likes this.
  19. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88
    @reuno I'm seeing the xSpeed, ySpeed and zSpeed parameters in the 3D character controller but not in the 2D controller. I've added the parameters to my own copy of the 2D controller and I see that in the Character script, these parameters are collected but nothing I do with animation transitions, using the xSpeed and ySpeed parameters I've added seem to have any effect. I think I must be missing how these parameters are already being handled in the code.
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @NAiLz > xSpeed and ySpeed are supported in both 2D and 3D. zSpeed only works in 3D for obvious reasons :)
    If you take the Koala demo character and add a float xSpeed and a float ySpeed animation parameters to it, you'll see them update when you press play and move around. No need to code anything.
     
    NAiLz likes this.
  21. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88

    @reuno Thanks. Yeah I think my transitions just weren't done correctly. Thanks!
    .
     
    Last edited: Nov 5, 2018
    reuno likes this.
  22. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88
    @reuno sorry to keep bugging you btw!
     
    reuno likes this.
  23. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88
    @reuno I think I'm gonna have to do some code after all. Time to dig into the API. Since the Walking animation takes the Walking parameter, Walking animations and my Walking Up animation fight with each other whenever the player is moving. Any suggestions where I should look to modify this?
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @NAiLz > I don't see why you'd have to modify any code. As I said before, it's just a matter of setting up transitions. You shouldn't have a Walking animation. You should have a WalkingUp, WalkingDown, WalkingLeft and WalkingRight (maybe, really depends on your setup).
     
  25. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88

    @reuno smh. Dude I'm sorry. You're right. I was just in the wrong mindset. Don't mind me. ;) I've got it set up correctly now.
     
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @NAiLz > Glad I could help :)
     
    NAiLz likes this.
  27. CoolMambo

    CoolMambo

    Joined:
    May 21, 2013
    Posts:
    19
    Hi is there any built in way to have an AI have an inventory and drop items with different drop chances?
     
    Stevepunk and Koodetat like this.
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @CoolMambo > There is not, but it's on my todo list :)
     
    CoolMambo and NAiLz like this.
  29. CoolMambo

    CoolMambo

    Joined:
    May 21, 2013
    Posts:
    19
    Thanks I'm guessing no way to have a vendor npc's then either correct? Do you have a roadmap going anywhere?
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @CoolMambo > Again, not built-in, but very easy to do with what's already there, all the required methods are already in. And there's a roadmap of course, it's just not public to avoid people buying the asset for stuff that is not in already.
     
    NAiLz likes this.
  31. CoolMambo

    CoolMambo

    Joined:
    May 21, 2013
    Posts:
    19
    Thanks so much for the quick replies. I'll start with adding an inventory for an npc's AI and go from there to see what I can figure out.
     
    reuno likes this.
  32. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    I couldn't find that in the documentation or on the different components I've checked but: Is there a way to not pause time when opening the Inventory UI?
     
  33. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    should be able to find somewhere that mentions timescale and set it to 1 instead of 0.
     
  34. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Yes I know that but I couldn't find it on any components.
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Necka_ > As @uberwiggett said, a simple search would have pointed you towards the GameManager's handling of MMGameEvents. It triggers a pause/unpause when getting inventoryOpens and inventoryCloses events. You'll want to override this method if you want to cancel the pause on inventory open.
     
  36. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    I did search but it's not always easy to find things when there are so many ways of writing what you search for (I'm really new to coding)
    Also from past experience with Inventory it's usually just a public bool in the editor that doesn't need a method override. I totally assumed it was a setting somewhere.

    thanks
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Necka_ > It could be a setting, you're right. But technically it already is. The Inventory opening or closing doesn't trigger the pause in itself, it's your own implementation (in this case, mine) of the opening that should be responsible for triggering a pause or not. The GameManager is just an example of that, and by definition the class more likely to be overridden, as the chances that your game will have specific rules (and not just the ones implemented in the demo levels) are very high. So that's the reason behind this choice :)
     
    Necka_ and NAiLz like this.
  38. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    That totally make sense to me, it was just weird at first :)
    Also, I can't really complain, I rarely seen such clean code and comments. I'm really new to coding but I managed to override a few things from the weapon logic and I'm surprised being able to do so.

    It's not the first asset I own and honestly some people should get a look at yours and learn from it!
     
    NAiLz likes this.
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Necka_ > Thanks for the kind words! I'm glad the asset is helping :)
     
  40. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    yeah sorry mate I didn't have the project open so I couldn't be more specific, I just remembered it being handled specifically in a script component, but couldn't off the top of my head remember where I saw it. I'm noobish to coding too, this asset is pretty good for getting something up and running, just having some issues getting my character to animate properly, but that's just me doing something wrong :)
     
  41. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hi! I just ran mac demo on my old traveling macbookpro 13 (late 2012) and 2D demo ran at ~20fps at 1280x800. This laptop runs a lot of nice stuff (hollowknight and tyranny is what I'm playing now) very smoothly, what is there to lag such a simple game?
     
    Last edited: Nov 8, 2018
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @shamsfk > It's likely due to post processing effects. You can simply remove them to target old devices like these.
    On a 2016 Macbook pro it runs at approx. 160fps.
    The engine in itself is super low footprint, usually what will impact performance will be post processing and visuals in general (texture size, particles, etc). All of these are completely separate from the engine and can be easily disabled.
     
    NAiLz likes this.
  43. jingray

    jingray

    Joined:
    Feb 6, 2015
    Posts:
    53
    If asset support move 8-16 direction. Look like RPG 2D top down. Perfect.
     
  44. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    Having bit of difficulty getting a new controller up and animating properly. Have tried to create one fresh following the documentation and also tried modifying one from the existing scenes. First issue was the root motion animset I was using, but even using the base animations with the template I was getting issues where the model would end up outside of the controller collider, (usually after jumping). But my biggest issue that I just can't seem to fix is putting in extra animations such as the melee attack. Have tried it via the documentation and tried about six different variations but the animation either doesn't play, plays a fraction of a second, or throws my character model way off track. Not sure what I am doing so wrong. I will make a video showing how I put it together so if someone is able to point out what I am doing wrong it'd be handy. (I'm getting this issue on both 2d and 3d controllers so I am pretty sure it's a step I am missing somewhere).
     
  45. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    On top of setting your animation "in-place" so by checking the box in the animation to stay on X and Z position, you must also uncheck "Use root motion" on the Animator controller.
    And be sure to use Kinematic Rigidbody

    I think that was the things I've encountered first (the exact same issue you described)

    I'm almost certain the character going off track was due to the animator controller set to Root motion
     
    uberwiggett likes this.
  46. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    Hmm i know the checkbox you're talking about and i know I didn't play around with it so I will see how that affects it. It's a kubold animpack and it's telling me there are motion curves on the root, preventing me from having the option to bake the x/z pos in the animation itself. I looked up a way to modify the anims and got that worked out. But my issue feels more like the controller isn't properly triggering the animation when attacking. I'm fairly certain I just haven't set it up properly with the weapon handling script and melee weapon. Cheers for the help
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @uberwiggett > It's hard to tell what you're doing wrong without any info, but if "the animation either doesn't play, plays a fraction of a second", it looks like you need to learn how to setup transitions properly. All the engine does is send and update animation parameters, the rest is just regular Unity animator, absolutely nothing specific. I'd start with Unity's documentation about it to get started. If it wasn't playing at all I'd say maybe you didn't bind the animator properly, or forgot to name the animator parameters on your weapon, but you said it wasn't the case, so it's probably just a transition issue.
     
    uberwiggett likes this.
  48. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    Here's a video I put together showing what I've done, using the loft scene and default controller. I've used the animator controller plenty of times with other assets, but I followed the documentation on the TDE website to implement the features but not getting the results. Only thing I have noticed with the documentation is the weapon animator ID field, that doesn't exist on the documentation page so I assume it's from a newer version?



    video is unlisted so won't appear in searches etc, but if I can solve the issue I'll put together a mini setup video so others can see how to put a character together.
     
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @uberwiggett > In your video it's clearly visible that the engine does its job and updates the parameter (at 0:52 for example). Now as I said, you may want to work on your transitions a little, as your video also clearly shows your animator is going to the walking state, as it should if you haven't changed anything from the default controller.
    So again, it's just about setting up a proper animator setup, with proper transition conditions. The "any state" pattern might work fine for me and for a demo, but if you want to make changes to it I'd recommend sticking to a more traditional setup, especially if you're not super familiar with the system. Again, absolutely nothing specific to the engine here :)
     
  50. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    uhh, ok, but you also see that the transition is the same as the dash, which works fine and plays the full animation, but the attack does not. Is there something in the weapon script I need to look at in order to change it so it plays the full animation? Also, I have followed the documentation that you have put up on how to add an attack animation to the controller, and this is the result I am getting.

    edit: specifically, this page https://topdown-engine-docs.moremountains.com/weapons.html