Search Unity

[Released] Deathmatch AI Kit

Discussion in 'Assets and Asset Store' started by opsive, Aug 24, 2016.

  1. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Yes.
     
  2. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Sorry my mistake. Just re-read your post. The only thing I can think of is that as you are on Unity 5.5 beta, its not yet supported. Best wait for the official line on this from Justin :)
     
    radiantboy likes this.
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Make sure you've imported the Third Person Controller - Behavior Designer integration. This page has a link:

    http://www.opsive.com/assets/DeathmatchAIKit/documentation.php?id=16

    Thanks for helping! I haven't tested the most recent beta but 5.5 should be supported. The big change with that which affected the Deathmatch AI Kit was that the NavMeshAgent class moved into an AI namespace.
     
    CrandellWS and julianr like this.
  4. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Yes I am using the 5.5 beta so I guess that is the reason :-( I definitely have the 3rd person controller installed. Must be something to do with the way the new unity does namespaces.

    EDIT: You said "Third Person Controller - Behavior Designer integration" can you provide a direct link to that ?

    EDIT: Got it that actually works, very confusing though to know to do that :) Cheers! let the fun begin.
     
  5. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Just watching the demo from the scene view, this is VERY impressive stuff. Really top notch, Unity finally has some good AI that is served on a silver platter!.. Thank you very much.

    Edit: they jump between platforms and drop, that's very cool!

    Edit: Lol, guy was hiding behind a door way for some bloke then a knife fight took place, this is really cool.. perhaps the knife and grenade anims could be improved but thats all I can say, I am loving how they dont get stuck or jitter around, can't wait to try apply it to my own models.
     
    Last edited: Nov 20, 2016
    opsive and julianr like this.
  6. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Awesome! Glad you got it working!
     
  7. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    So trying to integrate now, silly question, but when I add the layers for RedTeam etc and the Ledge ones etc, can they be any number layer or do they need to be the same as in the project? ie, can my "Ledge" layer be layer 32 instead off 22? Never understood why Unity cant merge project properties like this. I presume this is all you need to do to get it working if you did not import the settings along with the deathmatch package?
     
  8. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    The Deathmath AI Kit doesn't use the Ledge layer so unless you want the AI to use the Ledge ability then you don't need that layer. Stepping back a bit, all of the layers are configurable. The main ones for the Deathmatch AI Kit are the team colors, and that is set with the DeathmatchManager.

    Unless you are specifically creating a deathmatch game you won't want to use the DeathmatchManager though. The kit was built to be used within any game that requires enemy AI so what you'll want to do in your own game is set the TargetLayerMask on the DeathmatchAgent. These are the layers that the agent will seek. If you haven't seen it take a look at this video which shows setting everything up within a non Deathmatch game:

    http://opsive.com/assets/DeathmatchAIKit/videos.php?id=1
     
    radiantboy likes this.
  9. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Thanks very much for super support. Will check the vid :)

    Ideally I want the exact demo you ship to be working in my project before I start anything, and I dont want to miss out on anything cool, so yes I think I need ledge, the guys seems to work without the team layers anyway.

    Anyway seems to work, now im gonna remove player and integrate with UFPS.
     
    Last edited: Nov 20, 2016
  10. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    whats the difference between Agent Aydan and Aydan?

    And also I have the demo more of less integrated into my scene but they dont seem to spawn at the actual spawn points, not sure what is dictating where they appear?

    Edit: they appear to spawn randomly on way points, which is weird because I have team ticked.

    One thing I am doing is turning off the player (Ayden) as soon as he appears in order to have it all working, but without me playing him, this probably is affecting stuff? Seems fine actually, apart from where they appear.
     
    Last edited: Nov 21, 2016
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Agent Aydan contains a few components specific to the AI: the behavior tree and NavMeshAgent components being the main ones. It also doesn't contain the UnityInput component since the navmesh is controlling the movement.

    If you're trying to completely mimic the demo scene then the spawn points are determined by the DeathmatchSpawnSelection spawn selection component attached to the Waypoints GameObject.
     
  12. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Couple of issues so far:

    - guys spawn and just run to another spawn point and stop there (I see they have 3 way points set to the other bases, I guess this is so they get into the action (or did I do that?), but I would expect them to move onto the next way point after that, otherwise whats the purpose of the other waypoints? ) .
    - if they dont run directly onto stairs they just get caught and stand still in the corner where the stairs meet the walls. I thought they would use the nav mesh to find the steps.
     
    Last edited: Nov 21, 2016
  13. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Ah I think im getting it a bit more, they seem to appear where their team name object is (Green Team), and make their way to the first object inside like G1. I figured they just went running all over. Just trying to fully understand the demo in my own level :).. Any further info about the behaviour and what they actually do in this demo would be good.

    I realise its in the trees etc but one of the best parts of this thing is not having to dig too deep into that at first. The more I tinker with their way points I can sort of tease them to come at each other when I start the game. But after one killing spree they respawn or stay where they were and just hang around. Im looking for a way to keep them patrolling around. They also get stuck on some very tame things, like tiny drains etc, but I guess thats nav mesh stuff, increasing the step height doesnt seem to help in many cases, I guess I just need to make my scene more AI friendly in many ways..

    edit: Also is there a way to make the guys jump over something? I have one guy who keeps getting stuck on a tree trunk I have lying on the ground,.
     
    Last edited: Nov 21, 2016
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    On your NavMeshAgent trying increasing the stopping distance. You may also need to increase the Arrived Distance on the Patrol task in your behavior tree for your scene.

    Are they trying to go up the stairs but just aren't able to? You could try to increase the step height on the RigidbodyCharacterController. If that doesn't work (which it sounds like it may not based on your last post) then can you post a screenshot?

    You could add a jumping off mesh link:

    https://docs.unity3d.com/Manual/class-OffMeshLink.html
     
  15. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Thanks. Things working a little better. My main problem is still that after an initial burst of activity when I start the game (where everyone goes looking for each other and attacking) everyone then proceeds to just stand still forever. They do not go searching or patrolling even when I specify it and way points etc, after respawn they just stand still. How do I work out why this is? I am presuming I look in the behaviour designer, and see what the tree is doing right now.

    Some of the trees just seem to end, with no green going anywhere, and others end with it saying "search for target" but in reality he is just standing still. Here are a few screenshots of the trees themselves, not sure if I am doing something wrong. As I say I would like them to keep fighting, spawning, then looking for each other, I would expect to be able to leave it on for hours with no "deadlock".

    https://dl.dropboxusercontent.com/u/4194619/Snap 2016-11-23 at 03.27.50.png
    https://dl.dropboxusercontent.com/u/4194619/Snap 2016-11-23 at 03.26.41.png
    https://dl.dropboxusercontent.com/u/4194619/Snap 2016-11-23 at 03.26.03.png

    Also how do I assign a different leader in the demo I cannot work out where that is done. One of the issues could be is that they seem to have Aryden as their leader on one team but I have him turned off because I dont want to play as him.

    Anyway any help would be appreciated, Im digging deeper into the behaviour trees but they are very intimidating still at this point.

    As for the step height for stairs ive tried that, it is as if the guys dont pick proper routes around objects like I have seen in my past playing with ICE creature control, they picked a route to somewhere and then ran over to the stairs and used them etc. In this one I have to do things like place weapons half way up the stairs to encourage them to go up, otherwise they run straight into a corner somewhere. Its as if they dont actually know the proper route all of the time, but then other times they charge right up the stairs jump onto a platform and jump down and navigate quite well. All quite confusing, I have spent so much time on every AI asset and it always seems the same for me, maybe I do not deserve any AI in my game :) Anyway, this is still the best one I have tried so far, showing quite a bit of promise, but I've kind of hit a wall..

    Also not sure if related but I see lots of this error coming up:
    NullReferenceException: Object reference not set to an instance of an object
    Opsive.DeathmatchAIKit.AI.Actions.DetermineWeapon.OnUpdate () (at Assets/Deathmatch AI Kit/Scripts/AI/Actions/Attack/DetermineWeapon.cs:245)
    BehaviorDesigner.Runtime.BehaviorManager.RunTask (BehaviorDesigner.Runtime.BehaviorTree behaviorTree, Int32 taskIndex, Int32 stackIndex, TaskStatus previousStatus)
    BehaviorDesigner.Runtime.BehaviorManager.Tick (BehaviorDesigner.Runtime.BehaviorTree behaviorTree)
    BehaviorDesigner.Runtime.BehaviorManager.Tick ()
    BehaviorDesigner.Runtime.BehaviorManager.Update ()
     
    Last edited: Nov 22, 2016
  16. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    That assumption is correct (I've left the deathmatch game on to a score of 300 and they kept fighting).

    This error will definitely stop the AI from functioning properly so lets get that fixed and then see what it does. Line 245 points to:

    Code (csharp):
    1.  
    2.   if (targetDistance > primaryWeapon.MaxUse) {
    3.  
    So it's not getting a primary weapon. Within the DeathmatchAgent component do you have primary weapons setup? Primary weapons are required, though secondary and power weapons should be optional.
     
  17. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Looks like setting his class from Power to Primary stops that error happening ( I presume they can still pick up and use rocket launchers?), im just using your prefabs here. That seems to do the trick actually, Im going to leave it running for a while and see. Since I have scoreboard.cs turned off I presume it will just keep going forever if its working? So far so good!!
     
  18. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Looks like I had too few way points too far apart (ie the ones in deathmatch spawn selection under "spawn locations", they appear also to be way points that they run to, but also appear to maybe need to be quite close to each other - the name is a bit confusing imho). I added more and things got a whole lot nicer, they picked them at random I think to go to each time, very cool. Due to that and people spawning at them etc it keeps things alive for quite a bit longer (saw some excellent stabbing fests down by the lake! And guys jumping up on steps from the side, really is jaw dropping at moments. I am almost certain this is the AI I want to use once I get around these small things). But my dudes still freeze up, they idle doing nothing when plenty of warfare is to be had around them (sometimes looking right at each other), Im wondering if they cannot work out a route to find what they want (and again I need to know how you set a leader that could well be related), like if its impossible for them to navigate there maybe they get stuck, lots of walls and fences blocking things in this level. But ultimately they all end up standing lifeless after the initial interaction still strangely, even when there is a route they could do technically.

    Not sure how much screenshots help but:

    guys missing steps - https://dl.dropboxusercontent.com/u/4194619/Snap 2016-11-23 at 06.38.20.png (not sure why my steps wont navmesh properly, tried a lot! and could be it?)

    lifeless guys staring at walls not doing anything https://dl.dropboxusercontent.com/u/4194619/Snap 2016-11-23 at 07.21.59.png

    enemy not far from them standing not doing anything https://dl.dropboxusercontent.com/u/4194619/Snap 2016-11-23 at 07.22.28.png

    same but with a bit of the tree for him https://dl.dropboxusercontent.com/u/4194619/Snap 2016-11-23 at 07.24.23.png

    Some guys across the level, red lines show the link (but they all standing still) https://dl.dropboxusercontent.com/u/4194619/Snap 2016-11-23 at 07.38.07.png

    Great asset though mate when I see the life in these guys it makes me excited as hell. Cannot wait for my next step, UFPS integration :)) Then trying it in VR lol..... Like making your own Westworld :)))
     
    Last edited: Nov 22, 2016
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    For the enemies standing still, is there a particular task that they are getting stuck on? Are you getting any more errors?

    Try reducing the step size when baking the NavMesh. It looks like the NavMesh is trying to create a path when the height is way too high for the character to be able to step.

    Great to hear that you're enjoying it! UFPS integration will be really cool, but you'll get to it before I do. Right now my plan is to have compatibility around the same time version 2 of UFPS is released - this will also give me a great test of the AI with the version 2 codebase.
     
  20. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    No actual errors no its like the guys are stuck in a loop doing something, I think its looking for what to find next, it works brilliantly when they happen to spawn near each other and kick off another interaction, but when they all get alone they stand idle. The task (I think it is stuck on) for one side at least is "the agent is not the leader find the closest leader" although there is no leader, I cannot work out how to set one. Other teams guy is also stuck on "the agent is not the leader find the closest leader" but the leader I think is too far away or impossible to get to.

    Yeah step size and slope size I never seem to get it right, and my steps are probably all too big. Adjusting that does make the stairs seem more navigable but doesnt help the guys actually hit them more, dont get me wrong often they go up just fine, its actually when theyre coming at them from an angle they dont get them (and my steps arent at sane angles either which may affect it), if I had some ramps on the edges of the stairs it would work I think, but then a way point in front should also really. Maybe it was that break speed thing I adjust earlier, what was it lol.

    As for UFPS integration I got your sample, did not understand what it shows, but surely its half way there? I have integrated many times (rain, ice, and countless others, although im still no expert) so it should not be a problem. *Cannot* wait to show you the result, Im so excited by this whole thing. UFPS2 I think I am going to have to wait until this game is done, there is so much of the nuances that I am in love with of UFPS, not to mention 4 years of hard hard tinkering just to learn and adjust it (but never say never, although I think this late in the game I have other things to nail down). But for my sequel I will almost certainly try to use UFPS2. Exciting times indeed. I keep a playlist of my dev vids so will poitn you to my next vid :) Cheers.
     
  21. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I might have been wrong looks like they do form a V behind the leader successfully on one side, but then arent they supposed to patrol or something ?

    Other team now stuck on search for the target.

    Only just getting the hang of behaviour trees to be honest. Very cool stuff. It should flash the exact bit its doing now, to make it really clear for fools like me :)
     
  22. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Not 100% sure but I think setting the "Team" behavior tree settings may have helped, Max Distance to 700 (HUGE level so I tried) and Field of view to 360 (Dont mind if they have eyes in the back of their head). Not sure, but will keep playing. I also have guys who drop off the planet, I wonder if their distance is affecting this and also maybe why max distance works sometimes. Anyway, such fun, there is light at the end of the tunnel. I dont mind digging my way out with a toffee hammer if I know there will be light :) Been so many false starts on the AI front for unity it hurts! UFPS crew will go wild for this man.

    ps -some beautiful footwork there they stand on things correctly, no idea how you did that

    Edit: Made you a thoroughly enjoyable video that shows what the hell I am talking about lol, will PM it, thanks dude.
     
    Last edited: Nov 23, 2016
  23. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Progress :)

    Take a look at this page which describes how the behavior tree works. I think once you have a general idea of how everything fits together you'll be able to debug a lot easier. From your earlier screenshot it looked like the NavMesh was being generated where it shouldn't be near the stairs so if you reduce the slope height under the bake tab it should prevent those agents from getting stuck. This won't prevent the agents from getting stuck in the middle of the map but for that you'll want to see which task is active. From there it'll help narrow down why the agent isn't moving. If you select the character and have the NavMesh tab open you should also be able to see if a NavMesh destination was set.

    The integration that I am referring to is the full-fledge integration where UFPS and the Third Person Controller share many components and just the perspective is different. You are correct though that it is pretty straight forward to get a UFPS character taking damage from a Third Person Controller character, and visa-versa.
    Looking forward to seeing what you've come up with! Yeah if you're that far along in the project I definitely don't recommend updating to version 2 as it'll be a complete overhaul of both UFPS and the Third Person Controller.

    I think that you're almost there, just need to tweak a few more parameters. I too am really looking forward to getting this in front of the UFPS community - one of my favorite games is Halo 2 and having a deathmatch game with a first person view will be really fun.

    IK :)
     
  24. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Struggling to get this working with UFPS, do you have any tips on giving and receiving damage with UFPS and this AI?
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I haven't dug into that part of the UFPS code yet so it took me some time to look into it. On the vp_Bullet component you can set the damage mode to Both. This will then allow you to damage both a UFPS character (using the DamageHandler) as well as using SendMessage to send the affected GameObject a message. The method with the inputted name will then be received by the hit GameObject. From the Third Person Controller side of things you can use the damage event.
     
    radiantboy likes this.
  26. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Excellent stuff mate, will try that approach, I have it working kinda cool, this is sublime!!!...
     
    opsive likes this.
  27. Mr-Fox080

    Mr-Fox080

    Joined:
    Jan 22, 2015
    Posts:
    2
    Can someone help me, I've been trying to make it work for hours and only presents errors ...
    I still have a problem with my unit version 5.4.1 .... please see attached in the emails my invoices and image of the error ... I already downloaded the site file and so far are errors ... next time I suggest selling a single pack with everything together, it gets easier and we save time .... even if it is 500 $ ....

    Please see my mistakes ... anyone has an idea ...?

    my skype studio.play3

     
  28. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I was able to help Mr-Fox through email but if anybody else receives this error make sure you've imported the latest version of the Third Person Controller.
     
  29. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    Does this AI take into account all character abilities such as jump, climb, fall by default or do we need to manually create off mesh links for this to happen?

    (also, on the first post you've linked Behavior Designer twice when you wrote movement pack - is the movement pack included now or is this an error?)
     
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    The Jump, Fall, and Use Air Lift abilities will start automatically by the AI. There aren't any climbing objects in the demo scene so that part isn't included, but you'd take a similar strategy as jump and air lift by creating an off mesh link for climbing.

    Thanks for the heads up - I've changed the link. The Movement Pack isn't included with Behavior Designer.
     
  31. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    No problems.
    I've also taken a deeper look at the Behaviour Tree.
    I see it has code for dodging grenades if the character is within a certain radius (I'm guessing the projected splash radius).

    Does it do this while the grenade is in flight or just after it has landed? Can it also be programmed to dodge non-hitscan projectiles in flight such as slow rockets based upon their trajectory?
    (not just dodging the projected splash area but also the actual projectile itself - I guess this would fall under local avoidance, with dashes/rolls/dodges/jumps for high urgency movement and simply moving/stepping to the side for low urgency)


    Actually, I found a breakdown specific to the grenade on the next page. It states that there is a 3D trigger collider around the grenade that agents use for avoidance.
    Wouldn't it be better to use projected splash area and trajectory?
    Otherwise you may get agents running away from the grenade towards the projected splash area, or conversely trying to dodge a grenade that is going to safely pass them by?

    eg. they are behind low cover and are able to duck and stand up and have a drop behind them
    - a grenade flies toward them and even though they are within it's trigger collider range they simply duck down and let the grenade arc over their head and into the pit behind them, detonating safely out of range.
    - they could easily know that the trajectory intersects them when standing but not while ducking
    - they would know that when ducking the trajectory will continue past them overhead and that they will not be in range of the projected splash area.

    With the current system they would move out of cover, unnecessarily exposing themselves even if they were in no actual danger, simply because they were within the trigger collider radius of the grenade.
     
    Last edited: Jan 24, 2017
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    The grenade has a trigger around it so if the agent enters that trigger and the IsNearGrenade task is being reevaluted then that branch will run. This allows the agent to avoid the grenade when it is in the air as well.

    You could have the task also check for any triggers from a projectile (the rocket) but it doesn't predict where the rocket is going to land based on is trajectory. That doesn't mean you can't add some logic to the task which does this prediction though and then decides if the rocket should be avoided.
     
  33. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    Ok probably the cheapest way that I can think of is to fire a few raycasts along the projectile's current forward momentum when the agent triggers the area projectile trigger collider and test whether it intersects with various agent colliders (perhaps one for jumping, one for standing, one for ducking, one for prone) for more accurate last minute matrix-style avoidance (plus a raycast towards terrain that ignores agents to temporarily mark the splash area and continued trajectory as unsafe, for the purposes of dodging).

    This wouldn't work very well for grenades though as you can't raycast in a parabola..
    I suppose you could run an equation for the intersection of a parabola and a short line in 3D space.
    Lots to think about..
     
  34. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    There's actually a recent thread about this topic in the General Discussion forum:

    https://forum.unity3d.com/threads/battlefield-shooting.452221/
     
  35. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    Thanks, I tried searching in your forums but search is disabled for guests and creating an account requires an invoice number. I've since purchased the assets but perhaps something to keep in mind for potential customers wishing to evaluate the support and available options..

    As for the parabola problem, the best option seems to be to calculate a number of points in 3D space along the parabola, then raycast from 1-2, 2-3, 3-4, etc to search for collisions and then calculate a bounce (if colliding with the x/y plane then reverse the z direction for example), and pop a sphere area at the point of final detonation with a raycast to any targets hit (that are potentially behind obstacles like walls).

    More points would be more accurate especially for grenades bouncing off convex corners but you could either do more points in total or more points near such corners..

    I'm not that great at maths but thankfully most of these problems have already been solved by someone else :D
     
    Last edited: Jan 25, 2017
  36. yohami

    yohami

    Joined:
    Apr 19, 2009
    Posts:
    124
    How long for UFPS2? Im trying to figure if I should attempt the integration myself or do the game as a 3rd person and wait until UFPS2 is ready to ship it
     
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Unfortunately it's still many months away. I have the base structure in place and working really well, it's now adding on top of it that is going to take a lot of time. This should be the more fun part though and I'll be sure to post updates when we make significant progress (we'll also be running betas before release - this includes the deathmatch addon).
     
  38. yohami

    yohami

    Joined:
    Apr 19, 2009
    Posts:
    124
    Thanks for the response. How long is many months? 2017, 2018? I see the multiplayer addon for UFPS, is there an alternative for Third Person Controller / Deathmatch?

    Im doing a multiplayer first person shooter / tower defense game.
     
  39. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Definitely 2017.

    The Third Person Controller supports UNET, but currently the Deathmatch AI Kit does not support any multiplayer out of the box. We do have plans to add it but it will be after version 2 is released.
     
  40. SkyTech6

    SkyTech6

    Joined:
    Jul 14, 2015
    Posts:
    151
    @opsive hey, I've been looking through the behaviour tree and code for the Deathmatch AIs (Solo and Team) as well as some of the code.

    Whenever I run into an AI while playing it seems like almost ALWAYS their first move is to throw their grenade at me... Now sure that's probably the smartest decision and makes sense to take a large chunk of my health off at the start of a fight... it also seems very gamy that the AI seems to do this so often.

    I've narrowed it down to maybe being the Determine Best Weapon? But I don't see where it's actually determining to use a grenade. Can you point me in the right direction? I plan to add a random probability to this (something really low) so they won't throw grenades on first contact as often haha.
     
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    You're correct in that the DetermineWeapon task selects the grenade to be used. If you do a search for "Grenade" within this task you'll find a few hits, but the task works by having all of the weapons available and then slowly narrowing them down as the task tests different situations. If you want to add a probability for if the grenade should be used I would add it to the check at the top of the OnUpdate method:

    Code (csharp):
    1.  
    2. if (m_WeaponPool[i].Class == WeaponClass.Grenade) {
    3.  
     
    SkyTech6 likes this.
  42. sjkwan2222

    sjkwan2222

    Joined:
    Mar 9, 2017
    Posts:
    3
    Hello guys,I can't find the "AIAgent",Can you tell me where is it?
     
  43. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
  44. sjkwan2222

    sjkwan2222

    Joined:
    Mar 9, 2017
    Posts:
    3
    I already download the "Behavior Designer","Behavior Designer-Movement Pack" and "Third Person controller".But I still can't find the "AIAgent" and "SharedItemType".Is "Third Person controller" same as the "Behavior Designer/Third Person controller"?
     
  45. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    They are separate packages - you'll need to download the Third Person Controller integration from the Behavior Designer samples page. Enter your Behavior Designer invoice number and the Third Person Controller integration is the sixth image down.
     
  46. sjkwan2222

    sjkwan2222

    Joined:
    Mar 9, 2017
    Posts:
    3
    ssssssssssssss
    The problem has been solved,Thank you very much!
     
    opsive likes this.
  47. Marakesch

    Marakesch

    Joined:
    Mar 28, 2016
    Posts:
    6
    Hello Justin,
    Just bought your great assets. Try to adopt ufps and deathmatch ai kit, what is looking for shortcut for takes damage player and ai.
    Kind regards
     
  48. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks for your purchase! Official UFPS integration will be added with version 2 later this year. If you want to add it right now you'll need to modify the UFPS scripts so it can recognize the Third Person Controller Health component. The weapons will also need to be modified so UFPS and TPC can equip/fire the same item. Unfortunately it is currently a lot of work to get the two systems to play together.
     
  49. Marakesch

    Marakesch

    Joined:
    Mar 28, 2016
    Posts:
    6
    Thanks for fast reply. Probably now is better options to make 3rd person view than try integrations+) I try easy concept, just map, npc and player, task just destroy them all.
     
  50. Dennis59

    Dennis59

    Joined:
    Jan 8, 2013
    Posts:
    66
    I setup my project as explained in the instructions but I am getting the following errors. Any suggestions on how to fix would be appreciated. Thanks