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

    kristof2000

    Joined:
    Oct 15, 2016
    Posts:
    36
    i meant ragdoll physics so they walk around funny ;)
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @kristof2000 > As I said, that depends on your skills entirely. If looking at the documentation didn't answer that question for you, then it's likely the answer is you're still a bit early in your Unity journey, and it won't make things easier for you, and you'd better use another tool.
     
    miahmauga likes this.
  3. Poppa80

    Poppa80

    Joined:
    Nov 25, 2017
    Posts:
    8
    Hi Reuno, I've been having a play with the engine for a couple of months now and really loving it so far. I was looking for some advice if possible as I'm having a few issues with my weapon reload animation. I've followed a similar setup to your Loft player, but I can never seem to get the reload to look nice like the Colonel prefab and always seem to be fighting with the IK during animation (I think). I've changed the Blending in the Animator reload layer to 'override' which looks a bit better but still not right. I noticed the colonel's weapon is setup as a 'Weapon Model' and a child of the right hand and wondered if this is one of the main reasons I'm having difficulties?
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Poppa80 > You could disable IK for the duration of your reload animation, or indeed go the Colonel way, which doesn't rely on IK, but instead on "perfect" animations. It's definitely the way I'd recommend if you're going for fidelity, IK only gets you so far.
     
  5. Poppa80

    Poppa80

    Joined:
    Nov 25, 2017
    Posts:
    8
    Okay thanks for the suggestions Reuno, I will have a play and see what I can do. If I do go down the route of using the Weapon Model method like the Colonel, I'm planning on having the player select their loadout from a selection of guns prior to the start of the level, could you foresee this method being an issue?
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Poppa80 > Not at all, just be aware you'll need animations for all of these. Most of the time I would expect you to be able to share animations across weapons (all handguns could share similar animations, most rifles, etc), but you'll need as many sets of these as you have weapon "families".
     
    Poppa80 likes this.
  7. Poppa80

    Poppa80

    Joined:
    Nov 25, 2017
    Posts:
    8
    Great stuff thanks for the speedy responses :)
     
    reuno likes this.
  8. SwagGrandma

    SwagGrandma

    Joined:
    Oct 20, 2019
    Posts:
    1
    Hello! I am currently using Unity Version 2021.3.8f1, I think I may have found something unintended or maybe I'm stupid that's why I'm here haha. Using the MinimalSandbox2D scene with the KoalaDungeonPortal, changing the SimpleObjectPooler to a MultipleObjectPooler you obviously are given an array of elements with multiple objects you can slot in. If you have 2 elements, each element contains an "Enabled" Boolean. If element one has a pool size of 1 and enabled = true, and element two has a pool size of 2 but enabled = false the timed spawner will spawn regardless of the enabled being true or false 'spawn' 3 KoalaNinjas; however, if all elements Enabled boolean is set to false. Nothing will be spawned. I have linked a short video showing the components and what is happening.

     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @SwagGrandma > Answered you already via email, but putting this here too in case it helps anyone else :
    It looks like you've set both elements to be the same prefab, so that's indeed the expected result.

    Here are steps that will work :
    - fresh install of TDE3.0 on 2019.4.40f1
    - open MinimalSandbox2D
    - duplicate the KoalaPoolableNinja twice (into KoalaPoolableNinjaAlt1 and KoalaPoolableNinjaAlt2, change the sprite color of both of them to differentiate them, I went with green for alt1 and red for alt2).
    - unpack the KoalaDungeonPortal in the scene, remove its simple object pooler, add a MMMultipleObjectPooler instead, PoolSize:3, set the regular poolable ninja in slot 0, Alt1 in slot 1, and Alt2 in slot 2
    - uncheck PoolCanExpand on all of them, and set pool sizes like so : element 0:1, element 1:2, element 2:3
    - set enabled:false on elements 1 and 2, press play, activate the portal, only one regular ninja will come out of it
    - set enabled:false on element 2 only (others set to true), press play, activate the portal, a regular ninja and two green ones will come out
    - try other combinations, they should all work as expected
     
  10. durucagatay01

    durucagatay01

    Joined:
    Jun 9, 2018
    Posts:
    1
    Hello reuno first of all thanks for the engine, its worth every cent. For my question do you have any advice about optimizing for mobile specifically on this assets?
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @durucagatay01 > The engine itself (the gameplay code) is already optimized for mobile, so you don't have to do much on that side. So optimization will really depend on your performance budgets, and your own assets.
    On the engine's side you'll want to make sure you use behaviors that are tailored to your target budgets. If you decide to put 200 advanced AIs on a low end Android phone, you're bound to run into issues. But if you go for simpler behaviors, and use (for example) the proximity manager, you'll alleviate a lot of it.
    So really regular optimization techniques apply, optimize your shaders, optimize your assets loading, optimize memory, texture sizes, etc. Use your profiler to identify your bottleneck, whether it's CPU, GPU or memory, then establish budgets based on your target devices specs, and then prioritize and implement your features based on that.
     
  12. dorraba

    dorraba

    Joined:
    Apr 21, 2020
    Posts:
    2
    In the minimal 3D example
    I created a new Box, added it a rigid body and created a new Layer for it called "pushables"
    When I run the game, the player wont push the new Box. But if I put the box under the "enemies" layer, it starts being pushable. Why is that? How can I make the pushable layer work?
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @dorraba > Answered your email already.
     
  14. miahmauga

    miahmauga

    Joined:
    Mar 27, 2020
    Posts:
    4
    Hi! How would I go about implementing a check to see if the player is walking backward (Not facing the weapon direction) so that I can lower the movement speed and play the back-pedaling animation? (2D by the way)

    I'm pretty new to TDE and Unity so I'm guessing my approach would be to have a function constantly checking the player's current facing direction relative to his current moving direction?

    Something like this...

    SomeFunction()
    {
    if (playerFacingDirection != playerMovingDirection)
    Slow the Player down
    }

    Any tips or advice would be helpful :3 Thanks!


    *EDIT*

    Nevermind lol....

    Code (CSharp):
    1.         protected virtual void BackPedalCheck()
    2.         {
    3.             Debug.Log("Current Direction is " + _controller.CurrentDirection.ToString());
    4.             Debug.Log("Current Facing Direction" + _character.CharacterModel.transform.localScale);
    5.  
    6.             if (_controller.CurrentMovement.x != 0 && _controller.CurrentDirection.x != _character.CharacterModel.transform.localScale.x)
    7.             {
    8.                 Debug.Log("BACK PEDALING");
    9.             }
    10.         }
    Figured it out <3 Thanks anyways!
     
    Last edited: Oct 19, 2022
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    miahmauga likes this.
  16. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Hello- did fresh install of TDE and installed new input system

    Gettting spammed with these errors in the the Minimal2d scene


    Its these lines
    Code (CSharp):
    1.     _prevInvKeyPressed = Keyboard.current[PrevInvKey].wasPressedThisFrame;
    2.                 _nextInvKeyPressed = Keyboard.current[NextInvKey].wasPressedThisFrame;
    Also it seems like the toggle inventory menu key is not mapped- when using the built in input the SELECT key on an XBox controller toggled the inventory menu- when switching to the new input system the SELECT key does nothing-

    Looked at the inputActions and I don't see a mapping for toggling the menu


    Ideas for quick fixes? Thank you.
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @imaginationrabbit > The current version of the Inventory Engine included in TDE doesn't have support for the new input system, only TDE does. The next TDE update will bring the latest version of IE, which has added input system support.
     
  18. miahmauga

    miahmauga

    Joined:
    Mar 27, 2020
    Posts:
    4
    reuno likes this.
  19. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Ok thanks for the quick reply- I have a little experience with the new input system so I guess I'll have a go trying to map them myself. Thank you.
     
    reuno likes this.
  20. miahmauga

    miahmauga

    Joined:
    Mar 27, 2020
    Posts:
    4
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @miahmauga > Sure, the orientation 2D ability will give you facing directions, the movement ability will give you movement direction, it's just a matter of comparing them.
     
    miahmauga likes this.
  22. Poppa80

    Poppa80

    Joined:
    Nov 25, 2017
    Posts:
    8
    Hi Reuno, is it possible to use the Weapon model method with an inventory? If so, is there an example somewhere in one of the demo scenes I can refer to? I'd like to be able to switch between 'Weapon model' weapons so I've added 2 to an inventory and put their respective models on the player and when I press 'T' to swap/equip them they seem to work and fire but the models are not being enabled (they work fine normally outside of the inventory). I've looked over the documentation but can't seem to find a definitive answer - apologise if I've missed something! Also, for some reason when I press 'T' another instance of the weapon seems to be added to the inventory each time.
     
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Poppa80 > Yes, it will work with inventory weapons as well. These steps will work :

    - fresh install of TDE v3.0 on 2019.4.40f1
    - open the LoftSuit prefab, add an empty object to it, name it MyWeaponModel, add a WeaponModel component to it, set its WeaponID to Handgun
    - add a Cube, remove its box collider, on MyWeapon’s WeaponModel inspector, drag the cube into the TargetModel slot
    - press play, grab the handgun picker (it's the blue one), equip it

    The beautiful result :
    upload_2022-10-20_12-43-34.png
     
    Poppa80 likes this.
  24. Poppa80

    Poppa80

    Joined:
    Nov 25, 2017
    Posts:
    8
    @reuno That's got it thanks. The ID on the scriptable object was slightly different to the weapon model. I thought it was the ID on the projectile weapon script which was enabling/disabling the model but following your instructions above allowed me to work it out. Thanks again.
     
    reuno likes this.
  25. matzomat

    matzomat

    Joined:
    Mar 4, 2018
    Posts:
    63
    Hey Guys,

    great asset, thank you!

    Have a small problem though, it's clearly a mistake on my part. I deleted the existing level and just created a plane. Gave it a box colider and started for testing. But characters won't animate and the animation walking parameter never gets true. The character is on the plane and I can move the character asusual but no walking animation is playing, because the boolean walking animation parameter never gets true.
    What am I doing wrong?
     
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    matzomat likes this.
  27. matzomat

    matzomat

    Joined:
    Mar 4, 2018
    Posts:
    63
    Thank you! That was the problem.
     
    reuno likes this.
  28. miahmauga

    miahmauga

    Joined:
    Mar 27, 2020
    Posts:
    4
    Hi!

    I am getting started with Netcode for GameObjects for some basic multiplayer. Do you plan on making any tutorials implementing this? Would pay for it!
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @miahmauga > No, there are no such plans at the moment, mostly because a tutorial wouldn't accomplish much, there are as many implementations as there are possible gameplay rules, server architecture choices, matchmaking needs, etc, and there's nothing specific to the engine when it comes to that, it's done like in any project.
     
    miahmauga likes this.
  30. Frankie3

    Frankie3

    Joined:
    Jan 29, 2014
    Posts:
    13
    I found a bug I would like to report. The GoToLevelEntryPoint does not set the correct direction after loading the new scene.
    Repro steps
    1. Load Minimal Scene 2D Doors
    2. Go through first door to second room in scene
    3. Go through blue or green door to load a new level
    4. Take note of the direction the player is facing
    5. Stop the game and on the same door you walked through change the direction on the GoToLevelEntryPoint script
    6. Save and replay the level
    7. Follow steps 2-4
    8. Player is still facing same direction even though it was changed on the GoToLevelEntryPoint script

    Issues seems to be the CharacterOrientation2D ability has the _initialized flag to false when the player is reloaded and the InitialFacingDirection is overwriting the GoToLevelEntryPointDirection.
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
  32. nanase

    nanase

    Joined:
    Feb 28, 2021
    Posts:
    10
    Hello, I now want to extend a rolling ability. I try to write code like jump. At present, I have implemented the function of pressing the button to make the character roll, but I found that after setting _movement.ChangeState(CharacterStates .MovementStates.Rolling); After that, I can't put it back to the idle state, and I don't see the relevant code in the jump ability.
     
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @nanase > I'm not sure I'd look at the jump for a roll ability, dash would be more appropriate. As for setting back the movement state to Idle, as you can guess, it's done in the same way :
    Code (CSharp):
    1. _movement.ChangeState(CharacterStates .MovementStates.Idle);
    Right clicking on the Idle state in your IDE will point you at plenty of cases where this is called.
     
  34. nanase

    nanase

    Joined:
    Feb 28, 2021
    Posts:
    10
    Thanks, Dash can solve my problem, then I have another problem, when I dash to the left, when the dashing animation is still executing, the character will still turn when I press other direction, is there a way to make the character in not turning when dashing
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @nanase > Sure, you can disable input while your ability is active.
     
  36. nanase

    nanase

    Joined:
    Feb 28, 2021
    Posts:
    10
    Hello, I still have a problem, when I press the arrow keys, the character will face the direction I pressed, but my current requirement is, when my character is facing the left, gently press the right direction , the character turns a small angle instead of turning directly to the right
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @nanase > there's no such feature in the engine, you'll have to implement it, that'd be done like in any project.
     
  38. rugang

    rugang

    Joined:
    Oct 30, 2022
    Posts:
    2
    Hello there, I'm only start to learn to use this Top Down engine recently. I'm running into a problem with the xbox controller in the Koala 2D demo scene. I can't seem to get the aim to work with my gamepad(mouse works fine). I edited the settings for weapon prefabs and made change to use 'secondary movement' for aim control. But it doesn't work at all. So what did I do wrong here? Please advice, thanks!
    upload_2022-10-30_1-25-31.png
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @rugang > You're not modifying the right weapon, that demo uses the ammo versions of it. Make sure you're making changes on the actual prefab you're using.
     
  40. rugang

    rugang

    Joined:
    Oct 30, 2022
    Posts:
    2
    Thank you ! I will try again.
     
    reuno likes this.
  41. matzomat

    matzomat

    Joined:
    Mar 4, 2018
    Posts:
    63
    Hey Guys,
    I‘m a hobyist and I‘m no pro. I work mainly on mobile projects and I always use templates for performance reasons.

    I love the Top Down Engine but the given demo scenes are quite performance hungry. I went through several guides but it seems I can’t find the key. Materials, settings, scripts, profiler runs so performant on my PC, I got > 1000 FPS. But… on mobile… I’m doing something wrong.

    My question: Does anybody have a mobile template that has worked in the Top Down Template and demos for example? Something a hobbyist can start with, knowing, that if anything changes for the worse, the reason is what I just did?
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @matzomat > Optimization on "mobile" will be the same in TDE as in any Unity project. The first thing to understand is that "mobile" doesn't describe much of a target these days. Between a low end Android phone and the latest iPhone, there's a massive gap. You'll find mobile devices with 1 to 6GB of RAM, some that have more powerful GPUs than most PCs, and some that will struggle with only a few drawcalls. So the first question you should ask yourself is what target (or targets) you're actually aiming for.

    Then you need to learn how to profile on device, to be able to identify what the actual cost of your frames and your bottlenecks are. It's likely you're GPU bound (the CPU is quickly done with its frame and is waiting on the GPU). Using Unity's profiler is a good way to figure out what your current issues are. Frequent offenders on low end mobile devices will be post processing effects, having too many drawcalls (simplifying a lot here : too many different materials and models), geometry that is too complex, and so on.

    As for the engine, it runs perfectly well on "mobile", its gameplay code is very light, and optimized for it. The MinimalScene2D is a good place to start, it's just a few sprites, no post processing.
     
    matzomat likes this.
  43. phreggle

    phreggle

    Joined:
    Sep 10, 2018
    Posts:
    2
    Hi,

    First of al let me say that I'm loving Top Down Engine so far. Great product!

    I am currently experimenting with controlling a group of units (think RTS) where the units move to a target position by using the CharacterPathfinder3D. Movement is working, but it is a challenge to implement some of avoidance (and more advanced formation-like movement). I managed to implement it by using NavMeshObstacles (as described here: https://forum.unity.com/threads/rel...sistance-and-more.566533/page-35#post-6655903 ) but it is not running very smoothly with a group of units and feels kinda hacky.

    I also tried to extent the CharacterMovement ability to perform movement based on a NavMeshAgent, but that movement doesn't play along with the movement of the CharacterMovement itself (similar to the notion that root motion isn't supported, I guess). Would it be possible to incorporate movement of objects by using a NavMeshAgent or isn't this not supported by Top Down Engine?
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @phreggle > If you're using Unity's navmesh system, then indeed navmesh obstacles would be the way to go. And sure, you could absolutely replace CharacterMovement with another ability that uses a navmesh agent instead. It's not a feature of TDE at the moment (I think it's best to query a pathfinding API and pass it to a movement dedicated class rather than mix concerns like the navmesh agent does), but you can implement it if you'd like.
     
  45. Blahgyn

    Blahgyn

    Joined:
    Feb 25, 2018
    Posts:
    3
    Hello everyone, bought the engine a while ago and Im enjoying it! Just want to know if I can report bugs here?
    - When using the component GoToLevelEntry, after correctly adding the entry points in the wanted Scene, they will be ignored if RespawnAtInicialLocation is true in the Health compoment of your playable character. Your character will always appear in the Initial Spawn Position, not in the wanted Entry Point. This is due to the
    CharacterHealth.Revive() (line 608ish) being called every time you enter a new scene. Just create a subclass and change this the way it suits you better :)
     
    reuno likes this.
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
  47. aether_fang

    aether_fang

    Joined:
    Feb 18, 2021
    Posts:
    1
    Hi, just started getting into it and wrapping my head around everything, and love the tools so far. One issue I had, messing with the procedural demo, it created an unsolveable level. Is there anything we can do to prevent that? screenshot_1584x751_2022-11-22_22-52-25.png
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @aether_fang > Sure, you can tweak the generation rules to avoid that (usually adding a walker rule would help). That demo is just that, a quick demo of how to integrate procedural generation systems and have them connect with the actual systems of the engine. It's not designed to be bullet proof, the system is minimalistic, most people replace it with their own.
     
    aether_fang likes this.
  49. patrickk2

    patrickk2

    Joined:
    Dec 8, 2019
    Posts:
    92
    Hello everyone!

    I started a 2D WebGL project using the TopDown engine recently, and it's really fun using the asset! I ran into some performance issues on my WebGL builds when I started adding additional levels.

    I started from one of the 2D demo levels, and added a custom pathfinder ability for AI movement. As long as everything was in one scene this worked fine in the Unity editor and the WebGL build. Then I split the setup in a start scene which only contains a few global managers and UI elements, and load the actual game level with LoadSceneMode.Additive. Everything still works in the Unity editor, but in the WebGL build the framerate drops to about 9 FPS (which in turn breaks the pathfinder because it often overshoots the next waypoint). Apart from the additional scene loading the code is the same as before.

    Does anyone have any hints, what might be causing the framerate issues? Any tips would be greatly appreciated!

    Thanks in advance for any input on this issue and best regards,
    Patrick
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @patrickk2 > If the issue only happens when you start doing that additional scene thing, or when you use your pathfinder, it's likely your issue is coming from one or the other. It's hard to tell you more without more details about what exactly you're doing though. I'm not aware of any Unity specifics when dealing with additive scenes in WebGL especially, but maybe there are. You may have more luck asking Unity directly, or in a more general thread than a TDE specific one.