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

[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. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @dataEcto > I see (at least) two ways of doing that. One would be to extend the AIActionMovePatrol2D ability, override its Patrol() method, and apply the delay not after having reached the point, but when you're close to reaching it instead. The other option would be to add extra waypoints. In your example above I suppose you have 2, if you make it 4 in the same straight line and only apply delay on the 2 center ones, you'll get what you're after.
     
    dataEcto likes this.
  2. dataEcto

    dataEcto

    Joined:
    Feb 21, 2018
    Posts:
    11
    Thank you for pointing me in the right direction. Extending the ability and changing the order of delay worked perfectly!
     
    reuno likes this.
  3. hamuralensis

    hamuralensis

    Joined:
    Nov 25, 2020
    Posts:
    17
    Thanks! I will try it!
     
    reuno likes this.
  4. waheyluggage

    waheyluggage

    Joined:
    Aug 22, 2015
    Posts:
    15
    Hi Reuno

    Hope you're keeping well. Quick question, I have an enemy prefab with a health and mmhealthbar component on it and if I dot my prefab around the level it works fine - the health bar is drawn perpendicular to the camera. However, if I spawn my prefab in code with...

    GameObject g = (GameObject)Instantiate(EnemyToSpawn,
    EnemySpawnPoint.transform.position,
    EnemySpawnPoint.transform.rotation );

    then the health bar is created at random angles and it also rotates as the enemy rotates.

    upload_2021-10-24_22-16-54.png

    It's supposed to look like this...
    upload_2021-10-24_22-18-3.png

    I'm guessing it's something to do with the way I've got my hierarchy ordered or the way I spawn them?

    Any ideas? thanks
     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @waheyluggage > That seems normal, drawn MMHealthbars don't billboard towards the camera. If you want them to billboard, you can either use MMBillboard or implement your own solution for your camera context.
     
    waheyluggage likes this.
  6. Orange-Peel

    Orange-Peel

    Joined:
    Mar 20, 2015
    Posts:
    13
    Does the TopDown Engine support click-to-move? It seems like it does but I cannot find out for certain....
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  8. jedhavel

    jedhavel

    Joined:
    Jul 13, 2021
    Posts:
    1
    Bought and downloaded the TDE, but on import there are no scenes included?
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  10. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    I bought Topdown engine. Does it already have FEEL included or I have to buy it separately
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  12. goshki

    goshki

    Joined:
    Aug 11, 2015
    Posts:
    7
    Hi there, quick question about
    AIState.EvaluateTransitions()
    – if I read the method correctly, it just iterates over all transitions for a given state evaluating its decision and calling
    AIBrain.TransitionToState()
    (for
    TrueState
    or
    FalseState
    , depending which one is fulfilled). But it seems that
    AIBrain.TransitionToState()
    is called for every transition that has its decision condition fulfilled – so there's no way to add several transitions that test for different things but might be fulfilled simultaneously because in such case all of them will have their
    AIBrain.TransitionToState()
    called (and the result will be that always the last matching transition will set the state). Is this by design?
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @goshki > Yes, it's by design, you can't transition to more than one state at once. If you want to add weights to your decisions for example, it's best to do that within a decision.
     
  14. goshki

    goshki

    Joined:
    Aug 11, 2015
    Posts:
    7
    @reuno, I think the way
    AIState.EvaluateTransitions()
    is implemented results in multiple calls to
    AIBrain.TransitionToState()
    because it does not stop iterating over transitions after first matching is found. Wouldn't it be useful to break iterating after first matching transition? This would enable configuring transitions in a preemptive way – from more specific to more general (like
    if-else
    chains or
    switches
    ).
     
    reuno likes this.
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @goshki > I think you're right, that'd make way more sense. I'll fix this for the next release.
     
    goshki likes this.
  16. goshki

    goshki

    Joined:
    Aug 11, 2015
    Posts:
    7
    Great! Can't wait for the new version! :)
     
  17. goshki

    goshki

    Joined:
    Aug 11, 2015
    Posts:
    7
    Oh, and one more question regarding AI – the above problem could be worked around if there was some way to extend
    AIState
    (overriding the way
    EvaluateTransitions()
    works) and make AIBrain use this extended version of
    AIState
    . But I see no way to achieve it because
    AIBrain.States
    property is not overridable and it's a list that's custom-managed by
    MMReorderableListEditor
    used in
    AIBrainEditor
    (or sth like this, I'm writing off the top of my head).

    Do you see any way to make
    AIBrain
    use extended versions
    AIState
    ?
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @goshki > No, I don't, but for such a structural change, it'd be easier/cleaner to just create a new type of brain rather than extending this one.
     
    goshki likes this.
  19. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    In the Loft3D demo, when you crouch (c in keyboard), the character does not remain in a crouch position it immediately goes into idle position. In the colonel demo, it works fine. Any suggestion what's going on.
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @kotor > Select the LoftSuspenders prefab, and in its TopDownController3D's inspector, set MinimumGroundedDistance to 0.5
     
  21. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    It works perfectly now. Can you explain why changing the value makes a difference? just to have more understanding
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @kotor > This distance determines the minimum distance for raycasts checking whether the character is grounded. I recently made changes to that specific character's crouching resize dimensions, without tweaking these as well, and it was just a bit too short. Increasing it fixes the problem.
     
  23. AKAGT17

    AKAGT17

    Joined:
    Sep 8, 2014
    Posts:
    40
    Hi Reuno, Im looking at the xbox controller at the moment particularly the Left and Right Trigger buttons which is used as Secondary Shoot and Shoot button. However Looking at the input manager, I can't see them assigned to those buttons ( Axis 9 and Axis 10). Is this function embedded into one of the scripts? I basically want to know so that I can disable the Secondary Shoot button ( Axis 9) because when I hold Secondary shoot button ( Axis 9) down and then press Shoot buton (axis 10) it doesn't allow me to fire bullets .
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    Triggers are the 3rd axis on an xbox controller, not 9 and 10.
     
  25. AKAGT17

    AKAGT17

    Joined:
    Sep 8, 2014
    Posts:
    40


    Hi Reuno , this is what I found online but ok I take your word for it, As for my question would you be able to answer how the shoot button in the input manager doesn't show the 3rd axis as the selected button for Shoot(Playre1_shoot) function or even the secondary shoot ? Assume it is assigned to oney of the script instead then? If so which one? thanks
     
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    Don't take my word for it, just test, you'll see, or look at more reliable sources :


    And yes, the input manager does show the 3rd axis, as a search will show you. Axis name is Player1_ShootAxis.
     
  27. AKAGT17

    AKAGT17

    Joined:
    Sep 8, 2014
    Posts:
    40
    Thanks Reuno I was looking at the wrong input then, last question when I hold the Secondary shoot button down and then press Shoot button it still doesn't allow me to fire bullets . Would you be able to guide me how do I disable this ? much appreciated thx
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @AKAGT17 > By default both shoot axis on gamepad are bound to the same axis (3rd, positive and negative). Of course if you press both they cancel each other out. Treat them as buttons and not axis, or use other axis/buttons, or a different approach, it's a standard problem in Unity, nothing specific to the engine here. I believe Rewired solves this problem, as do most input solutions out there.
     
  29. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    I was trying to use Behavior Designer and Movement pack from Opsive. Is topdown engine compatible with those package ?
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @kotor > I've never used any of these so I can't tell for sure that they would or wouldn't work. As a general rule, there's no support for 3rd party assets in the engine.
     
  31. Sofiel

    Sofiel

    Joined:
    Aug 6, 2017
    Posts:
    60
    @reuno is there a possibility there will be something like the CorgiCinemachine Zone in the TopDown engine?
    Thanks!
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Sofiel > That's definitely coming! Not in the next release but the one after that, if all goes well.
     
  33. Sofiel

    Sofiel

    Joined:
    Aug 6, 2017
    Posts:
    60
    reuno likes this.
  34. JC_LEON

    JC_LEON

    Joined:
    May 20, 2014
    Posts:
    518
    Hi reuno .. ip urchased top down engine today.. and i would yo know if is there a way to make the player to swim ,cruoch(i think i know this is possible) and crawl .. plus is there a way to implement ony sort of cover system for player and ai and a sound detction syste mfo ai??
    is there any discord channel for top down engine.,.. bte great tool i'm reading the documentation right now.. and i'm goging t purchase mmfeedbacks too now..
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @JC_LEON > You'll find a list of features on the asset's website. There's no swimming, sound detection or cover system at the moment, you'll have to implement these.
    And yes, there's a discord, the link is on both the asset's store page and the engine's website, and MMFeedbacks is already included in TopDown Engine, as explained on these same pages.
     
  36. JC_LEON

    JC_LEON

    Joined:
    May 20, 2014
    Posts:
    518
    thanks for your reply.. i purchased feel right now... as far you know is there any ai solution on the store compatible with the asset and does someone added swimming to it in some waY? my game proejct idead is a 3d top down horror adventure fps with some basic survival aspects like hunger ,thirst and so on
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @JC_LEON > I'm not aware of anyone having implemented swimming or a different AI solution (the engine already includes one) on the store.
     
  38. JC_LEON

    JC_LEON

    Joined:
    May 20, 2014
    Posts:
    518
    i see .. btw from waht i'm viewing amt throught the docs the system seems to be very and easily extensible...

    one more question... is there a generic interaction system with elements that are not weapons.. e.g. if i want my player to equip a flashllight.. the flashlight itself it's managed like a weapon or i can make player to have a different set of animations to manege it like invector third person controller or game creator?
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @JC_LEON > No, there isn't. You can see a full list of features on the asset's website. If it's not listed, it's not in the engine (yet).
     
  40. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    I have a question regarding the AI Brain. The action MoveTowardsTarget3D use the target object assign in the DetectTargetRadius3D. RotateTowardsTarget also uses the target object assign in the DetectTargetRadius3D.
    What if I want to move towards one target and then after that rotate towards another target. How do you do that ?

    Thanks
    Hasnain
     
  41. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @kotor : you just answered your own question. You move towards target A, then acquire target B and rotate towards it.
     
  42. ObsidianSpire

    ObsidianSpire

    Joined:
    Sep 13, 2013
    Posts:
    48
    I'm working on a projectile that can push around a 3D player using the loft scene character as a placeholder for now, but I am having trouble pushing the player due to the default rigidbody settings in TopDown Engine. I tried temporarily modifying the player's rigidbody to dynamic instead of kinematic and let PusherProjectile3D continue its work, but that seems to do nothing even with extremely high push power. I'm guessing something about the default character movement interferes with the push force from PusherProjectile3D. How would you suggest implementing this kind of projectile?
     
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @ObsidianSpire > There's already knockback built into the engine, I'd recommend using that.
     
  44. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    What I understood Target Layer Mask is only assign in the DetectTargetRadius3D. Can we have 2 DetectTargetRadius3D components in the Character game object ?. What I want to do is move towards one target after that rotate towards different target.
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @kotor > Yes, once again answering your own question :)
    You can absolutely have 2 (or more) DetectTargetRadius3D, one looking for a certain type of targets, and the other looking for different ones. You can also create other types of actions or decisions, the system is built to be extended upon based on your specific needs.
     
  46. MilziPPG

    MilziPPG

    Joined:
    Oct 9, 2018
    Posts:
    21
    Hi everyone!

    Just a quick question on AI (and this is for anyone really in the forum!). I'm just playing around with it and have got some pretty basic AI working.

    I'm trying at the moment to do something a little bit different but I can't seem to get it to work, which is get a basic enemy similar to the basic Zombie enemies from Zombies At My Neighbours. Just for context, I've been using the Bit Cave's AIBrainExtension for the Top Down Engine.

    So, I basically want the zombie to have three different states - Walk, Stop, Stop

    The zombie should move around in a random direction, then they should stop for a random amount of time. Then they should move again, and stop etc, etc. However, if the player gets within the Target Radius, then the enemy moves towards the player. Once the player leaves the Target Radius, the enemy returns to walking in a random direction, then stopping etc, etc.

    I'm using both graphs and subgraphs but I'm botching it somewhere. What happens at the moment is the enemy moves but it never stops. It will also very happily chase the player and once the player gets far enough away, the enemy goes back to walking randomly (but never stopping).

    I've got a couple of screenshots of the different graphs. If anyone knows what I'm doing wrong (or if what I want to do is possible at all without making a new script), I'd really appreciate some help!

    Thank you in advance!!
     

    Attached Files:

  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @MilziPPG > There's no graph based solution for AI in the engine, so I'm not sure how to help here, or what these screenshots are about :) You'll find examples of AIs that are pretty close to what you're after in the AI demo scene, hopefully that'll help.
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    Good news everyone, I've just pushed v2.3 of the TopDown Engine to the Asset Store.
    As usual, it fixes all bugs known to date, improves performance, and adds quite a few new features.

    Full release notes :

    - Adds the Stun ability, which lets you put a character in and out of a Stunned state during which movement is prevented
    - Adds the StunZone, the equivalent of a DamageOnTouch zone but for stun, will stun any character with a Stun ability that enters in contact with it
    - Adds the ProximityMine, which lets you trigger feedbacks when things enter it, after an optional warning period with options to interrupt/reset it
    - Adds an example of a stun mine in the Colonel demo scene
    - Adds the Tank demo scene, showcasing how you can use the engine to build tank-like characters, both Player and AI
    - Adds movement zones, trigger zones you can add to your levels to modify a Movement ability's speed
    - Adds AIActionResetTarget, an action that lets you empty your AIBrain's target
    - Adds the SelfDestruct AI Action, that kills an AI when performed
    - Adds extra security options to both PreventShootingWhenCloseToWalls 2D and 3D
    - Adds collider offset support to Rooms
    - Adds an option to AIDecisionDetectTargetRadius2D to use raycasts for obstacle detection, on top of the existing boxcast option
    - Adds options to MMPath to grab path data from another MMPath and to lock handles on certain axis
    - Adds FaceMovement option to Projectiles
    - Adds spawn transform modes to Projectile Weapons, letting you define alternate spawn points that can be picked sequentially or randomly
    - Adds an option to the InputManager to force a state reset on all buttons when losing player window focus
    - Changes the TopDownController's sequence to have ComputeSpeed happen at the end of it
    - Adds an extra "OneTime" mode to the TimeControl ability
    - Adds an alternate WeaponUsedMMFeedback slot to the Weapon class
    - Adds an option to the PathfindToMouse ability to have its clicks/taps blocked by UI
    - Adds an InvincibleWhileDashing option to both the Dash2D and Dash3D abilities
    - Adds a DisableGameObjectOnKill option to AutoRespawn
    - Adds OnSpawn MMFeedbacks hooks to ProjectileWeapon
    - Adds options to TopDownController3D to limit the amount of raycasts used for ground detection or physics interactions if not needed (flat ground, no need for pushing, etc)
    - CharacterOrientation3D now exposes some of its internal speed computations for other classes to poll
    - Adds extra safety checks to the Character class' OnEnable events registrations
    - Improves the way the Health component grabs its animator, and exposes it in the inspector for all the cases where it couldn't find it automatically
    - Adds an extra safety check to the DirectionMarker ability
    - The AIBrain will now stop at the first valid decision when evaluating multiple decisions instead of iterating over the following ones
    - AI Actions and Decisions are now initiliazed by the AIBrain
    - AIAction:Initialization is now public (changed from protected)
    - The ProximityManager now grabs the player on SpawnComplete (changed from LevelStart)
    - The Health component can now be nested under the Character, and doesn't necessarily have to be on the same level. This allows for separate collision and hit boxes.
    - Updates instance checks for all singletons to a safer method
    - Fixes a bug that could cause magazines to not empty correctly if no shot had been fired and no ammo was left in the inventory
    - Fixes a bug that would cause AIDecisionHit to not grab its Health component correctly when on a separate node
    - Fixes a typo in CharacterInventory that would cause the initial weapon to not be correctly named
    - Fixes a wrong comment in GUIManager:UpdateDashBars
    - Fixes a typo in a comment in CharacterPathfinder3D
    - Fixes bounds in MinimalAI3D
    - Fixes DetectTargetRadius decisions target order issues
    - Fixes a bug in Explodudes that'd prevent from putting 2 bombs in the same cell in a row
    - Fixes auto aim target order issues
    - Fixes a bug that would cause Analog mode in CharacterMovement to not work if acceleration or deceleration were set to 0
    - Fixes an outdated check on PickableWeapon that would cause issues with a node abilities setup
    - Fixes a bug that could happen when changing weapon on an AI on the frame where it shoots
    - Fixes a bug that could cause weapons to have an incorrect scale for one frame when swapping them
    - Fixes potential wrong position of the weapon laser sight on frame one of its instantiation
    - Fixes a wrong distance in one of the NinjaRifleman's AI decisions
    - Fixes a bug that would cause jump inconsistencies on certain raycast settings
    - Fixes a bug that would lead to walk sfx to still play on discarded characters when using the CharacterSwitchManager
    - Tweaks a few settings on projectile particle systems
    - LoftExplosion now doesn't play on awake
    - Increases speed of teleporters in MinimalRooms3D
    - Updates MMFeedbacks to its latest version
    - Updates MMTools to its latest version
    - Updates Inventory Engine to v3.0 (warning : many Inventory methods have changed to add support for a PlayerID, check their new signature if you've extended some inventory related classes)
     
    StevenPicard and TonyLi like this.
  49. kuidream

    kuidream

    Joined:
    Apr 3, 2019
    Posts:
    2
    There is a bug in the KoalaDungeon scene:When facing ninja, if I don’t attack him, but hide in the corner, the AI is doesn't work—— he will not move at all.
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @kuidream > You'll have to be more specific. What ninja? What corner? What version of the engine? What version of Unity? Are you sure it's a bug and not just the setup of the brain? If yes, what exactly is the bug?