|
Post by cursedereaper on Feb 8, 2019 18:16:13 GMT
Hey everybody,
In Short which parameters trigger "Lost Target" and "Can See Target" Decision: I thought: Can See Target = Is target in Field of View + Distance to Detact (which seams to be the case) Lost Target = Is the player outside of the Lost target Distance (It seams to be the Distance to Detact that is used), and if the player is outside of the Field view for N Seconds (can't be proofed because lost target is set true when Can See target = false)
I wanted to create an FSM in which my Enemy follows the player if he loses sight of him and walks randomly. My Intention was: If the Player leaves the Field of View for N Seconds or the Player leaves the Lost Target distance the Enemy wanders arround (randomly) to find the player again and with luck he can find him.
Best regards, Mave
|
|
|
Post by Invector on Feb 8, 2019 18:34:45 GMT
You need to set the "Time to Lost Without Sight" then just set a transition back to Wander if there is no target
|
|
|
Post by Invector on Feb 8, 2019 19:21:26 GMT
The "Time to Lost Without Sight" will only start to count when the target is out of range, meaning the LostTargetDistance which as the descriptions says, "Considerer maxDistanceToDetect value + lostTargetDistance"
So, if you maxDistanceToDetect is 5 and your lostTargetDistance is 5, then the target must be 10 or higher to start the count of the TimeToLostWithoutSight
You can use the debug tools to better understand, such as: - Debug Last Target Position - CurrentTarget - FSM Debugger
|
|
|
Post by cursedereaper on Feb 8, 2019 22:54:40 GMT
I try it with the debugger all the time :/ I Have the FSM Debugger open, I look on the detection of the ControlAiMelee and look at "Target Is Lost" & "Target is in Line of Sight", I have the Scene open with focus on the Enemy with Shift+F, all Debug Options are all on. When I leaf the "Max Distance to Detact" my "Target is Lost" is set on True and my "Target in Line of Sight" is False. When I'm inside the "Max Distance to Detact", "Target is Lost" is True and "Target is Line of Sight" is True (which feels weird because how can it be Lost and in Line of Sight). And When I stay some time in the "Lost Target Distance" radius for some time "Target is lost" is set to false and not when I leaf the "Lost target Distance". And the Time I need to stay inside the "Lost Target Distance" radius is roughly the "Time to Lost without Sight".
When I make a Transition into my Wander State over the Decision "was the target lost" = True it enters the state when I leaf the "Max Distance to Detact". When I make a Transition into my Wander State over the Decision "Can See Target" = False it enters the state when I leaf the "Max Distance to Detact" as well. A Transition with "Can See Target" = True doesn't make sense to me and when I tried it I confirmed my prediction. In my tries to understand the system better I even looked what happens if I set "Was the target lost" to False. On my way to find a solution I even tried "was the target lost" = True and "Can See Target" = False. Which resulted into the following situation: I left the "Max Distance to Detact" radius with my character, "Target in Line of Sight" was on False, "Target is Lost" was still on True (hasn't changed since the detaction) but my State directly switched into the Wander State when my character left the "Max Distance to Detact" radius.
Am I missing a Decision, did I forgett a possibility or is the AI Melee Controller of my Version bugged? Should I upload I video? And if yes what should I show? Which Transition should I use for the Video and are there certain setting I should include in the Video? Or is my describtion enough to find a solution?
I even created a new Layout in Unity to check the behaviour by looking into the Inspector, the FSM Debugger, the Scene following the Enemey with Shift+F and the Game mode to see where my Character is going.
I'm sorry that I deleted my last post but I'm totally confused and I seriously don't know where the error is even after some hours of using every debugger I found in the Asset.
Or did I needed to unpack the 0.2 Version and into that the 0.3 version? I only unpacked the 0.3 version in my project. (I just saw that the 0.3 Version is smaller than the 0.2 Version)
|
|
|
Post by Invector on Feb 11, 2019 17:18:04 GMT
0.3 is smaller because we re-do all the animations in the project, so they are more optimized. You could zip your project (only the essential to demonstrate your issue) and send to inv3ctor@gmail.com so I can take a look if you want, but I'm pretty sure it's something silly like a transition or missing condition
|
|
|
Post by cursedereaper on Feb 14, 2019 2:40:46 GMT
I removed some unnecessary scenes and Assets (or Assets from other parties like Micro Splat) which increased the project size and zipped it.
I'll send it right away via a GoogleMail/GoogleDrive. And I'll shortly upload a video of the scene where I control the Player to run away from the Enemy as well.
I'm looking forward to hear from you.
Video were I use the FSM I used. I also found a way that could work a bit more towards my Vision by increasing the detaction Radius when the Enemy lost the player during a Chase. It's most likely not the best way to do that but at least I can show a bit more how I tought the AI would work. I certainly will keep the increased min detaction Radius for being in Combat to get rid of my problem when the player stands directly infront of the enemy.
|
|
|
Post by Invector on Feb 14, 2019 14:34:58 GMT
It seems to be working well, as you can see the target is lost when you're in the orange zone, also the canSeeTarget will be false since it's out of the MaxDistanceToDetect but he will keep chasing it for a while which in your case is set to be 4.4 seconds for the transition delay to the "Quick Look Around" state.
You could increase the MaxDistanceToDetect when he first detects the target and reset once it's lost to increase the chasing range
|
|
|
Post by cursedereaper on Feb 14, 2019 18:30:39 GMT
okay. From what I read in the Documentation I somehow thought that Lost Target is true when it leaves the Orange Circle after the "Time to Lost Without Sight" expires and not that the timer will start when the target leaves the yellow Circle. So I guess I missinterpreted the Time to Lost Without Sight. To prevent easily confused people like me one could write "How long it will take to actually loose the target if you can't see it. (Starts after target left the yellow circle)".
And that there is not misunderstanding Max Distance to Detact is Yellow, Lost Target Distance is Orange, Min Distance to Detact, and Combat Range is Blue.
Good thing you included the Set Distance Action. I already tried it in the video at hand at 1:50 by switch the FSM to a version that actually increases the distance and it works as I tought after 1:50 because of that. I simply tought it was a last resort method and not the actual soluton.
When I get better at writing custom actions I'll add an Increase/Decrease Distance Action (On Enter Increase on Exit Decrease) that way one would need less FSM for all the opponents because the Set Version will only work if the Enemies share the same detaction radius and the same FSM while a Increase/Decrease version would allow the same FSM on more different Enemies that are similar.
Thanks a lot for your time and explaining me how the detaction really works.
|
|