Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Combat Framework

Discussion in 'Assets and Asset Store' started by username_unity_of_my, Aug 29, 2016.

  1. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Bugfixes mostly version 3.2 released.
     
    Last edited: Feb 28, 2017
  2. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    I picked this up yesterday and so far I'm really loving it. I've previously purchased every other 3rd person controller on the store and had various issues with all of them. The big 3 controllers by Opsive, Ootii, and Invector were the most promising, but I was constantly nagged with issues and odd behaviors that were unsatisfactory. So far this asset has worked for me out of the box very nicely and I look forward to getting into more of the features soon.

    I have one big complaint, however. I imported another asset from another vendor and was seeing models with default materials instead of the proper materials and it took several hours and a support conversation before the author mentioned that a custom import script might be the cause. He was right, there is an FBX import script contained in this package that was causing the problem. There's just no reason that such a custom asset importer should exist in a published package. Those scripts are supposed to be for the game developers to make and use, not for asset developers to include. I would recommend that it be removed from future versions or that some type of warning were indicated and instructions on how to remove it once this asset is installed.

    Great job though overall. I actually have a character now that can run over any terrain, uneven surfaces, slopes, etc. without jerks, stops/starts, sliding or any other nagging little problem that I've seen with other controllers. I hope the rest of the features work just as well.
     
  3. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Yes, you are right, I have fbx import script that prevents creation of materials on import. I like to import/create materials myself and it is very frustrating for me to delete materials every time I import model.
    I wrote in the docs that I have it included and that user can delete it if he/she dont want to use it.
    Well, its easy to remove it from package - so I'll do it in next update.
     
    magique likes this.
  4. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    something news after the update for example npc intigration, have also long since seen nothing from the inventory :)

    Excuse the question I'm just intressiert
     
  5. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Yes, generic npcs are done. Just finishing touches and to release.
    Inventory next.
     
  6. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Does the plugin manages characters AI also ? If yes what does it uses for characters navigation avoidance ?
     
  7. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    i think nav mesh !!!
     
  8. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    nice late question when i build a multiplayer rpg it is possible that all works fine with combat framework `?
     
    Last edited: Mar 16, 2017
  9. Sov3R3igN

    Sov3R3igN

    Joined:
    May 24, 2016
    Posts:
    22
    I noticed under the description of this asset it says "Require humanoid rigs." so this means there is no model with it at all? And i should be able to use this with an model/models i have?
     
  10. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Yes, simple AI by default which you can extend, Custom local avoidance.
     
  11. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    I don't see why not.
     
  12. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    You get what you see in demos. Models, animations, scripts etc..
    If I ever make video or demo with assets ( models/animations) that are not in the package, I will explicitly emphasize.
    Note that you can, of course, replace all animations with ones you like.
    Current version requires humanoid rigs for player and npcs.
    Next version, which will be released soon, will have possibility to create npcs from generic rigs ( among other improvements ).
     
  13. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    When can we expect to see swimming, push/pull, and rope climbing? Also, for swimming, will the character be able to swim underwater or just on top of water? I'd love to see Tomb Raider style swimming.
     
  14. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Push/pull, rope climb, open-go through door and some other animations very soon - its already implemented in tests.
    Swimming not yet for now.
     
  15. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    Thanks for the update. I look forward to it.
     
  16. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Ok, version 3.3 is released.
    Package now supports generic npc rigs plus many improvements.
    I had to make custom match target system , advantage is that you can use any bone as effector.
    There are examples of ranged npcs.
    More on updates in v3.3: v3.3 release notes.

    Thank you.
     
    Last edited: Apr 8, 2017
    antoripa and magique like this.
  17. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    Hello wanted to ask if you can make a new video with the updates and bugfix of 3.3
     
  18. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi.
    About the ennemys are they sliding between each other as you use only Navmesh ?

    Would it be compatible with this better code that avoids NavAgent sliding issues (because Unity avoidance is not a real avoidance system) ?
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class enemyMovement : MonoBehaviour {
    5.  
    6.   public Transform player;
    7.   public Transform model;
    8.   public Transform proxy;
    9.   NavMeshAgent agent;
    10.   NavMeshObstacle obstacle;
    11.  
    12.   void Start () {
    13.     agent = proxy.GetComponent< NavMeshAgent >();
    14.     obstacle = proxy.GetComponent< NavMeshObstacle >();
    15.   }
    16.  
    17.   void Update () {
    18.     // Test if the distance between the agent (which is now the proxy) and the player
    19.     // is less than the attack range (or the stoppingDistance parameter)
    20.     if ((player.position - proxy.position).sqrMagnitude < Mathf.Pow(agent.stoppingDistance, 2)) {
    21.       // If the agent is in attack range, become an obstacle and
    22.       // disable the NavMeshAgent component
    23.       obstacle.enabled = true;
    24.       agent.enabled = false;
    25.     } else {
    26.       // If we are not in range, become an agent again
    27.       obstacle.enabled = false;
    28.       agent.enabled = true;
    29.  
    30.       // And move to the player's position
    31.       agent.destination = player.position;
    32.     }
    33.    
    34.     model.position = Vector3.Lerp(model.position, proxy.position, Time.deltaTime * 2);
    35.     model.rotation = proxy.rotation;
    36.   }
    37. }
    from
    https://www.gamedev.net/resources/_...-avoidance-for-rpgrts-games-using-unity-r3703


    Or does your plugin already includes ennemies behaviour aware of other ennemies position and have smooth navigation without sliding like most Unity games using basic NavAgent only ?
     
  19. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Hello.
    Yes, I was meaning to make tutorial video- current one is old already. I just have to finish work on some other things first.
    What bugfix do you mean?
    You can try demos - they are always updated.
     
    Last edited: Apr 17, 2017
  20. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309

    What sliding do you mean. I dont use NavMeshAgent and NavMeshObstacle, I use default NavMesh and custom dynamic avoidance - which BTW I will release separatly here on asset store ( I already submitted ).
    You can tweek distance you want your characters have from eachother when moving.
     
  21. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It's even better and a good character avoidance system it's something i could be interested.

    Something i noticed on your videos is with lot of ennemies, they move in front of the the player around the player 180° most of the time , others don't move to the back of the player like Legend of Zelda game for example.
    Ennemies seem to align in front , left right, they seem not be able to align at 45°, it would work for ranged attackers or when you want more than four characters to attack at same time.

    The concern i have about your plugin is optimisation, for example AI can have more than seven scripts , if i must manage lot of NPC this will be lot of scripts running simulteaneously.
    For example all Audio script could be merged, Health and Ragdoll script should be included in TPS script.
     
    Last edited: Apr 18, 2017
  22. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Just want to add that dynamic obstacle avoidance ( character avoidance ) has been updated in version 3.3. Its no longer that same as in prevoius videos.
    Here is the demo from abstacle avoidance package: choose follow scene where npcs are following the player and they are aligning themseves around player in 360.
    LINK.
    BTW: Scenes are divided in GuardZones which manages npcs, you can choose how many to attack while other wait near in fight area range. It could be 1 or 100. Also npc calculations are calculated only on those in zone. GuardZone and npcs have visibilty field so you can disable/enable components based on visibility.
    Plus there is SceneZone and Scenegraph scripts which you can also place in scene to further optimize - They activate/deactivate objects based on player position.
    Regarding health, damage indicators and other npc components, they are made this way just so user can replace them with their own. They are just placeholders really - default components. User can use or improve them or replace them entirely.
     
    Last edited: Apr 18, 2017
  23. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It's great, but i have detected some small issues
    - there is still some small pushing here and here between Npc
    - When the player is surrounded and move to a close location, Npc follow, but other Npc already close doesn't move and do not rotate to face the player new location.
    - When player stay close to some wall (big container side), characters continue to walking in circles around while there is free space for several Npc to come close to player.
    - Npc that can't reach the player , walking around make some fast glichty rotations sometimes when they encounter other Npc.
    -Npc that can't reach the player that is full surrounded walk in circles, it would be better to have the player detect he is surrounded and have the Npc use that info to stop walking in circles.
    - There was a free space to have one or tow characters, but the Npc ignored it and continue working in circles around.
    -The distance from player is somewhat too big for melee
    - On the patrol scene when Npc arrive to destination and go back, the stop to run again movement is weird, but i think it's the asset example and animation that would need fine tunning ?

    Can we tweak how much distance we want between Npc and player and between Npc and Npc ?
    Can we have different Npc body sizes and have avoidance still working good ?

    It's really good and i think the perfect avoidance is only for AAA studios with several guys working on it.
     
  24. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309

    Regarding pushing, you can increase obstacle resistance value - if you set it high, npc will not even touch it. You must keep balance and allow it to push it a little because what if there are lots of obstacles on the scene, npc would get stuck - this way npc is looking for least resistance and go through - that means if there is no other way they will push obstacle.
    But like I said, I wou want, you assign high value to obstacle and npc will not go near.
    There are lots of values to tweek: distance at which avoidance kick in, strength of avoidance etc. There are more stuff to tweek in Obstacle Avoidance package that in CombatFramework but I will implement it there also.
    Also regarding circling - this is obstacle avoidance algorithm - it up to user to make npc stop if there are ( insert number ) npcs already around player.
    Regarding distance to player stoping - In demo I set it to 2 ( I think ) but you can change that to whatever you want.
    In the package you can assign smoothing character movement - If you use smoother movement - you increase performance, so you must balance. Its up to user to assign how large is smoothing array ( for calculating movement smooting average velocity).

    Note that in CombatFramework there is no obstacle avoidance on dynamic objects only characters for now. Im yet to implement avoidance on objects ( need to copy from ObstacleAvoidance package).
     
  25. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Good.
    Having avoidance plugin like yours would be great for many projects.
     
  26. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    Are there any plans for integration with Inventory Pro?
     
  27. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Hmmm, I don't know.
    I haven't tought about it.
     
  28. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    176
    Love this frame - Couple questions - what would suggest for adding an additional missile weapon type - that doesn't require the bow draw / charging routine? Ive tried understanding how arrows work but cant find a script on them - even in game. (WHAT IS THE MISSLE SCRIPT AND MISSLE WEAPON ATTACHED TO?) Do they raycast or detect collision? For instance how would you implement guns as a pickup (Seeing as you now have a robot demo)? and finally do you have plans for multiplayer?
     
  29. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Is there some lock on target system ?
     
  30. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Arrows are drawn from ArrowPool. Arrows are created ( not instantiated if there is free available ) on passed transform and updated in ArrowPool::UpdateArrows. Arrows have lifetime which starts after arrow is fired. After lifetime ends it return to pool.
    All characters which use arrows are using ArrowPool.
    You can use arrow pool with bolts or other projectiles just change mesh. ( Maybe I should called it ProjectilePool or something but at first I meant to use arrows and bolts only).
    Arrows are using raymarching for hit detection ( raycasting on current and previous position ).
    You can always use your own methods for shooting and not use ArrowPool.
    Look at the MechControl script on how robot fires. There is not per projectile path obstacle checking but general obstacle checking by AttackSweepBody ( If robot shoots - it hits, if there is obstacle robot changes position ).
    Yes, I plan to add multiplayer in next update or one after that.
     
    BryanO likes this.
  31. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    There is bodyLookAt parameter you pass in control() method. If strafing, bodyLookAt is camera forward direction, if rotating to movement direction bodyLookAt is move direction. To lock onto something just pass look direction to control() method.
    Note that player will keep turning towards primary target unless input movement says otherwise.
    So if you attack npc and dont move in other direction, player will turn towards primary npc.
     
    BryanO and zenGarden like this.
  32. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    176
    Thanks for the previous answer- Another question:

    On the Melee Weapon Item Script there is a public gameObject slot for "Impact_Colliders" and "Replacement_clips" - what is these slots used for? None of the prefab weapons examples you provided seem to use this slot for set up - is it used only during run-time?
     
    Last edited: May 2, 2017
  33. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    If ITEM_COLLIDE_WITH_ENVIROMENT is defined you enable weapon to collide with enviroment. Like, if sword collide with wall attack breaks ( OnCollisionStay method is enabled ). You assign impact colliders as colliders that collide with enviroment or you can use it to collide with npcs if you wish. Open WeaponItem and PhysicsInventoryItem there is explanantion. Although I dont use it..
    On MeleeWeaponItem there are fields where you can assign attack, heavy attack, block stance, block hit, locomotion animations per weapon basis.
    Replacement clips are any other animation you wish to change. For example I use it on lighsaber weapon to change weapon draw clip.
    You assign original animation clip name and replacement animation clip to replace it on equipping weapon.
     
    BryanO likes this.
  34. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I know the kit is not a general AI kit but does it manages that :
    - ranged ennemies ? Able to circle around to not shoot other ennemies and find a line of sight to the player.
    - can ennemies use tagged covers
     
  35. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    In current demos enemies cannot hit eachother and no covers.
     
  36. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Good, about predefined covers i can code it, it is easy to add custom decision and behaviour to a character ?
    Like low on health find closest cover and use healing spell or potion ?
     
  37. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    You can extend base NPCScript ( there are examples in the package )
    You can add another state to NPCScript along chase, idle, wait, return2post to do healing when health is low. Just change state to whatever you want and do whatever you want in that state. Remember to add aditional condition to NPCScript.playerInZoneAlert() or NPCScript::startChase() or npc will keep switching to chase state under current conditions. ( Current conditions are: target visible( sweep body obstruction test)? target in front ( under view angle) target reachable( by pathfinding)? npc not in chase state? - you can add health over <some num> ? ).
    Or you can derive from NPCScript and return to CombatIdle state when health is low. In derived script you can add all kinds of behaviours and implement it in _combat_idle_state() method override.
    Keep in mind that, to interact with player and/or other npcs - you must implement IGameCharacter interface. Other than that - you can do whatever you want.
     
    zenGarden likes this.
  38. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    176
    Is there a simple way to enable enemies attacking each other?
     
    Last edited: May 4, 2017
  39. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Npc enemy is of IGameCharacter interface, player and npcs are all implementing IGameCharacter interface, so you can assign any player or npc as enemy - its just untested yet. I made it this way so I can implement friendlies, teams etc. in future.
     
  40. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I expected something like Dark Souls, you can lock and unlock as you want, when locked whatever you do you are locked. Anyway this is something i could code myself.
     
  41. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    I haven't tested it, but I think you can do this easily: set lock target ( enemy transform ), enter strafe mode and set bodyLookAt direction to that enemy.
    I'll probalbly do that at some point.
     
  42. Glen-FX

    Glen-FX

    Joined:
    Nov 16, 2013
    Posts:
    1
    Hi, I just found this asset and it seems to be what I'm looking for, but I have a couple of inquiries.

    Basically i'm an artists who can't code so I'm looking for an asset or framework that lets me create topdown action adventure games or pseudo rpg kind of games like "Veil of Darkness" (which is more adventure than rpg) or "Zombies ate my Neighbors" (which is more action oriented).

    So my first question is about the character setup, can I use my own models and rigs? or this is intended more for mixamo ready rigs?, if I can use my own rigs, do I need to follow a specific setup/naming convention?, do I need to prefabricate a mecanim setting or this framework handles this for me?.

    My other question is about the GUI, is there a way to add a health bar and maybe a simple icon driven GUI the player can use to change/switch weapons or use skills like Zombies ate my neighbors or diablo 3?

    I read you are working on an inventory system and wanted to know if it will be customizable, the games I have in mind will use mostly weapons and quest items and I dont think I will use armor items so it would be cool if I can create the slots I need as well as being able to use custom graphics for it.

    Do you suggest I use another easy (artist friendly) asset for the GUI and quest system? or you will implement something for it as well in future releases?

    Thanks for your time and I hope this asset is what i'm looking for :)
     
  43. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Yes, I tested with various model sources not just mixamo, here is demo with several different models: Model Testing
    No bone naming conventions needed.

    You can use default health bar, improve it or create your own from Stats::currentHealth.

    Im working on inventory, multiplayer and some other triggers/animations.
    current equipment switching keys are 1,2,3,4. ( one handed, two handed, bow, dual ).

    I dont know, I haven't used other GUI, but i think you can easily use any of them - just use values from Stats script - you can extend it further if you wish.

    Thank you.
     
    BryanO likes this.
  44. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    176
    When do you think multiplayer will be ready? :) Do you need a beta tester?
     
  45. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    I dont know exactly, not very long I think ( unless something unexpected happens ). Maybe I do - we talked on email and I'll contact you for test run, ok?
     
    BryanO likes this.
  46. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    Has anyone used this with AI Warrior? Any ideas how hard it would be to integrate another AI asset? I'm interested in having a combination of the AI provided by CF and additional AI from AI Warrior as needed for special cases.
     
  47. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    Also, I think the method for attack sounds is backwards unless I'm missing some feature. Watching the tutorial video when a weapon is created it lets you specify attack sounds. For the sword there is a metal clank sound like sword hitting sword or sword hitting metal shield. But this assumes that you're hitting something metal. If I attack a zombie then I'd want a body hit sound not a metal clank and for a wooden crate maybe some sort wooden sound. Shouldn't the attack sound be based on a combination of what kind of item is being hit as well as what item is attacking? You would for example get a different sound for metal sword on wooden shield versus metal sword on metal shield. And different sounds again for wooden staff on metal shield versus wooden staff on wooden shield. That can get a bit complicated, but at the very least it should consider the target object more than the attacking object. So at least you'll get a flesh sound when attacking flesh, stone sound when attacking stone, wood sound when attacking wood, etc.
     
  48. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309

    There is OnSwing, OnHit, OnBlock etc.. callbacks. You can use those for playing sounds based on whichever system you want. I use it for chainsaw weapon sound instead default sounds.
    You're right though, I'll implement array of materials on weapon item which each refereces array of sounds to play upon impact.
     
    magique likes this.
  49. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    How difficult would it be to implement a 2.5D side-view combat system ?
     
  50. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    309
    Very easy I think. As a matter of fact, I plan to implement demo of side scroller 2.5D type.
    Just disable movement on vertical axis and implement camera that follows player left - right.
     
unityunity