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

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

    kuidream

    Joined:
    Apr 3, 2019
    Posts:
    2
    unity 2021.1.11,engine 2.2.1,
    In the example scene KoalaDungeon, a ninja using melee attacks is placed in the lower left of the initial spawn point. If the player does not attack actively, but just escapes, then when the player comes to the lower left corner of the room, the ninja will stand still. Will neither attack nor search for enemies.
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @kuidream > Once again, could you please use the support form to report this, along with the info requested right next to it, and precise values of where you place things, if you think the issue is on the engine's side? "the lower left of the initial spawn point" is too vague, I'll need repro steps and coordinates.
     
  3. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    Hi @reuno . Just bought "top down engine" and i think it is awesome. learn alot from it!! eniwey, is it possible to only add characterswap.cs to all characters and just call SwapToThisCharacter() to swap in, and call ResetCharacterSwap() when I finished and want to swap out? without characterSwapmanager? I dont need to pool swappable characters (also no need to handleinput key "p")
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @dianpratama2003 > No, it's not, these two classes work together. What you describe (no pool, no input, no manager) would be an entirely different feature, it'd require its own implementation.
     
  5. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    thanks @reuno. been looking your code for few hours now. Very nice.

    ok. so i want a feature that basically let player choose which gameobject he want to play. so to swap the control, I will create new class abilites
    1. create new class with CharacterAbility as a parent
    2. set the _character.PlayerID with the "player1" and so on then call SetInputManager() so player can control it.
    (i just have to make sure that characterType is "player")

    that should work right?
     
  6. rootlocus

    rootlocus

    Joined:
    Sep 16, 2015
    Posts:
    24
    to those who face the issue where the ninja doesnt attack you if you hug a wall or dont get knockback'ed.
    its because the AIActionShoot2D only trigger attacks once, and will require you to exit the state and somehow trigger it again. I am still figuring how to do that, will update here i guess if i get a solution.
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @dianpratama2003 > I suppose it would. Best way to know would be to test it.
    @rootlocus > Yes, as explained in the documentation, AI Actions are atomic. If one lets you attack, it attacks once. If you want to attack again, transition out of that state, and enter it again, like in any state machine.
     
  8. rootlocus

    rootlocus

    Joined:
    Sep 16, 2015
    Posts:
    24
    After playing with the AIBrain on what are the tools i can use to exit and enter states. I've ended up using AIDecisionTimeInState to reset the detection and retargeting of the player.
    Also Using AIActionSetLastKnownPositionAsTarget helps as it always sets a new target location to make the next transition in.

    It helps that when making this AIBrain to really think in a smaller step scale.

    upload_2021-12-27_10-36-58.png
    upload_2021-12-27_10-37-12.png

    PS: AIActionSetPlayerAsTarget is just a custom script to always choose the main player as target.
     
    reuno likes this.
  9. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    Agreed. will definitely try it (and other things) this weekend. many thanks!
     
    reuno likes this.
  10. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    @reuno. i must have missed a step here. i tried to use 2D lighting with URP. So, as step i found online,
    1, install URP, create new renderer pipelines asset (and put it in project setting ->graphics).
    2. create 2D renderer(put it in the pipeline asset i just created),
    3. upgrade the scene to 2D renderer (changed all material to lit)
    4. screen went black, yihaa, this is expected, then i put global lighting to light up a bit (target sorting layer to ALL)

    now. the scene view is correct, i can see my scene fine (i used or minimal 2D scene demo as a start & it has your minimal 2D camera rigs, and i put bunches of tiles & characters there), but on the game mode view is all BLUE?. I checked all sprite renderer now already using lit version. what step did i miss?

    A bit of a background, I do have C# experiences, (but never in gaming and been learning unity in few weekends)
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    dianpratama2003 likes this.
  12. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    whoa. very fast response! thanks. some how i missed that docs. ok thanks. sorry to bother you on today, i just have one more itch. I cant seemt to make backgroundmusic component to work. i looked at your koaladungeon scene and try to mimic it (using minimal 2d scene+ empty gameobject + backgroundmusic component on it). but it doesnt work?

    been reading http://feel-docs.moremountains.com/mmsoundmanager.html and still found no solution.

    build it and test it on android and it seems backgroundmusic component works! but playing it through windows&unity still no music
     
    Last edited: Dec 31, 2021
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @dianpratama2003 > Are you sure you haven't muted your game window?
    If your issue persists, please send me more context and written repro steps via the support form.
     
  14. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    well the SFX works. just not the music. ok i will submit later.
     
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
  16. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    hi reuno. I just read the docs and made Postprocessing works for URP with feedback. quite steps. disable postprocessingvolume object and create new objects, add volume on it, new volume profiles, add MMchromaticaberationshaker_URP , and then changing feedbacks from demo characters with _URP.

    I am not complaining to you, cuz I see unity changes alot on Postprocessing system thus you had to make the _URP version of everything. for someone who is new to unity, this is confusing.
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @dianpratama2003 > That's all explained in more details in the feedbacks' documentation. I'm glad you figured it out!
     
  18. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    lol. where is it music mute option? i cant find it in SoundManager or MMSoundManagerSettings it referenced to. i am planning to just directly write new script on that.
     
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @dianpratama2003 > "lol"? I'm not sure what's funny in what I said. Muting the music is an option on both the regular SoundManager or MMSoundManager, you'll find them easily if you look at their inspectors :

    On the old SM it's a slider :
    upload_2022-1-1_21-37-8.png

    On the new one it's a slider and a Mute button per track :
    upload_2022-1-1_21-37-33.png

    You can also check their documentation and API documentation to find out more about the various ways you can mute stuff.
    If you have more questions, please use the support form from now on, thanks.
     
  20. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    i am laughing at myself, bcause so many things to learn on this game dev journey. anyway, this solved it. i somehow accidently mute the music track. many thanks reuno!!
     
    reuno likes this.
  21. hamuralensis

    hamuralensis

    Joined:
    Nov 25, 2020
    Posts:
    11
    Hello! I have a question about CharacterHandleWeapon.cs attached to the player character.
    Can I inventory the player's "initial Weapon"?
    Weapons attached to Initial Weapon are not included in Inventory.
    Newly picked up weapons in the game were included in Inventory.
    I want to the player's initial equipment in the inventory.
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @hamuralensis > You can set that via the CharacterInventory ability.
     
  23. hamuralensis

    hamuralensis

    Joined:
    Nov 25, 2020
    Posts:
    11
    I did it! Thank you!!
     
    reuno likes this.
  24. soilds

    soilds

    Joined:
    Apr 4, 2019
    Posts:
    1
    Hello, I am I am a beginner, I would like to ask why is it that the progress bar under my animation component does not loop, but the character's movements are all normal?Is this normal? Because my native language is not English, I may not have a clear enough description of the problem, I am attaching pictures here.
     

    Attached Files:

  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @soilds > It's likely that you're not looking at the right animator here. Make sure you select the one on your character in the scene.
     
  26. my_password_is_my_username

    my_password_is_my_username

    Joined:
    Oct 7, 2021
    Posts:
    12
    Hi, just a quick one - is there a build-in win condition and a way of keeping track of how many enemies are still in the level? I'd like to implement some kind of kill-all-to-progress feature or some other ways to finish a scene and have not found a suitable solution so far. Of course I can write something myself but most if the things I needed so far can be found directly in TDE so maybe this feature is also already available and I couldn't find it yet.

    On a side note, I've found it increadibly simple to add an animator with a blend tree to align the 3D walking animation with the movement direction so that the character is not always running forward even when strafing or running backwards (this was actually much simpler than in my previous code that did not use TDE as you have all relevant variables already in the animator). Why is this not incldued by default? All that is needed are animations for 4 walking directions, everything else is provided by the built-in animator variables. This could be included by default as it looks much nicer.
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @my_password_is_my_username > No, there's no built-in win conditions (aside from the exit level colliders that I guess could count as such). The main reason for that is that it's typically something that would be unique to each game so hard to make in a useful generic way.

    As for the animation, that's because the engine doesn't do any animation, Unity does, and already lets you do it. All the engine does is send and update animation parameters, which as you've seen you can use for that kind of setup. That said, there's a blend tree example in the Colonel demo scene, for variety.
     
    Last edited: Jan 13, 2022
  28. my_password_is_my_username

    my_password_is_my_username

    Joined:
    Oct 7, 2021
    Posts:
    12
    Wow, thanks for the super-fast response. I will check the exit collider code to see what it triggers and try to build my own code based on that. Also thanks for the animator info, makes all sense.
     
    reuno likes this.
  29. MilziPPG

    MilziPPG

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

    Another quick animator question. In the documentation, there are preexisting Parameter Names for Character animations (e.g. Idle, Crouching, Dashing etc.)

    I'm curious, is it possible or is there an example of using Actions or Decisions from the AIBrain to control animations?

    So, for example, I have an enemy AI walking around randomly (AIActionMoveRandomly3D), and it has a AIDecisionDetectTargetRadius3D transition state. If that transition state is true, its new action is AIActionMoveTowardsTarget3D.

    So, the question is, is it possible for AIActionMoveTowardsTarget3D to trigger a new animation.

    I've tried setting this up in the Character script (both with the InitializeAnimatorParameters and UpdateAnimator methods) but I'm not really sure how to do it, mainly because of the UpdateAnimator method

    MMAnimatorExtensions.UpdateAnimatorBool(_animator, _chaseAnimationParameter, I'm not sure what to put here to reference the AIAction!, _animatorParameters, RunAnimatorSanityChecks);

    Any help would be mega appreciated (even if it's a flat out "that's impossible"!)

    Thanks everyone!
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @MilziPPG > I'd recommend creating a new AI Action for that, AIActionMoveTowardsTarget3D moves your character towards a target, it's not its role to update your animator, it'd be best to have a dedicated action handle that.
     
  31. MilziPPG

    MilziPPG

    Joined:
    Oct 9, 2018
    Posts:
    21
    Thanks dude!
     
  32. barrmy

    barrmy

    Joined:
    Apr 26, 2020
    Posts:
    3
    Engine 2.3.1
    Hello
    Does Weapon Auto Aim 3D have any prioritization when multiple layers are selected?

    I’m trying to get the player character to aim first at an ‘Enemies’ layer, and then if there are no enemies in the scan radius, aim at structures that need to be destroyed.

    thanks in advance
     
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @barrmy > No, at the moment there is no prioritization, it scans for targets in a perimeter, and picks the closest that has line of sight. To add that feature I'd recommend extending the class and overriding its ScanForTargets method to implement new prioritization rules.
     
  34. barrmy

    barrmy

    Joined:
    Apr 26, 2020
    Posts:
    3
    thanks for the quick reply!
     
    reuno likes this.
  35. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    @reuno Hi reuno.

    i am making a hole in 2D and doesnt work. I created an empy object with rigidbody2d static and polygon collider2d set to trigger (i dont need sprite for this object) . I already make sure that this object layer "hole". the main character has characterfalldownholes2d enabled. but it doesnt work. I debug it and Physic2d.OverlapPoint always return null?

    i test it with the simple debug code OnTriggerEnter2D() and it worked fine (layer collision matrix is correct). but Physic2d.OverlapPoint always return null?

    [updated]
    created another hole object with only BoxCollider2D+layer "Hole", and it works. Perhaps earlier Polygon Collider2d is to big? (many points), will try smaller later.
     
    Last edited: Jan 29, 2022
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @dianpratama2003 > Holes should work with any type of 2D collider. The KoalaDungeon demo scene shows an example of it with a TilemapCollider2D (composited to a polygon collider). Maybe point count was too high and caused a Unity bug. Let me know if you manage to reproduce it.
     
  37. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    Hi reuno, yes it is basically 1 big scene, and I created one big closed sprite shape for all the grounds and one big polygon collider for the holes that surrounds it. many points. just recreated using smaller parts of polygon collider and it works. It is not TopDown Engine issue. consider this issue closed/answered.

    FYI, on menu tools->MoreMountains->Collision, you have "Generate Polygon Colider2d" menu item? what does it do?
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @dianpratama2003 > I'm glad you solved your issue, thanks for letting me know!
    As for that tool, as explained in the documentation, it's a helper that lets you create a polygon collider 2D out of mesh filters. It basically approximates the silhouette of a 3D model into a 2D collider.
     
  39. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    Hi @reuno. is there a way for AIActionMoveTowardsTarget2D to move towards the player but avoids holes ? Or I should just extend the script? My AI randomly getting killed by holes.
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @dianpratama2003 > No, there's no pathfinding in 2D in Unity (or in the engine). You'd need to implement it.
     
  41. dianpratama2003

    dianpratama2003

    Joined:
    Aug 10, 2021
    Posts:
    16
    ok thanks for the support! i will.
     
    reuno likes this.
  42. Sandler

    Sandler

    Joined:
    Nov 6, 2015
    Posts:
    240
    hi im looking for tools for a new project and was wondering if the top down engine supports slightly uneven terrain in maps.
    im thinking off switching from a top down perspective to a over the shoulder perspective.
     
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @Sandler > While the engine does support slightly uneven terrain, it's a top down action game framework, not a TPS one. All its mechanics are designed for top down, none for a 3rd person camera. You would have to rewrite pretty much everything to accomodate for such a different genre, and wouldn't be able to reuse much. I'd strongly advise against it, there are better tools out there for TPS games.
     
  44. Sandler

    Sandler

    Joined:
    Nov 6, 2015
    Posts:
    240
    Thanks for the reply. Hmm the fight system would be in top down view. But id like to be able to reposition the camera out of it if there are no fights. So it wouldnt have any tps elements besides camera changes.
    And if it supports slightly uneven terrain thats fine. Im thinking about a bridge you walk over that is slightly higher etc
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @Sandler > Unfortunately changing the position of the camera will impact everything, from controls to abilities, it wouldn't be "just a camera change", and you'd have a lot of work ahead of you.
     
  46. Sandler

    Sandler

    Joined:
    Nov 6, 2015
    Posts:
    240
    thanks again. hmm.. ill take a look, is there a way to just turn off/pause the top down engine? giving up the controls/abilities is fine for none combat areas. it would basically be a switch between two control concepts. with or without scene unloading. lot of work is fine, i was mainly curious if there are any hard restrictions.

    like for example you come to an area with a few characters and it then switches into combat mode.
    the active camera transitions to the top down camera and activates the AI behaviors etc.

    i guess my main question is, can you pause/continue the top down engine?
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @Sandler > Yes, you can "turn off" the engine simply by not using it, and can have scenes that don't use it at all.
     
  48. hamuralensis

    hamuralensis

    Joined:
    Nov 25, 2020
    Posts:
    11
    Hello!
    I am encountering a major problem with weaponAutoAim3D.
    Both of these will occur in the Demos > Loft3D scene immediately after importing.

    My changes are
    I have attached WeaponAutoAim3D to the "LoftHandgunWithAmmo" prefab.

    1. Continue to auto-aim the already dead Enemy "PatrolSeekAndDestroyAI".
    (This seems to happen when both live and dead Enemies are within Aim range.)
    (This does not seem to be happening in Loft3DBlueCube)

    2. If you get close enough to the enemy to make contact, the direction of the LoftSuspenders (Player) will alternate between left and right at high speed.
    (This happens with both the PatrolSeekAndDestroyAI and the Loft3DBlueCube objects.)

    Please let me know if there's a way around this!

    [Work Environment]
    Unity : 2020.3.26f1
    TDE : v2.3.1
     
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,872
    @hamuralensis > That's completely normal, that scene isn't setup for auto aim.
    You can look at the Colonel demo scene for an example of auto aim in action.
     
  50. hamuralensis

    hamuralensis

    Joined:
    Nov 25, 2020
    Posts:
    11
    Thanks for the quick reply!
    The "1x1 Blue Explosive" object in the Demos > Colonel scene does not cause any problems when it is in its original state.
    However, when I attach Character.cs and apply "AutoBuildAICharacter 3D", it keeps auto-aiming at the dead 1x1 Blue Explosive object, just like in Loft3D.
    It still happens "when another living character enters the auto-aim range".
    I don't know how to fix this.