Search Unity

[RELEASED] TopDown Engine by More Mountains [new v2.2 : tons of things]

Discussion in 'Assets and Asset Store' started by reuno, Oct 9, 2018.

  1. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @SwatHound > As explained in the documentation, this really depends on how you setup your character, your weapon, and your animator.
    - on the character : multiple settings will impact weapon/input sequence, but most will be found on CharacterHandleWeapon (bugger input, buffer extension, etc)
    - on the weapon : you can define the timings of all the different states the weapon goes through (time before use, time between use, etc), these will impact the total time a weapon will take to go through its full cycle
    - on the animator : how you setup your animator will determine how fast animations play, how fast they transition, etc (nothing special to the engine here, but important to keep in mind)

    So based on your question, and with only the info you provide, there could be a few different ways to improve things. If you want 3 presses in 1 second, and 3 attacks in one second, you'll have to shorten the duration of your weapon cycle (and adjust your animations accordingly).

    If however you want "slow" attacks but buffer them, then simply tweaking settings at the Character level will do.
    For example, I just opened KoalaDungeon, moved the sword picker closer to the start, selected the Koala prefab, and in its CharacterHandleWeapon I check BufferInput to true, NewInputExtendsBuffer to true, and Max Buffer Duration to 1. If I then start the game, grab the sword, equip it, and press attack three times in short succession, the Koala executes the full 3 attack combo.
     
  2. SwatHound

    SwatHound

    Joined:
    Jun 7, 2018
    Posts:
    11
    Thank you so much Reuno, I can not believe I did not see this in the documentation. The term "input buffer" was what I needed to find it.

    Your explanation was perfect.
     
    reuno likes this.
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @SwatHound > I'm glad it helped. I updated the documentation to try and clarify what input buffer means. If you're not familiar with the term, it's confusing :)
     
  4. AKAGT17

    AKAGT17

    Joined:
    Sep 8, 2014
    Posts:
    34
    Hi Reuno, I want to add music to my Start screen , would you please advise what is the best way and for it to respond to the music on/off function in the audio settings properly?

    I have tried adding a background music script with an audio file under my camera in the start screen and without problems I can then switch the audio on and off in the settings menu. However if I save it with Audio off and then I quit the application(from a build) and reopen the application (build), the save has saved music off which is fine, but the issue is when I go to the settings and then switch audio on, the music in the start screen doesn't come on.
    Help...
     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @AKAGT17 > You'd need a class that starts the music automatically based on what settings are saved. There's no such class in the engine at the moment, but I can add that to the todo list if you'd like.
     
  6. AKAGT17

    AKAGT17

    Joined:
    Sep 8, 2014
    Posts:
    34
    Thanks Reno that would be great, but do you think you can add it on to the next release? As Id imagine people buying the top down engine would expect such function would work straight out of the box? Cheers
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @AKAGT17 > You're the first person to request it in 5 years, so unless people start requesting it massively, it has little chance to make it into the next release. As I said, it can already be done, you can poll the settings and auto start your music if you want, it's two lines of code (maybe why it never got requested, I don't know).
     
  8. dataEcto

    dataEcto

    Joined:
    Feb 21, 2018
    Posts:
    11
    Hello again,

    I'm utilizing the Seek and Destroy AI that is a part of the Miminal3DAI scene on my own scene. One thing I noticed is that the Patrol state doesn't seem to work-It only happens in this scene as well.
    upload_2020-10-31_21-22-36.png
    You can see the AI in the patrol phase in the picture above, but it is not moving right now.

    Previously, it was working, but once I moved the transform of the Seek and Destroy Gameobject, specifically more on the Y axis, this bug started happening. Does this have anything to do with the Waypoints,game objects Transform and the ground not lining up well? Keep in mind I also didn't change any other settings of the seek and destroy AI (I'm also having the same problem with another AI gameobject I'm making, but I'll refer to the seek and destroy AI since both have very similar properties)
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @dataEcto > Unfortunately I can't tell what's wrong in your setup just from that screenshot. If your issue persists, please use the support form, and provide context (Unity version, engine version) as well as steps to reproduce your problem, thanks.
     
  10. AKAGT17

    AKAGT17

    Joined:
    Sep 8, 2014
    Posts:
    34
    Hi Reuni in response to "
    @AKAGT17 > You're the first person to request it in 5 years, so unless people start requesting it massively, it has little chance to make it into the next release. As I said, it can already be done, you can poll the settings and auto start your music if you want, it's two lines of code (maybe why it never got requested, I don't know)"

    Would please guide which script is needed to modify this?

    Also on another note, when I create a prefab and I add a MMfeedback with audio then sound and I add a sound wav file, how come the sound plays in play mode when I already have the sound fx or music off in the settings option? Is there a step i'm missing? thanks
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @AKAGT17 > MMFeedbacks is a separate asset, it will play sounds if you ask it to do so. If you use the Sound feedback in event mode though, it'll go through the SoundManager, as explained in the documentation (or the feedback inspector itself).

    As for which scripts to modify, you don't need to modify any script, simply create a new class, have it poll the settings, and start the music on Start if needed.
     
  12. Ioruko

    Ioruko

    Joined:
    Nov 8, 2017
    Posts:
    8
    Hello again, @reuno ! Just a quick question, but can enemy characters actually have combo attacks too?
    Does it work the same for player character and enemy character?
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @Ioruko > Yes, absolutely, it works just like for Player characters.
     
  14. Ioruko

    Ioruko

    Joined:
    Nov 8, 2017
    Posts:
    8
    Thank you for the reply, @reuno !
    I tried implementing a combo for AI character and I have several problems:
    1) The enemy sometimes only makes first attack and stops.
    2) Sometimes the second attack is played simultaneously with the first attack (judging by the hitboxes activating simultaneously).
    3) The animation for the first attack sometimes doesn't play but the hitbox is activated (the same happens with player character. Mostly happens if the attack button is pressed soon after or while running).
    4) The enemy doesn't stop when attacking, although the "stop all movement while attacking checkbox" is checked (when going after the player, it continues to play the animation, while the AI brain state is Moving. I want it to finish the animation and then move).

    Should I post the details of my inspector here or should I use a support form to contact you?

    Edit: one more thing, after enemy attacks once, and player doesn't move, it doesn't attack again, just standing there idle (although AI brain shows Attacking state)
     
    Last edited: Nov 6, 2020
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @Ioruko >
    1 > That's probably something to tweak on your AI (see .5)
    2 > Same thing, it attacks when you tell it to
    3 > that's likely an issue on your animator (a transition preventing the desired animation to play). Tweaking your transitions to make sure it can't happen will fix the problem
    4 > that's something you can fix in your AI, by having it stop then attack
    5 > The AIActionShoot, if that's the one you're referring to, only attacks once, by design. You need to setup your brain to attack again if you want to (usually after a delay, and after checking range etc)

    Edit : if your issue persists, please use the support form, yes, thanks!
     
  16. Ioruko

    Ioruko

    Joined:
    Nov 8, 2017
    Posts:
    8
    Thanks so much for the reply @reuno !
    I managed to tweak the AI brain to attack again after waiting in another state, thanks for your advice!
    As you suggested the animation issue was fixed in transitions, good catch!

    I will try to fix the enemy moving while attacking next, thanks for all your help!

    Can you please tell me, for a combo weapon on enemy, how does the Time Between Uses affect the combo? I understand Delay Before Use, but with a combo weapon, it should switch to the next weapon in the list, when button is pressed. AI doesn't press a button, so I am not sure how that works, I would be grateful if you explained it to me.
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @Ioruko > It'll prevent use if your brain tries to attack too soon.
     
  18. Ioruko

    Ioruko

    Joined:
    Nov 8, 2017
    Posts:
    8
    Thank you @reuno!
    I'm sorry to spam you, but seems like Weapon Aim 2D script doesn't work for my AI enemies to aim at 4 directions. They can aim only right or left at the moment (I would like them to aim up, down, right and left, strictly four directional).
    How can I make this work?
     
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @Ioruko > Enemies will aim wherever you tell them to, there's no restriction.
    You can see examples of an enemy that aims at 360° towards the start of the RetroAI demo scene (one of the ghosts on a platform at the top right of the start position. If you have more questions like these, please use the support form, thanks!
     
  20. Ioruko

    Ioruko

    Joined:
    Nov 8, 2017
    Posts:
    8
    Hey @reuno , I'm sorry but there is no RetroAI demo in my version of Top Down Engine (ver. 1.9)
    The only melee weapon enemies (Ninja Sword Masters) in 2D Koala Dungeon demo are flipping their weapons on x axis. I would like my enemies to be able to aim strictly four directions.
     
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @Ioruko > Ah sorry, for some reason I thought you were asking about the Corgi Engine. My bad. But again, please use the support form for questions like that, thanks.
     
  22. Ioruko

    Ioruko

    Joined:
    Nov 8, 2017
    Posts:
    8
  23. dataEcto

    dataEcto

    Joined:
    Feb 21, 2018
    Posts:
    11
    Managed to fix my guard bug a while back-turns out I just needed to update the asset :p that's on me.

    New question now: How do I get the dash bar to update, like the one in the KoalaDungeon scene? Do I simply put the gameobject with the MMRadialProgressBar on the UICamer'as GUIManager?
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
  25. dataEcto

    dataEcto

    Joined:
    Feb 21, 2018
    Posts:
    11
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @dataEcto > Yes, that'd be this line in GUIManager's UpdateDashBars method :
    upload_2020-11-16_13-20-48.png
     
    dataEcto likes this.
  27. GrimGoon

    GrimGoon

    Joined:
    Mar 21, 2020
    Posts:
    1
    Hey!
    I'm building my own "UpgradeManager" that keeps track of a bunch of upgrades that my user can acquire during a "run".
    The inventory is great, but it's not really what I'm looking for in my use case.

    In essence, while a player is playing I want to add certain changes to the gun, the player's health, and so on and so forth. Which I have been able to achieve.

    However, I'm having a bit of trouble with my projectiles from my ProjectileWeapon as they are pooled.

    I can't e.g. simply just loop over the pooled projectiles and change a variable as it gets overwritten back to its original value every time I shoot and activate the projectile.
    I've tried a bunch of different ideas such as destroying the pool, changing the variable, and then creating a new pool.

    A bit of a headscratcher as nothing seems to work the way I intend it to.

    If possible I'd love some help and get a few pointers on how to achieve the above with pooled projectiles.

    Cheers!
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @GrimGoon > That depends on what you want to change on the projectile, but should be fairly easy to do in all cases. Basically, just like right now the weapon sets the projectile's direction on spawn, via its SetDirection method, you could have a SetSpeed method, a SetDamage method, if you wanted your projectile's stats to be driven by the weapon instead.
     
    GrimGoon likes this.
  29. cach

    cach

    Joined:
    Jun 9, 2013
    Posts:
    3
    Hey,
    I know the description says that your character can jump, but can you do it in 2d? It's just that the 2d demos don't show this (or I totally missed it). I would like to be sure about this before trying the asset out.
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @cach > If you press space in the Koala demo scenes, you'll jump.
     
  31. Luxxuor

    Luxxuor

    Joined:
    Jul 18, 2019
    Posts:
    28
    Ahoi,
    I noticed in the ProximityManager.EvaluateDistance the
    EvaluationFrequency calculation is not used to prevent an update every frame, is this by design or a bug?
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @Luxxuor > That was indeed a bug, and it's been fixed for the next release already. Thank you for reporting it though!
     
    Luxxuor likes this.
  33. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    94
    Hello,

    I have the Ninja sword Master AI in a scene. He is attacking a player only once. Only when player is walking a little bit the ai attacks once more. How to attack a standing player more times?
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @knuppel > This action only attacks once. In your state machine, you'll want to have a state to go to between attacks, and then a decision that takes you back to attack (usually after X seconds, but it could be anything you want).
     
  35. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    94
    Do you have an example for this? Do you mean, the ai has to move away from the player?
     
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @knuppel > No, as I said you just have to create a waiting state, and after a certain time (or any other decision of your choice) go back to the attacking state. No movement involved in this, unless you want to.
     
  37. DespairBear

    DespairBear

    Joined:
    Nov 1, 2013
    Posts:
    233
    Hey there. Just purchased the asset and am trying to reverse engineer by learning from the demos but am having some issues. In the Loft 3D scene weapons don't seem to be picking up, it will play the pickup sound and remove the object, but the object isn't appearing in the inventory. I'm running 2019.4.9f1
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @DespairBear > Maybe something went wrong at install. Please don't hesitate to use the support form to provide a bit more info about your issue (does it happen when installing in an empty project? what version of it are you using? etc), I'll be happy to help you sort this out.
     
  39. DespairBear

    DespairBear

    Joined:
    Nov 1, 2013
    Posts:
    233
    It seems that the weapon pickups work in all other scenes except for the Loft 3D scene? I'll try removing and reinstalling the asset. The project I imported it into was a clean project

    EDIT: On closer examination it appears that the shotgun outside the loft wasn't set to auto equip on pickup and I was unaware of the existence of the inventory screen. Thanks for the quick response! Just curious, is there an included inventory system that allows for use of keys 1-4, scrollable, etc as opposed to a menu style inventory (Minecraft, Half Life, etc)?
     
    Last edited: Dec 2, 2020
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @DespairBear > Ah yes, in that demo, you're supposed to either open the inventory to equip, or press T to swap to the next weapon (or equip one if you don't have one equipped). And you could absolutely have 1,2,3,4 bindings. There are no examples of that setup, but it's doable.
     
  41. AKAGT17

    AKAGT17

    Joined:
    Sep 8, 2014
    Posts:
    34
    HI Reuno , I'm trying to get the start of my game to have a nice fade in but I cant seem to get it to work on the Fader under the 3D camera, Canvas, Fader. Is there a tutorial to guide through? thanks
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @AKAGT17 > No, there's no tutorial for that, if there was one I don't think it'd last for more than 5 seconds :)
    Select your LevelManager, set the intro fade duration to X seconds. You're done.
     
  43. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    94
    Hello,
    i have a AI with a riffle gun attached. When a player comes near to the ai, the ai is shooting to the player (with auto aim). For this i duplicated the ninja sword master. This works fine in Unity Editor, but on mobile the riffle does not shoot bullets. I just hear a "click". Any idea? Do you need some more information?
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @knuppel > I spent an hour trying to repro this, unsuccessfully. I can't think of anything that could cause this. If you manage to find consistent repro steps of this behaviour in any of the demos, please use the support form to report it, I'll be happy to look more into it.
     
  45. willrhodes

    willrhodes

    Joined:
    Mar 2, 2018
    Posts:
    3
    Hi I'm using the built-in screen shake for a couple of feedbacks in my game, and I've run into an problem where the screen just starts shaking on scene start and doesn't stop. There aren't any errors in the console, so I'm sort of lost as to how to go about fixing this. It seemed to start right after I added a ButtonActivatedZone that had some screen shake feedback on activation. But after removing that game object, disabling every screen shake feedback in the scene, removing the MMCameraShaker and MMZoom scripts from my Cinemachine VCam, the problem remained. Not sure what to do at this point. Has anyone else had a similar problem?
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @willrhodes > Are you sure it's a shake and not just your cinemachine's camera noise?
     
  47. willrhodes

    willrhodes

    Joined:
    Mar 2, 2018
    Posts:
    3
    Ah that might've been it, but I haven't touched the camera noise any time recently so I'm not sure what I did to make it change. In any case, I've removed all of the cameras and managers from my scene, dragged in new cameras/managers from the Koala demo, and reconfigured them to my settings, and it seems to be fixed, although I'm still unsure exactly what was causing the problem in the first place. I'm going to slowly re-enable all of the screen-shake feedbacks that I'd turned off and I'll update here if the problem comes back and I'm able to isolate it better. Thanks!
     
    reuno likes this.
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    Good news everyone, I've just pushed v1.10 of the TopDown Engine to the Asset Store.
    The main new feature of this new version is a loot system, complete with table loots and advanced drop positions. It's a powerful and versatile system that should bring in a lot of cool new possibilities. Another big improvement is the possibility to now split abilities and AI actions/decisions across multiple sub nodes. It should help with the setup of complex characters, as well as offer nice options like enabling entire sets of abilities at once, or swapping entire AI brains. And as usual, it fixes all known issues reported to date.

    Here are the full release notes :
    - Adds a new Loot system, letting you have enemies (and anything else) drop loot on death, or damage, or when prompted. The spawn position, area and settings can be customized entirely. Comes with a loot table system, and loot can be defined per spawning object, or globally, and examples of it in use in the KoalaDungeons and Loft3D demo scenes.
    - Adds new ways to build characters, by letting the user split the logic components across multiple levels, both at the abilities and AI levels. This allows for easier management, as well as nice features such as realtime AI brain swap
    - Adds an example of an AI Character with split abilities, and AI brain in the Loft3D scene (PatrolSeekAndDestroyAI)
    - Adds an example of a Player character with split abilities in the Colonel demo scene
    - Adds the SwapBrain AI action, that lets you swap the current brain for another one
    - Adds the AbilityNodeSwap ability, that lets you swap an entire set of abilities on a character for another, at the press of a button.
    - Adds an example of a repositionable mobile joystick to the MMControls demo scene
    - Adds an example of a mobile swipe zone to the MMControls demo scene
    - Adds AIActionRotateConeOfVision2D, an action that lets you rotate your AI's cone of vision 2D towards either movement or weapon aim
    - Adds MMAutoExecution, a simple class lets you trigger Unity events automatically, on Awake, Enable, Disable, Start, or on instantiate
    - Adds AIActionAimObject, an AIACtion used to aim any object in the direction of the AI's movement or aim
    - Adds PickableDash2D, an example of an item that enables an ability on the Character that picks it
    - Adds the WeaponIKDisabler class, that lets you temporarily enable/disable IK when certain animation parameters are true. Thanks Muppo for the suggestion!
    - Adds MMApplicationQuit, a simple class you can use to exit your game, easily pluggable to a UnityEvent slot
    - Adds almost entirely refactored MMProgressBar, a complete progress bar system, now more performant, less costly, with new SetBar methods, optional interpolation, hide and show methods, better inspector, text options, speed or duration based, increasing and decreasing delayed bar support, event hooks (on bump, increase start / stop, decrease start / stop, radial bar support, coroutine based architecture instead of Update, and a dedicated demo scene, MMProgressBarDemo
    - Adds options to CharacterInventory, InventoryWeapon and PickableWeapon to specify what HandleWeapon ability should equip the weapon
    - Adds a public method to add proximity managed objects at runtime
    - Adds selector dropdowns to AIBrain, letting you pick Actions and Decisions without needing to drag and drop them
    - Improves the way inventory item drop works. Items created on previous versions will need to have their drop properties redefined.
    - TopDownController2D now also supports CapsuleCollider2D and CircleCollider2D
    - Adds an option to CharacterInventory to specify items to automatically add to the inventory on Start, as well as a weapon to auto equip
    - Adds a public method to AIBrain to reset it to its initial state from any class
    - Adds an option to WeaponIK to define the LookAt weights (defining the head's susceptibility to IK) directly from the inspector
    - Adds remap options and a better inspector to the float and shader controllers
    - CharacterPathfinding3D can now find alternate destination if its target is unreachable. Thanks Rush for the suggestion!
    - Adds an Unrestricted3DAim option to WeaponAim3D, allowing AIs to aim freely on all 3 axis
    - Adds an option to InventoryDetails to display details globally, regardless of target inventory
    - Adds options to every abilities' inspectors to specify blocking states
    - Adds an extra null check to MeleeWeapon to allow for a melee weapon without owner
    - Adds extra null checks to ButtonActivated's DisableZone method
    - Strengthens the RespawnAt cycle
    - Adds extra checks to LevelManager
    - The AIBrain now calls EnterState on its initial state on Start
    - AIBrains now force an exit state on death
    - Adds UI support to the new inputsystem demos
    - AIActionShoot2D and AIActionShoot3D can now use the ProjectileWeapon's spawn position to test for line of sight
    - AutoRespawn now resets AIBrains on respawn
    - Fixes a bug that could cause a wrong placement of the damage on touch gizmo
    - Fixes a frequency issue with the Proximity Manager
    - Fixes a bug that could cause improper speed resets when pressing/releasing run while crawling
    - Fixes a bug that would prevent grid based characters to reinitialize properly after a respawn
    - Fixes a bug that could cause some particle systems to keep looping on certain 2020.x versions
    - Fixes a bug that would cause poolable AIs with a AIActionMovePatrol2D component to respawn with an erroneous scale.
    - Fixes a bug that could occur when unequipping a weapon from a main inventory while a clone of it was equipped
    - Fixes a bug that could cause multiple weapons to get equip requests if the inventory contains multiple weapon clones
    - Sound feedbacks now don't interrupt prefab mode anymore
    - Fixes the DisplayReticle bool on WeaponAim classes being ignored
    - Fixes a typo in the destination scene of the MinimalSandbox2D portal
    - Fixes a broken logo on the startscreen
    - Fixes a MMCooldown bug that caused wrong refill durations
    - Fixes a bug that would force ObstacleDetection regardless of settings in AIDecisionDetectTargetRadius2D
    - Fixes a few axis in the Unity InputManager axis list
    - TopDownController's ResizeCollider method is renamed ResizeColliderHeight to better reflect what it does
    - Adds prettier inspectors for all weapon classes
    - Updates Cinemachine to v2.7.1

    Like v1.9, it requires Unity 2019.3.3f1 or higher, and expect a few days of delay as Unity validates it. I hope you'll like this new release!
     
    Candy-Bomber, xDeveloper and Muppo like this.
  49. hellobard

    hellobard

    Joined:
    Sep 26, 2012
    Posts:
    138
    Is there a way to pick up melee weapons in the 3d example scenes?
    Picking up guns works great, but I haven't found a simple way to pick up a sword for example.
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,357
    @hellobard > Pickup works just the same for all types of weapons. You can see an example of a pickable melee weapon in the WeaponCrateSword prefab. Note that this specific weapon enables a model on your character, and only the Tie demo character has one already setup. Others will still be able to use the weapon, but you won't see the actual sword.
     
unityunity