Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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,870
  2. hamuralensis

    hamuralensis

    Joined:
    Nov 25, 2020
    Posts:
    11
    Thank you for your reply.
    I am very sorry for the inconvenience caused by my lack of understanding.

    In my environment, the player inevitably auto-aims dead enemies.
    It would be very helpful if in a future update you could add the ability to fight AI-powered enemies in the Colonel scene or auto-aim weapons in the Loft3D scene.

    I would like to learn more about how to use the system so as not to cause any inconvenience in the future.
    I apologize again for taking up your valuable time.
     
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @hamuralensis > Have you tried following the steps I pointed you at? What was the outcome?
     
  4. hamuralensis

    hamuralensis

    Joined:
    Nov 25, 2020
    Posts:
    11
    Thanks for the reply.
    I created an enemy character based on the method you taught me to create a player character.
    I did this within MinimalScene3D.

    Changing the player
    Delete MinimalCharacter from LevelManager, copy-paste Colonel into the scene, change SneceCharacter to Colonel.


    Creation of Enemy
    Create a Cube object as a child of empty game object, set Cube position to (0,1,0), size to Y,2 and remove BoxCollider.
    Attach Character.cs to empty object and click AutoBuildAICharacter.
    Attach a child Cube to CharacterModel of Character.cs.
    In CharacterOrientation3D.cs, change the RotationMode to MovementDirection and attach the child Cube to the MovementRotatingModel.
    Prefabricate empty, delete it from the scene, and drag the prefab into the scene to create it.
    Play the game and attack with guns to defeat the enemy.

    When a live enemy and a dead enemy are within auto-aim range, the dead enemy is already aimed.
    It does not give priority to dead enemies, but rather it aimes them as it would if they were alive.
    When all enemies within range are dead, auto-aim is canceled.
    The delay before destruction in Health.cs is set to 0.

    I have tried creating new enemies in the Colonel scene, but I get the same symptoms.
     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @hamuralensis > I'm including an example of that in the next release, hopefully it will solve your issue.
     
  6. hamuralensis

    hamuralensis

    Joined:
    Nov 25, 2020
    Posts:
    11
    It is really helpful. Thank you very much.
     
    reuno likes this.
  7. windslayer

    windslayer

    Joined:
    Jul 29, 2014
    Posts:
    7
    Hi Reuno, I can't seem to find 2D pathfinding AI actions. Should I implement it myself or is it somehow included? If I were to implement them myself, could you pls give me some sort of pointers on where to start looking?
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @windslayer > There is still no native 2D pathfinding in Unity. You could implement that yourself, there are plenty of algorithms out there (A* being the most common I guess). It can get quite complex though, so maybe you'll want to use a ready made solution, like the A* Project, for example.
     
    windslayer likes this.
  9. subzer0

    subzer0

    Joined:
    Dec 10, 2010
    Posts:
    94
    Hello @reuno , whenever I try to play any scene, this error shows up:

    MissingReferenceException: The object of type 'MMSoundManager' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    MoreMountains.Tools.MMSoundManager.OnMMSfxEvent (UnityEngine.AudioClip clipToPlay, UnityEngine.Audio.AudioMixerGroup audioGroup, System.Single volume, System.Single pitch) (at Assets/TopDownEngine/ThirdParty/MoreMountains/MMTools/Tools/MMAudio/MMSoundManager/MMSoundManager.cs:1024)
     
  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @subzer0 > Nobody's ever reported such an error, so I'd need a bit more info.
    Does that happen in a fresh install, no changes made? If yes, what version of Unity are you on? What version of the engine?
     
  11. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    Hi @reuno. I am trying to assign Mobile Input button to open up inventory. Currently Mobile buttons Inputs are handled with InputManager that handles button.states, however Inventory has it own InventoryInputManager uses unity input.getkeydown().

    what s the best way to do this? i thought customizing InventoryInputManager by adding functions to simulate a keypress (toggle a state/variable) and have it bind to the mobile buttons?
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @dianpratama2003 > You can simply bind your button down action to the InventoryInputManager:ToggleInventory method.
     
  13. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    lol. completely miss that. ok thanks @reuno
     
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    Good news everyone, a new version of the TopDown Engine is available. v2.4 introduces Cinemachine zones, auto shoot, the latest version of MMFeedbacks, a few new other features, and fixes all known issues to date. Here are the full release notes :

    - Adds Cinemachine zones (both 2D and 3D), an alternate way to setup rooms in a level. Less powerful than the Rooms system, it's much easier to setup. Adds demos of it in the Colonel and KoalaCinemachineZones demo scenes
    - Adds weapon AutoShoot, which starts shooting at auto aim targets after an optional delay. Adds an example of that in the Colonel demo scene
    - Adds the SetPlayerAsTarget AI Action
    - Adds AimOrigin options to the Shoot3D AI action
    - Add a new BasedOnDirection mode to DamageOnTouch knockback
    - Adds an option to the auto aim scripts to ApplyAutoAimAsLastDirection
    - Adds a DamageDashing animation parameter to the CharacterDamageDash ability
    - Adds options to DamageOnTouch/Health to prevent taking self damage on specific objects, and to apply damage only on trigger enter, not on stay
    - Adds min/max damage support to all damage related classes
    - Adds HealthChangeEvents (that trigger when any Health component changes its current health value)
    - Adds MMLifeCycleEvents, that trigger when objects revive or die
    - Adds (back) the CharacterOrientation2D's FacingDirection2D animation parameter
    - Adds an option to automatically reload without any input once the last ammo of a Weapon has been shot
    - Improves performance of WeaponPreventShooting components
    - Improves reset on the Magnetic component
    - Simplifies velocity computation
    - Adds an Owner to the AIBrain that actions and decisions can access to target the character gameobject
    - All demo projectiles' knockback direction is now set to BasedOnScriptDirection
    - The GameManager now goes through the time manager for timescale reset
    - FIxes a typo in the readme
    - Fixes pushable blocks' layers in the MinimalSandbox2D demo scene
    - Fixes a wrong Navmesh bake in MinimalAI3D
    - Fixes a bug that would result in an incorrect remapped speed in the Orientation3D ability when character scale was changed
    - Fixes a bug in the way the WeaponAutoAim would clear its list of targets
    - FIxes a potential null ref in AIDecisionDetectTargetRadius2D
    - Fixes a bug with slow 2D rotation of weapons
    - Fixes typos in the DistanceToTarget and Health decisions' enums
    - Fixes CharacterSwitchModel not assigning animator correctly in autobind mode
    - Fixes AIDecisionDetecTargetRadius2D and 3D not resetting their lists of potential targets
    - Fixes a bug introduced by the latest InputSystem update
    - Fixes a bug that would cause TimeBetweenUsesReleaseInterruption to not work correctly when using burst weapons
    - Fixes a bug that would cause movement modifiers to not work when using secondary axis threshold to shoot
    - Fixes a bug that could cause 2D melee weapon damage zones to not be instantiated in the correct direction
    - Fixes potential null refs when using WeaponAim2D without a CharacterOrientation2D ability
    - Fixes a bug that would prevent ItemEquipped events from retaining all their data
    - Fixes a bug that would cause recoil to not apply in the right direction when using 2D orientation with a 3D controller
    - Fixes a bug that would cause the DialogueZone to trigger an event twice
    - Fixes the Health animator not being bound correctly after a model switch
    - Fixes potential bugs with persistence and projectile weapons
    - Changes default trigger axis from 3rd to 9/10th
    - The Koala demo's inventory selection marker's animator now runs on unscaled time
    - Adds missing example healthbar prefab
    - The KoalaSword now has mouse aim by default
    - The inventory selection marker's animator now runs on unscaled time
    - Removes extra colliders on ninja demo characters
    - Updates MMFeedbacks and MMTools to v3.0
    - Updates 2D extras to v2.2.1
     
    elvirais and TonyLi like this.
  15. elvirais

    elvirais

    Joined:
    Nov 13, 2013
    Posts:
    29
    Just wanted to drop in and say how amazing this asset is. I'm having a lot of fun creating my game and test-playing it :) and the new update sounds great too!
     
    reuno likes this.
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @elvirais > That's great, thanks for the kind words!
     
  17. ObsidianSpire

    ObsidianSpire

    Joined:
    Sep 13, 2013
    Posts:
    47
    Hi, I'm running into issues with controller snapback causing the character to switch direction when the player lets go of the joystick. Occurs even in the unmodified demo scenes with the latest version of TopDown Engine V2.4. What would you recommend to lessen this? It's pretty noticeable with a Dualshock 4 controller but we compared it with another controller like a Logitech F310.



    Edit: we found that setting the Character Movement script's deceleration to 0f fixed the snapback issues. Setting to 0f allows for instantaneous stopping so it may not be the desired behavior for every game but it works for ours.
     
    Last edited: May 26, 2022
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @ObsidianSpire > If your stick is drifting, you can adjust dead zone and sensitivity in Unity's InputManager panel. The default settings are pretty tight, and won't tolerate slightly faulty hardware, so feel free to adjust it however you prefer.
     
  19. ChangoXP

    ChangoXP

    Joined:
    Aug 3, 2017
    Posts:
    4
    I'm working on a pacman type game and trying to emulate a similar control system. I put something together in playmaker that worked but now I'm looking for something more elegant and stable at higher speeds. The grid movement in this package looks like it would fit the bill for such play style. I plan to purchase the asset but I was curious about the grid movement script. In pacman, the player continues to moves in a selected direction until a new direction is entered or they run into an obstacle. The grid movement seems to only move to each space upon user input. Is there an option for continuous directional movement or perhaps it's something that could be done fairly easy in the code? Thank you for any insight.
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @ChangoXP > There isn't but it's definitely something you could implement, I've seen teams do it already using TDE.
     
  21. nanase

    nanase

    Joined:
    Feb 28, 2021
    Posts:
    10
    hello!
    If I want to make a topDown game similar to Don't Starve, can this engine be implemented independently, or besides art resources, what other resources do I need to purchase to assist this engine?
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @nanase > While there's some overlap, there are a lot of features in Don't Starve that simply aren't in the engine. There's no building, no harvesting, and a lot more would be missing. This is a top down action game framework. There'd be a lot you'd have to implement. I'm afraid I don't know of any additional asset that would cover all these missing features.
     
  23. nanase

    nanase

    Joined:
    Feb 28, 2021
    Posts:
    10
    Maybe I can just use a part of the engine, such as characters, abilities, AI, weapons; and then combine with other content, such as randomly generated large maps, real-time buildings on the map
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @nanase > Yes, that's absolutely possible.
     
  25. nanase

    nanase

    Joined:
    Feb 28, 2021
    Posts:
    10
    Hello, I would like to ask if the engine's own pathfinding function is suitable for irregular 3D terrain, and whether I can re-plan the path when I change the terrain and ground buildings in real time
     
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @nanase > the engine doesn't have pathfinding, Unity does. The engine just uses the navmesh system for a few AI actions. You can setup your navmeshes any way you want, and you can learn more about that system's limitations in Unity's docs. There are components and APIs in it to update the navmesh at runtime. As for irregular 3D terrain, I guess it depends on the terrain and how irregular it is.
     
  27. nanase

    nanase

    Joined:
    Feb 28, 2021
    Posts:
    10
    Thanks, I thought the pathfinding script in AI could do it, then it seems that I may need to use A* to implement related functions
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @nanase > I'd recommend checking Unity's documentation about navmeshes to learn more about how it works and what it can do.
     
  29. nanase

    nanase

    Joined:
    Feb 28, 2021
    Posts:
    10
    Thanks, I have another question, I see that there are some properties/methods like point in GameManager, and it seems that LevelManger is called to reset the level after the character dies, what should I do if my game doesn't need these?
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @nanase > If you don't need them, you can safely ignore them, and not use them. The Points related method are virtually costless, and won't impact performance or anything else.
     
  31. kcharn1

    kcharn1

    Joined:
    Mar 20, 2022
    Posts:
    2
    Hi @reuno just bought top down engine with colonel template and enjoys how its all compatible with 3d! Was using corgi engine before. Hope you can help with this challenge. I would like to achieve same aim+movement as corgi (2.5 platformer) only having character moving and aiming left-right.
    I've changed character controller to only horizontal movement (works great!) and changed weapon aim to primary movement, strict 2 directions, angles etc - didnt work). The character aims by directional input keys and not locked to movement left right.
    How can I achieve the corgi engine left+right aim in top down engine?
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @kcharn1 > I wouldn't recommend using the TopDown Engine to create a 2.5D platformer. The TopDown Engine is a top down action game, it's designed for top down games. If you want to create a 2.5 platformer, I'd recommend using the Corgi Engine, which is designed for that. It's still doable to use the wrong tool for the job, but you'll have a lot of features to implement.
     
  33. kcharn1

    kcharn1

    Joined:
    Mar 20, 2022
    Posts:
    2
    Thanks for quick response. Makes sense. I just like a lot of the features in the topdown and it its native in 3d. I started the project in corgi engine however im running into a lot of 2d challenges with a 3d physics game. The colonel template solves this.

    Do you think its possible to set the aim/movement as left-right? it would solve a lot!
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @kcharn1 > It's possible if you implement it, yes, but that's not a feature of the engine (again, it's a top down framework).
     
  35. digitalbreed

    digitalbreed

    Joined:
    Oct 14, 2017
    Posts:
    10
    I've played with this asset and can't get the inventory to work properly:

    I have a weapon which resides in the MainInventory by default. When I try to equip it, I call CharacterInventory's EquipWeapon("MyWeaponId"); which eventually triggers a MMInventoryEventType.EquipRequest with a quantity of 0. The event is handled by Inventory.cs which eventually calls Inventory.AddItem. This has a while loop in place with condition quantity > 0, so my weapon ends up properly equipped but not moved to the WeaponInventory. This looks like a bug to me.

    @reuno am I missing something?
     
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @digitalbreed > If you want to equip a weapon from your inventory, that's done by calling Equip on its InventoryItem.
    You can see an example of that in the InventoryWeapon class, or in the demo's UI.
    The CharacterInventory's EquipWeapon is an internal method, not meant to equip weapons from your main inventory.
     
  37. digitalbreed

    digitalbreed

    Joined:
    Oct 14, 2017
    Posts:
    10
    Thank you for your reply! I forgot to mention where I am calling this from: I am using an extended CharacterInventory class where I've overridden HandleInput in order to react to the mouse scrollwheel, just like this:

    Code (CSharp):
    1. public class CharacterInventoryExt : CharacterInventory
    2. {
    3.     protected override void HandleInput()
    4.     {
    5.         if (!AbilityAuthorized
    6.             || (_condition.CurrentState != CharacterStates.CharacterConditions.Normal))
    7.         {
    8.             return;
    9.         }
    10.         if (Input.mouseScrollDelta.y != 0)
    11.         {
    12.             SwitchWeapon(); // this calls EquipWeapon
    13.         }
    14.     }
    15.  
    So everything except for the mousewheel check is basically original TDE code. I assume this "internal" call by means of SwitchWeapon() of EquipWeapon is legit? If this happens, the weapon is removed from the MainInventory but never ends up in the WeaponInventory for the reason mentioned in my earlier post. As a consequence, any subsequent scroll doesn't cause any further changes because FillAvailableWeaponsLists() doesn't find any more weapons and the logic bails out even though I would expect it to unequip the existing weapon if "Add Empty Slot" is configured in the inventories' weapon rotation mode.
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @digitalbreed > Do you have the issue with the original ability as well? I don't seem to be able to reproduce it, even when using your script, so I'm not sure what the problem could be. If your issue persists, don't hesitate to send me repro steps via the support form, I'll be happy to have a look.

    For reference, these steps seem to work fine :
    - fresh install of TDE v2.4 on 2019.4.37f1
    - open the Loft3D demo scene
    - select the LoftSuit prefab, remove its CharacterInventory ability, add a CharacterInventoryExt ability, set MainInventoryName:SuitMainInventory, WeaponInventoryName:SuitWeaponInventory
    - press play, grab the two weapons, use the mouse wheel to change weapons
     
  39. digitalbreed

    digitalbreed

    Joined:
    Oct 14, 2017
    Posts:
    10
    Thanks for taking the time to try and respond. It seems like the issue only appears if the weapon is in the MainInventory right from the start. Kindly try to directly add the weapon to the MainInventory instead of picking it up. I dragged Loft3D->Resources->Items->Handgun into Element 0 of the SuitMainInventory Content. This will reproduce the issue: the weapon gets equipped on mouse scroll but it doesn't end up in the SuitWeaponInventory.
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @digitalbreed > Unfortunately you can't just drag things in an inventory like that though, that's not how it works (see tooltip on the Content property).
    If you want to add items to an inventory, you need to do that via the CharacterInventory ability (or via any other script).

    These steps will work :
    - fresh install of TDE v2.4 on 2019.4.37f1
    - open the Loft3D demo scene
    - select the LoftSuit prefab, remove its CharacterInventory ability, add a CharacterInventoryExt ability, set MainInventoryName:SuitMainInventory, WeaponInventoryName:SuitWeaponInventory
    - in its CharacterInventoryExt ability, set its AutoPickItems array's size to 2, drag the AssaultRifle item asset into Element0's Item slot, and the Handgun item asset into Element1's slot, set Quantity to 1 for both
    - press play, press T to change weapons
     
  41. digitalbreed

    digitalbreed

    Joined:
    Oct 14, 2017
    Posts:
    10
    Thanks again for your time, matter resolved! It felt logical to drag items into the Content property, apologies for not observing the tooltip.
     
    reuno likes this.
  42. B1Gone

    B1Gone

    Joined:
    Nov 25, 2015
    Posts:
    2
    Hi @reuno I just bought top down engine and was playing around with multiple ai's. Some projectiles got stuck on the enemies and didn't do any damage. The reason for that was that all ai's used the same Projectile Prefab and the last owner of the Projectile wasn't removed from the DamageOnTouch._ignoredGameObjects List. Is this a bug or do I miss something?
     
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
  44. gustavsorum

    gustavsorum

    Joined:
    Apr 12, 2022
    Posts:
    4
    Hi!
    I am completely new to unity and game development in general, so I want to preface my question with that I might just be bad at searching in the documentation. But I will ask here since I cannot seem to find an aswer anywhere.

    How would I go about making a character that auto-aims and faces the enemy when an target is whithin range, but then goes back to facing in the direction of travel when there is no enemy within the auto-aim radius?
    Whenever I attempt this, the character keeps aiming in the angle they were aiming before the target died, no matter which direction I move.

    Thanks in advance!
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @gustavsorum > I believe you can see an example of exactly that in the Colonel demo scene.
     
    gustavsorum likes this.
  46. gustavsorum

    gustavsorum

    Joined:
    Apr 12, 2022
    Posts:
    4
    I have now been playing around with all the settings I could find in the Colonel scene (I love it btw, so much cool stuff).

    I am looking to make a game for my nephew where you don't have to do any aiming at all.
    It is meant to be played with left stick on a controller + action buttons (no right stick or mouse).
    In the colonel scene I can achieve the look I'm after if I keep the mouse cursor in front of my character, but that is not the gameplay I want.

    I want the character to behave like the "Colonel + auto aim AR" when within range, but go back to rotating with the direction of movement like the "minimal 3d character" prefab when no enemies are in range, but still holding the weapon.

    Is this possible?

    Thanks in advance!
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    gustavsorum likes this.
  48. gustavsorum

    gustavsorum

    Joined:
    Apr 12, 2022
    Posts:
    4
    Thank you so much! :D

    It turns out my mistake was assuming I needed to have the weapon's aiming system set to "Script" in order to utilize the auto aim. It works exactly as I need it to now.
     
    Last edited: Apr 28, 2022
    reuno likes this.
  49. windslayer

    windslayer

    Joined:
    Jul 29, 2014
    Posts:
    7
    Hi Reuno, I'm having trouble setting up character animation.
    I'm using player character with auto-built components, including character movement component.
    I created a new animator, with auto-generated parameters from the CharacterAnimationParametersInitializer.
    I notice that when I move the player character around, only random, xspeed, yspeed and speed are changing. Walking and Idle are not changed at all.
    I have sendStateChange parameter enabled in the character component.

    Do you know what might be causing this?
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @windslayer > Maybe you've got a layer problem. Try testing in any of the demo scenes to make sure your scene isn't interfering. Pinpointing your problem like that will help you solve it faster.