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

    JasonT4

    Joined:
    Nov 19, 2018
    Posts:
    16
    Installed the 2D extras from your link and now it works. Thanks again
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @JasonT4 > That's great news, thanks for letting me know!
     
  3. Jigida70

    Jigida70

    Joined:
    Aug 9, 2017
    Posts:
    11
    Hello, I was just wondering if it possible out of the box to make friendly AI (AI teammates who fight besides you) with this asset?
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Jigida70 > AIs are whatever you implement them to be, there's no difference in the engine between a friendly or enemy AI.
     
  5. Jigida70

    Jigida70

    Joined:
    Aug 9, 2017
    Posts:
    11
    I just started playing around with 2D Koala Rooms demo. It was pretty easy to get a friendly Ninja to kill an enemy Ninja for me. Now to figure out how to use the rest of the asset.
     
    reuno likes this.
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Jigida70 > Good job! Hopefully you'll find the rest of the engine as easy to use :) Let me know if you have other questions!
     
  7. arthureberle

    arthureberle

    Joined:
    Dec 12, 2019
    Posts:
    2
    Hey man, first of all - thanks for the great engine. We have implemented an enemy AI that shoots at the player if he is inside the range defined in AIDecisionDetectTargetRadius2D. If that is the case, the AIActionShoot2D triggers the ProjectileWeapon of the enemy which sets the the bool "Attack" to true.

    Now everytime the player attacks with its weapon, the animation from the enemy ProjectileWeapon is triggered as well, do you maybe know what the reason might be for this problem?

    We have already tried to rename the animations, set different weapon names and id's but it didn't really solve the issue.
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @arthureberle > No, I have to admit I don't know how this could possibly happen. The player's weapon can't even "know" about your enemy's weapon animator, the two are entirely separate. Are you sure you're looking at the right animator, with it correctly selected in editor?
     
  9. arthureberle

    arthureberle

    Joined:
    Dec 12, 2019
    Posts:
    2
    It is definitely the right one as I can see the triggering of the animation of the enemy live in the Animator. Anytime i press my left mouse button the bool "Attack" in the enemies Animator turns to true for a split second.
     
  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @arthureberle > That would be the case if you had the same weapon on both your player and your enemy and were looking at the Animator from your project view, not the actual animator on your enemy. I'd double check I have the right one selected. If you indeed have the enemy animator selected in your hierarchy and see it being updated by the player's actions, then something very weird is indeed at play.
     
  11. o3428320d

    o3428320d

    Joined:
    Apr 5, 2019
    Posts:
    21
    Hi reuno,

    I am start using the topdown engine, it is really a great engine for top down 3d shooting game. I have a question, is the engine also support to make third/first person 3d shooting game? And if not, do you have any plans to update the engine to also make third/first person 3d shooting games? Thanks a lot.
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @o3428320d > No, it doesn't, as the name suggests, it's a top down action game framework, there's almost no overlap in terms of features/architecture with third or first person games, which are different genres, and would require a different approach entirely.
     
  13. Orochimaru

    Orochimaru

    Joined:
    Oct 23, 2013
    Posts:
    6
    Hi. First off. The asset is great.

    But I have 2 areas where I have questions.

    1.The asset has an auto-aim setup for the player weapon which is a nice touch.

    And on the auto-aim component it has the "scan for targets" section that allows the player weapon to choose between targets based on distance. And it chooses the closest target after a delay that can be adjusted in the component in the inspector.

    This is all good,

    But what about letting the npc enemies choose between multiple targets???

    Is there a AI brain configuration that can set that up?

    And Can the parameters of choice be changed, like closest distance, hp percentage, or some type of threat system?

    If the players auto-aim can choose,,,

    How can I get the Ai enemies to actively choose between multiple targets for the "AIDecisionDetectTargetRadius2D"?

    ...

    2. I see something about 3d pathfinding but,,,

    Is there a 2d pathfinding solution that works with the 2d AI enemies on this asset pack???
     
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    Orochimaru likes this.
  15. o3428320d

    o3428320d

    Joined:
    Apr 5, 2019
    Posts:
    21
    hi, I am building a 3d top down shooting scene. And I am facing some problems.

    1. I used an uneven terrain scene. When enemies with guns near the player, enemies will shoot the player and player get hurt. It is fine when the enemy is at similar height with the player. But as the terrain is uneven, so sometimes the enemy will be at higher or lower place compared with the player. When player is near, enemies will also shoot, but the ammo can't get to the player and the player doesn't get hurt. So is it the limitation of the engine or I can adjust any AI or setting to solve the issue?

    2. There is some lakes and rivers in the scene, I set the footstep sound already. But if I want the footstep sound can be changed to another when player gets to the water, is it possible to make it by the engine in a simple way? Thanks for your help.
     
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @o3428320d > 1. You can check Unrestrected3DAim true on your weapon. That said, it's a top down action game framework, by definition not heavy on elevation.
    2. You can do it in the engine like you would in most projects, usually raycasting below your character and looking for a tag / layer / component on your ground collider that identifies it as grass/concrete/wood/any other surface, and play the corresponding sound. Note that this feature is pretty high on the todo list, feel free to vote for it via the support form to push it closer to the next release.
     
  17. Orochimaru

    Orochimaru

    Joined:
    Oct 23, 2013
    Posts:
    6
    Thank you I'll check it out
     
    reuno likes this.
  18. Drakkith

    Drakkith

    Joined:
    Nov 29, 2016
    Posts:
    57
    Hi, I'm having trouble getting a weapon to rotate towards a target when using Weapon Auto Aim. The weapon detects an enemy in range, fires correctly, moves with my player character like it should, but I can't get it to rotate towards an enemy. Aim control on Weapon Aim 3D is set to script, rotation mode to 'free', and I've tried rotation speeds of 0 and 1000 and it still will not rotate. It simply fires in the +Z direction. Weapon Auto Aim is attached to the weapon and has rotation mode set to 'free'.

    This occurs with both the LoftAIAssaultRifle prefab that I've added the auto aim and auto shoot scripts to, and with a custom test weapon that I've built myself. I do not get any error messages in the Console either. Have I missed a step somewhere?
     
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Drakkith > I suppose you have, but I'd need more precise info about what you did to tell what the issue is. Here are steps that will work :

    - fresh install of TDE 3.2 on 2019.4.40f1
    - open Loft3D, edit the LoftHandgunWithAmmo prefab, add a WeaponAutoAim3D to it, TargetsMask:Enemies, on the WeaponAim3D component, set AimControl:Script
    - press play, grab the handgun next to you, equip it, it will auto aim at enemies (the blue cubes next to the starting point are marked as such)

    Same process for all other player weapons in that demo, the handgun is just the closest.
     
  20. Drakkith

    Drakkith

    Joined:
    Nov 29, 2016
    Posts:
    57
    @reuno Well, I don't know what I did but I somehow got it working. Gun will rotate and shoot at enemies now. I think I was dragging the gun directly onto the model for testing instead of putting in the initial weapon field in the handle weapon component, so maybe that was the problem.

    Also, how are you disabling the BulletParticles animation on your bullets? I'm looking at LoftAssaultRifleBulletAI right now and I can't seem to find anything that stops that animation from playing. The two Feedback objects look like they only play some sounds and the BulletImpact and SparksDown animations. I'm asking because I'm trying to stop a particle system on my bullets when they impact something so that I don't have a visible bullet just hanging in midair for a second or two after it hits something. I've tried using the MMF Player component to stop a bound particle system, but it doesn't seem to do anything to my particles.
     
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Drakkith > It's simply a non-looping particle system. Second checkbox on your PS.
     
  22. ObsidianSpire

    ObsidianSpire

    Joined:
    Sep 13, 2013
    Posts:
    48
    Hi, what do you think the best options to implement an AI with multiple attacks are? I know about combo weapons and have one working for now, but having the AI always repeat the combo in exactly the same order isn't really what I'm looking for. As an example, let's say you have a character with 3 weapons/attacks, and you want it to randomly pick from one of the three weapons, then pick randomly from the two remaining weapons, and finally do the last attack. I was thinking about trying to give weighted percentages to pick between the weapons, so it will prefer starting with certain attacks but some variety will still occur.

    I'm guessing this will need to be a child class like the combo weapon is but with additional features.
     
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @ObsidianSpire > There's a ChangeWeapon AI Action you can use to change weapons. Right now it's not random, but you could extend it to change to a random weapon instead.
     
    ObsidianSpire likes this.
  24. Drakkith

    Drakkith

    Joined:
    Nov 29, 2016
    Posts:
    57
    Hi reuno, thanks for your time so far. So, the bullet prefabs have a BulletParticles component as a looping particle system with a 5 second loop, but upon impact with something BulletParticles is immediately disabled somehow. What is disabling the BulletParticles component upon impact?
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Drakkith > That'd be the Health component, disabling its bound Model (the BulletParticles node), as it's set to do so, as its DisableModelOnDeath is set to true.
     
    Drakkith likes this.
  26. Drakkith

    Drakkith

    Joined:
    Nov 29, 2016
    Posts:
    57
    Fantastic. My new projectile correctly disappears after colliding with an enemy now!
    Now to figure out why it doesn't disappear upon colliding with an obstacle...
    Lemme play around a bit and see if I can figure out what's wrong.
    Thanks again, reuno.
     
    reuno likes this.
  27. Drakkith

    Drakkith

    Joined:
    Nov 29, 2016
    Posts:
    57
    @reuno I was briefly playing around with the feedback system before heading to bed last night and noticed that it appears to be able to reach into scripts to call their functions through Unity Events. Is that correct? Are there any limitations to this? Does this create some sort of event that needs to be subscribed to, or does it simply call the selected function?
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
  29. Drakkith

    Drakkith

    Joined:
    Nov 29, 2016
    Posts:
    57
    Should the feedbacks be creating a separate instance of the script? I've got an EnemySpawner object with an EnemySpawner script on it that spawns enemies over time unless currentEnemies >= maxEnemies. The initial spawning works fine, but every time the feedback system calls the EnemyDeath() function I've set up all the variables in the script are reset. Perhaps I'm misunderstanding how the feedback system works. Instead of calling the OnDeath() function on the EnemySpawner script, should I be using another script to call the OnDeath() function? A script that can be instanced and doesn't have any values to track?

    Sorry for the questions, I'm relatively new to Unity, especially events in Unity.

    Thanks again for your time and patience.
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Drakkith > No, feedbacks (or UnityEvents) don't create separate instances of scripts, they just call a method, that's all. Note that these are just UnityEvents, nothing specific to feedbacks, that's just a native system in Unity. I have to admit I don't understand what exactly you're doing, or how to reproduce your issue, so I can't really tell what your mistake may be. I'd recommend taking the time to get familiar with UnityEvents, and if your issue persists, don't hesitate to provide steps to reproduce your problem via the support form, I'll be happy to help you if I can.
     
  31. Drakkith

    Drakkith

    Joined:
    Nov 29, 2016
    Posts:
    57
    No worries. I started looking into Unity Events yesterday, so maybe I'll figure out what's wrong soon. In the meantime, I got around the issue by using an EventHandler script. The feedback calls a function on this script which triggers an event that the EnemySpawner script is subscribed to. I feel like I'm using 2 events to do the work of 1, but it works for the moment.
     
    reuno likes this.
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Drakkith > Maybe the confusion comes from the fact that UnityEvents are called "events" even though they're not your usual, large scale broadcast type of event pattern you may be familiar with in other languages. Here it's really an inspector binding that gives you a reference to a method on an instance of an object. It does seem like your implementation is indeed overkill, the simple binding should be enough. If you can provide more details about how exactly to repro your issue, I may be able to spot the problem.
     
  33. Drakkith

    Drakkith

    Joined:
    Nov 29, 2016
    Posts:
    57
    I have an enemy prefab with the MMF Player component on it that calls a method on an EnemySpawner script using Unity Events. This script is on its own EnemySpawnerObject prefab (just an empty gameobject except for the EnemySpawner script). An instance of this EnemySpanwerObject is placed in-scene prior to hitting play. Since prefabs can't hold references to objects in-scene, I have to drag the EnemySpawnerObject prefab into the Play Events() slot in the Unity Events section on the MMF Player component on the enemy prefab and then choose the method to call.

    Upon death, the feedback is triggered, the method in the EnemySpawner script is called, but it's like it's working with an entirely different script than the one that is already in-scene, as all of the variables are set to default values. In other words, the instance of the EnemySpawner script already present in the scene, and the one being called by the Unity Events feedback, seem to be different instances. That's the only way I can think of that would explain the issues I'm having.

    Does that make sense? It's probably just an issue with trying to reference a script on a prefab instead of one that's already instantiated in-scene. I'm just not sure how to give the feedback component a reference to an object that already exists through a script instead of drag-and-drop in the inspector.
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Drakkith > Yes, that makes sense, and you're indeed not using UnityEvents correctly here. You can only bind them to methods on instances of objects within their scope. So a parent, a child object, the same object, or an object within the same scene. You can't bind them to a prefab, you need to bind them to instances. I'd recommend reading their documentation again to get a better understanding of how they work.

    When trying to communicate with objects outside of your object's scope, like your use case here, you'll want to use actual event implementations. Feel and TDE do that a lot, typically that's how all shakers work. UnityEvents aren't the right pattern for this.
     
    Drakkith likes this.
  35. Drakkith

    Drakkith

    Joined:
    Nov 29, 2016
    Posts:
    57
    That makes sense. Thanks so much for your help. And I must say, the more I look into TDE the more impressed I am. You've done a fantastic job with it as far as I can tell. There's so much in TDE that I didn't even know I needed or wanted. I got TDE in a bundle and I thought it was simply going to be a handful of scripts that I'd barely have any use for. I was grossly mistaken and I'm happy for that.
     
    Last edited: Apr 30, 2023
    reuno likes this.
  36. Poppa80

    Poppa80

    Joined:
    Nov 25, 2017
    Posts:
    8
    Hi Reuno, I'm trying to implement a character handle secondary weapon as a kick to work alongside my normal character (projectile) weapon but it seems to be messing with the IK. I've disabled the 'Auto IK' on the secondary weapon but the problem persists. As soon as I disable the handle secondary weapon my character holds his gun fine again. Any ideas?
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Drakkith > Thanks a lot for the kind words. Don't hesitate to put that in a review on the store if you ever get a minute to spare :)
    @Poppa80 > I believe that's something I've already fixed in the next release. Feel free to drop me a line via the support from with exact repro steps, I'll double check if the fix works for your use case and will send it to you.
     
  38. Poppa80

    Poppa80

    Joined:
    Nov 25, 2017
    Posts:
    8
    Thanks Reuno, I can always work on something else in the meantime so I'll await the next release :)
     
    reuno likes this.
  39. MatrixNew

    MatrixNew

    Joined:
    Apr 16, 2020
    Posts:
    80
    Hey guys, is there any "TopDown Engine" integration with "Adventure Creator" asset. If not exists could you help with the implementation?
     
    Last edited: May 11, 2023
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Max256 > Unfortunately I don't know that asset so you'd probably have to ask them. Note that in general, TDE is used as a base you build upon. Other assets integrate with it (the excellent Dialogue System comes to mind).
     
    TonyLi likes this.
  41. DimJohnDoe

    DimJohnDoe

    Joined:
    Feb 22, 2020
    Posts:
    7
    Sorry if this question has already been asked, or if it has already been officially summarized.
    I would like to use the Topdown engine to create 4-directional animations for my character or an enemy character.
    The existing engine has only two patterns, left and right, but is it possible to create a four-way animation by adding up and down?
     
  42. OmarOfMA

    OmarOfMA

    Joined:
    Sep 6, 2022
    Posts:
    13
    I'd like to know if TDE can be used in existing projects.

    Specifically, I already created an architecture suitable for my project. Including game managers, level managers, camera, and UI. My game is more similar to point-and-click rather than being action-oriented, so it seems like TDE might be overkill. I'm just interesting in integrating some parts like the character controller and inventory system.

    Would that work?
    If yes, would it be possible to use parts from the Corgi Engine as well (my game has both top-down and platformer sections)
     
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @DimJohnDoe > The engine doesn't handle animation, Unity does, so there's no limit to the kind of characters you can setup. That said, you'll find multiple examples of characters using 4 directional animations in the demos, typically the Grasslands demo characters are setup like that. Everything you need to do so is already in.
    @OmarOfMA > Short answer is no, not without extra work. You'll find more info about that in the FAQ for both assets. https://topdown-engine.moremountains.com/topdown-engine-contact#faq
     
    OmarOfMA likes this.
  44. GesserX

    GesserX

    Joined:
    Dec 21, 2016
    Posts:
    8
    Greetings @reuno ! Little bit confused why animation bools and triggers are not setting up by ablities. The animator component is referenced, and I can see how values of speed and other numeric values are changing. But id doesn't setting up other things as idle or walking state, for example. Thank you in advance.
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @GesserX > That's indeed confusing, I have to admit I can't think of many reasons for that. Maybe you've forgotten to put your ground collider on the right layer? I'd need a bit more info about your context here to be able to tell for sure.
     
  46. GesserX

    GesserX

    Joined:
    Dec 21, 2016
    Posts:
    8
    I'm using the 3d minimal scene template, so in terms of ground and layers - seems to be ok. As for the character, I've made it up from scratch by following the tutorial, then I've taken the Koala controller, and replaced the animations.

    upload_2023-6-21_16-23-44.png

    upload_2023-6-21_16-25-58.png
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @GesserX > The inspectors look ok from what I can tell. Maybe you bound the wrong animator? Or maybe you're not looking at the right animator at runtime? Could you let me know what exact bools update or don't, out of that list of yours?
     
  48. GesserX

    GesserX

    Joined:
    Dec 21, 2016
    Posts:
    8
    Okay, I've found the problem..
    The reason was unsetted Ground layer in the "Obstacles Layer Mask" in TopDownController3D component.


    Thanks for your help, and sorry for waisting your time)
     
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @GesserX > Ha good catch, that would indeed explain the issue! And don't worry, you're not wasting my time at all, I'm happy to help :)
     
  50. GesserX

    GesserX

    Joined:
    Dec 21, 2016
    Posts:
    8
    Hey, it's me again. Feeling so dumb...but now I have another issue. I wrote an Item class, derived from InvemtoryItem class. I'm trying to fire an equip method, through Inventory Input Actions script that is on my Inventory Display. I've debugged some things, and I see that it correctly recognizes th item in slot and firing the event, but the overriden method "equip" not firing at all.
    I looked through all of PixelRougeHotBarDemo, and the setup seems to be correctly. I know I am missing something very simple again...

    If I understanding correctly - the method should be Invoked by an event without any other subscription from my side? Or not?