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

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Hello,
    in corgi engine there is a follower-character.
    How to manage a character that follows the player and hurts enemies?
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > That's what the advanced AI system is for. Don't hesitate to check out its documentation and the many examples provided in the engine.
     
    realgamingart likes this.
  3. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    I tried it with the Ninja (2D Ninja Sword Master (2)), setting his layer to "Player" he is attacking a enemy and also the player. He is not following the player.
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > Just changing the layer is not going to be enough, you have to create a new Brain that matches the behaviour you're after, that's not how it works :)
    Have you checked the documentation as I recommended previously? It explains all there is to know about the AI system.
     
  5. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    https://ibb.co/xjLT6RK
    Is there something wrong with one of the cameras? I saw this on a fresh import,just chaned the character animator, using Unity 20191.10.
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > I've never seen this before. Please use the support form and provide repro steps, thanks.
     
  7. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Ok, so far. I'd like to have an ai that follows the player and attacks the enemy.
    As i check your brain-ai component i need two targets for the brain, or/and do i need two brains?
    Can i copy the brain and the ai-components and set the ".....detect_target_radius2D" target to enemy and in the other to player?
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > You can decide to change things and have two targets, but that seems way overcomplicated.
    A decision will only need one target.
    It's unlikely you'll evaluate both at once :) Just have a first decision track the player, another the enemy.
    It's up to you in the end, but you don't need two targets for that.
     
  9. nhancaosi

    nhancaosi

    Joined:
    Apr 29, 2018
    Posts:
    7
    I imported the asset, but cannot find the Grasslands sample. I looked in the demo folder and the level selection while the game is running.
     
  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @nhancaosi > You may want to read the first, highlighted item of the FAQ (the one marked with "please read this").
    If that doesn't solve it don't hesitate to use the support form, but I'll need more details about your context as it'd be quite unusual :)
     
  11. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    I thought all ai-components belong to the ".....detect_target_radius2D"? And all this decisions belong to the target and i can only set one target?
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > Yes, by default you can only set one target. As I said you should be able to manage most operations with just one. Have one state focus on the enemy for example, and another on the character depending on what it's doing.
    But feel free to extend the Brain to add another one if you prefer, there's no unique way of doing things and whatever works for you is the right solution here.
     
  13. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    @knuppel - pardon me for butting in, but the AI examples in game are just that - examples. They really only scratch the surface of what the AI engine can do and aren't meant to be absolute. You can create your own actions and decisions that apply specifically to your needs.

    For example, take a look at the MoveTowardsTarget action. Instead of checking the brain target's position, check the players position. Now you have a MoveTowardsPlayer action. With a simple decision tree, you can tell your character to either attack an enemy in range or follow the player (or just about anything else).

    I'd recommend taking some time to map the behavior out before trying to build it as complex decisions can get difficult to follow.
     
    Last edited: Aug 2, 2019
    IlyaKo likes this.
  14. Azure123

    Azure123

    Joined:
    Feb 20, 2017
    Posts:
    8
    Hi @reuno

    Got these errors after installing TDE 1.4 on unity 2019.2.0f1
     

    Attached Files:

  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
  16. gb1_unity

    gb1_unity

    Joined:
    Dec 21, 2016
    Posts:
    5
    Hello,
    I would like to use in an unity project levels with a top down view (using TopDown Engine) but also levels which side scrolling (like Super Mario; in this case using the Corgi Engine).

    Unfortunately an import of both engines in the same project leads to a lot of errors.
    Could you please let me a know a way how to import both engines properly without errors?

    thanks in advance!
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @gb1_unity > As explained here before, or in each asset's FAQ :

    Can I mix this with the Infinite Runner Engine, Highroad Engine or the Corgi Engine into just one project?
    All of these assets are what Unity considers "Complete Projects". That means that they come with their own dependencies, and their own project settings (input, most importantly, but also layers, tags, etc). All of these assets were designed to be foundations on their own, not to be used together. It's of course possible to do so, but you'll have to do some refactoring, and this is not officially supported (it'd be impossible to maintain compatibility across all assets at all times). If you decide to do so, I'd recommend unifying MMTools and input first, the rest should be pretty straightforward.
     
  18. ShiackHeron

    ShiackHeron

    Joined:
    Oct 24, 2017
    Posts:
    13
    Hi, is there any way to change the hitbox in the 2d melee weapon without flipping the weapon sprite?, I want to attack in four directions I've made individual weapon animationsfor each direction, I set aim mode to 4 directions with minimum -180 and maximun range180 , the hitboxes move where they should but the weapon animations get all flipped I've tried uchecking weapon should flip but it only causes not to aim left, if check it and and and aim mode is like above the hit box moves but the attack animation for up and down has left and right variation that I don't need.
    The only way that I've made the right animations play is setting min max angle to 0 and unchecking model should flip but now only attack to the left, I've been stuck trying to set this up for days, I don't want to have to make the weapon part of my character sprite as I want to use them with different characters.
    Please help.
     
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Shiack > You can separate your weapon's model / animator from the weapon itself, it doesn't have to be on the same object. That's probably the easiest way to do what you're after. If you have more questions please use the support form, thanks.
     
  20. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Hello,
    i have a problem with the sword in Koala2D level. Equiped with it, it does not hit/kill a ninja.

    Edit: Setting the layer of the sword to "Enemies" works.
     
    Last edited: Aug 9, 2019
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > It was set on the wrong layer, the next version fixes it.
     
    knuppel likes this.
  22. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Shooting in 2D Android mode is difficult, it's not easy to find the target. Is there a way to auto-aim a (the nearest) enemy and shoot, after pushing the button?
     
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > Sure, you can use a spherecast (or anything similar/smarter) to grab the direction of the closest enemy, and modify your aim according to that.
     
  24. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Hello, in Koala2D demo there is allways a shadow around objects, that changes when player moves, from which camera is this, how can i disable it?
     
  25. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @knuppel
    In the attached image, if you mean "A" then you have to disable "B" component in the Koala prefab koala.jpg
     
    reuno and knuppel like this.
  26. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Hello, i have set at enemy the Points when destroyed to 1 and try to read the current points with:
    ZombiesKilled.text = "Zomie kills: " + MoreMountains.TopDownEngine.GameManager.Instance.Points.ToString();
    this should be correct?
    I can not read the points in this way.
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > Without knowing what you mean by "I can not read the points", it's really hard to help.
    This works, called from anywhere :
    MMDebug.DebugLogTime("points : " + GameManager.Instance.Points.ToString());
     
  28. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Sorry, what i was trying to say is, that GameManager.Instance.Points is allways "0", it doesn't increase when a enemy is killed. I also tried your snippet, allways "0".
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > Oh that's "normal", points on kill never got implemented.
    Quite easy to fix though, just replace the GameManager's empty OnMMEvent(TopDownEnginePointEvent pointEvent) method with this :
    Code (CSharp):
    1. public virtual void OnMMEvent(TopDownEnginePointEvent pointEvent)
    2.         {
    3.             switch (pointEvent.PointsMethod)
    4.             {
    5.                 case PointsMethods.Set:
    6.                     SetPoints(pointEvent.Points);
    7.                     break;
    8.  
    9.                 case PointsMethods.Add:
    10.                     AddPoints(pointEvent.Points);
    11.                     break;
    12.             }
    13.         }
     
    Boom_Shaka likes this.
  30. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Thanks for the code, will you implement this in future update or will i have to add this myself?
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > It'll be in a feature update, but there's nothing to implement in the meantime, just copy/paste it, it'll work right away :)
     
    knuppel likes this.
  32. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Hello again,
    is there an issue with the koala health prefab? Picking it up does not add health to the character.
     
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > It'd really help if you could submit these via the support form, providing details such as what version of Unity / the engine you're using, and steps to reproduce from a fresh install :)
     
  34. mccann

    mccann

    Joined:
    Sep 24, 2013
    Posts:
    30
    @reuno - I really like your latest changes in 1.3 and 1.4.
    I'm using... Unity: 2019.1.12f1 TopDownEngine: 1.4

    Using Koloa scene... shouldn't I be able to drop "playable characters" in the LevelManager's Player Prefab slot?
    I tried putting HornsRed and MinimalCharacter2D in but get errors.

    Error (which I don't know how to resolve):
    ArgumentException: Object at index 0 is null
    UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs, UnityEngine.Object context) (at C:/buildslave/unity/build/Editor/Mono/SerializedObject.bindings.cs:39)
    UnityEditor.Editor.GetSerializedObjectInternal () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:553)
    UnityEditor.Editor.get_serializedObject () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:452)
    UnityEditor.UIElements.InspectorElement..ctor (UnityEditor.Editor editor, UnityEditor.UIElements.InspectorElement+Mode mode) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:133)
    UnityEditor.UIElements.EditorElement.Init () (at C:/buildslave/unity/build/Editor/Mono/Inspector/EditorElement.cs:86)
    UnityEditor.UIElements.EditorElement..ctor (System.Int32 editorIndex, UnityEditor.InspectorWindow iw) (at C:/buildslave/unity/build/Editor/Mono/Inspector/EditorElement.cs:64)
    UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1392)
    UnityEditor.InspectorWindow.RebuildContentsContainers () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:639)
    UnityEditor.InspectorWindow.RedrawFromNative () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:311)​
     
    Last edited: Aug 17, 2019
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    Is that a question?
     
  36. mccann

    mccann

    Joined:
    Sep 24, 2013
    Posts:
    30
    Yes, I hit post reply accidentally before full question posted. :)
    And had to edit it.
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @mccann > Looking at the error, I don't think it's related to the engine, seems like a Unity bug.
    And yes, you should be able to replace the character, and it works just fine, no errors :
    upload_2019-8-17_11-57-28.png

    Maybe you've changed something, maybe it's your Unity install.
     
  38. mccann

    mccann

    Joined:
    Sep 24, 2013
    Posts:
    30
    After retesting this on a fresh install (and upgraded Unity to 2019.1.14f1), I still had the issue.

    However, I went through the Level selection scene instead of just starting the Koloa scene, and it worked without error! So, not critical anymore, but do you have any thoughts?

    I've read your docs, watched all your videos... thanks for putting those together!
    Going to continue doing the small tweaks before getting into the code.
     

    Attached Files:

  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @mccann > I don't reproduce the issue, on 3 different machines. If you (or anybody else) can provide exact repro steps, I'll be happy to have a look. But again, these errors you get don't seem to come from the engine, just look at the stack. If the problem persists please use the support form, thanks.
     
    IlyaKo and mccann like this.
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    I've just added the last video embed to the TopDown Engine documentation. All features of the engine are now covered by text and video documentation!
    Remember to check it out when in doubt, the answer's probably in it :
    https://topdown-engine-docs.moremountains.com/
     
    IlyaKo, DMRhodes and Boom_Shaka like this.
  41. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Hello,
    Is there an easy way to save the inventory items and loading the items when starting the game again?
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @knuppel > Yes, that's built in.
    Look at the Inventory Engine demo, for example.
    And again please use the support form for support, thanks :)
     
  43. Vietman

    Vietman

    Joined:
    Jul 6, 2018
    Posts:
    1
    Are there any special steps to get projectile weapons working correctly with AI? I am only trying to get the weapon to shoot in the direction the AI is facing, but it always aims "west" regardless of the aiming method set in the aim component.
     
  44. dimasandiraa_unity

    dimasandiraa_unity

    Joined:
    Aug 2, 2018
    Posts:
    2
    Hey, when i make my own HUD based on GrasslandsHUD, i got an error. When the game started the healthbar in my HUD it went down to 0, but the players still alive. But i got a similiar settings on the healthbar game object on my HUD and GrasslandsHUD. I already Bind the PlayerID based on the player on the scene, but only Player1 that correct.
    I will attach a screenshot.
    upload_2019-8-19_16-41-44.png

    Is there a tutorial how to attach the player healthbar?
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Vietman > Nothing special no, but the next version will include examples of that.
    @dimasandiraa_unity > There's no tutorial for that, it'd be a very short one :) You probably don't have the same settings as in Grasslands, otherwise it'd work. Look for differences, either in the UI or in your code.
     
  46. dimasandiraa_unity

    dimasandiraa_unity

    Joined:
    Aug 2, 2018
    Posts:
    2
    @reuno > yeah, i just figured it out. Thanks for answering though.
     
    reuno likes this.
  47. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Hi Reuno,
    As stated earlier this year you also find Unity tech updates a bit too often, which we won't say about our favorite assets like yours of course :)
    But would it be possible to not raise the minimum Unity version to 2019.2 this time? I mean, that it works on 2019.2 is I guess expected, but I hope it will also continue to work with 2019.1
    For projects in production, always moving to the next Unity tech version is quite a pain..
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Necka_ > It is indeed a pain, and I wish Unity made that easier to manage. Getting proper dependency management would solve that. In the meantime I'm afraid it's way too much work to maintain compatibility with all the changes they're pushing, especially at the manifest level.
    Plus I just looked at my stats on the requests I get on that subject, and a huge majority is about getting support for the latest, not older ones, that's why it's not done the other way around.
    That said, manifest aside, that new version will indeed require 2019.2, but will work with 2019.1 as well. All you'll have to do is install 2019.2, get the new version, copy it to your project in 2019.1, and it'll work. So it's a small pain, but manageable.
     
  49. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    That is entirely in my skill-set :) I didn't know that would work like this. Then no complain on my side! thanks
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Necka_ > The only thing you'll have to be aware of is the manifest (the file that describes what packages the asset uses - Cinemachine/PostProcessing/PixelPerfect), which is made for a specific version of Unity, 2019.2 in this case.
    But you can (and will have to) install these packages manually, that's all. I'll help if you run into any issue with that of course :)
     
    Necka_ likes this.