Open mike123yy opened 2 weeks ago
Hi @mike123yy
Can you please send that monster to chris@thegamecreators.com and I will be able to investigate further.
I just emailed him to you. I should mention I have used the script with a couple different boss fights with monsters and they all do the same thing. Make sure to set the health to probably at least 2000 so he doesn't die too quickly to get the same result.
Why did you walk off the navmesh then back on the navmesh, its not very clear what is happening, perhaps a clearer video showing the player only and the enemy and the navmesh would help identify the problem
I was stepping backward to try to get him to glitch out and accidentally stepped into a pond in the level. I didn't know that would make a difference. I made a new video, the first half is a blank map and the second half is my level map but I turned on the daylight. Whats interesting is on the blank map it doesn't really glitch out. It does do the hurt animation every time the character is shot but I can understand why that happens, although it would be helpful if you could adjust the frequency of that. On the level with a lot of trees and obstacles it glitches out almost immediately. I turned on diagnostics too so you could watch what's happening when it's glitching. My screen recorder was acting funky so there's no audio and some stuff turned purple but I think it gets the point across :-)
https://drive.google.com/file/d/1YNKk_PT1Jq-gD3n14SkerlAkKyFD3DSO/view?usp=sharing
One more thing I noticed is that when he's glitching out if you walk up to him it will make the character snap out of it. You can see that in the second half of the video
I have managed to (tentatively) reproduce this bug. Not every time, but it cannot be reproduced in an empty level, but a basic forest biome full of trees will sometimes do it.
As far as I can tell, it's not glitching out on the hurt animation, but flickering between an idle/senses state when the monster looses tracking on the player, and finds it again instantly, triggering the 'I see you' animation.
On my example, I engaged him, and he pursued and reacted to bullets normally, until after a short time, reverted to an idle state, even when shot a couple of times. Then I tried it from behind a tree and got the glitching result.
This also explains why walking up to him breaks the cycle, as he doesn't loose track of you when your looking up his nose.
I'll have to look further into this to try and determine exactly when the issue occurs.
Hmm maybe its a combination of things - check the view range and angle in the character settings and sense range in the behavior settings as well sometimes getting these right can make a big difference. I will have a play as well and see if there is somthing else. Im begining to think that using an ally in your examples maybe the problem. Try doing it without an ally and let me know. I have no code in there to allow for dealing with additional enemies (allies) in that behavior, its only focus was the player so it may be getting confused. I will look at addressing it when im able. Lol it was never originally really intended for extensive npc boss fights.
I had a different game I was making where it was just the player and the boss and it did the same thing. I changed the weapon the player used to a knife to kinda get around the glitching since the enemy would snap out of it if you got close. But just to check I took the ally out of this level and tried it again and the same thing is still happening. It takes a little longer since he's getting shot less but still happens. My other game didn't have trees but it had other obstacles that made the enemy character get stuck on animations and ignore the player
With all the trees in the way if you aren't constantly shooting at the enemy he does start to immediately ignore you if you aren't in a wide open area. I mess quite a bit with the view range and angle and even turn both of them up to maximum but it doesn't seem to make a difference. If there were a way to get the character to detect you no matter what obstacle was in the way that would help with that issue, possibly the other issue if he's glitching because it's switching between seeing the player and not. May be a tick box option letting the enemy see through obstacles.
In the init section of the behavior thers is a variable lostsight[e] = 30 which controls how long it loses sight of the player before changing to another state. Try changing that value to a higher or lower value and see if that helps, it maybe that a lot of obstcles (eg: trees etc) is obstructing its view. I will attempt to make it more critical of different scenarios when im able.
I messed around with the "lostsight[e] = 30" a bit, but still encountered the issue. Because it's quite difficult to reproduce, I can't be sure if the times when it didn't trigger were down to a specific setting, or I just didn't hit that "sweet spot"
At lostsight[e] = 300, I had him getting glitched between sense and attack. I had a video, but my recording software didn't capture the glitch part (typical!)
Also the Destination X and Z were flickering between two values, assumed to be his position and my position.
Does this give any further clues, @Necrym59?
Yeah, I tested a bunch of values between zero and 100 and couldn't find any difference. I didn't know how high you could go with the number though. Stepping behind a cluster of trees does make the glitch happen faster
In your video you are stepping in and out of the navmesh you will have to extend the navmesh to a bigger area with an object (trees dont extend the navmesh) an npc can only detect you when on the navmesh.
I have static objects surrounding the entire area including a rock wall border that circles the entire level. I did take a look in the debug settings around the level and I noticed at the beginning you can see the yellow navigation mesh but once you get about halfway down the trail it seems to end. Up where the boss fight happens there is no navigation mesh showing. Do I have to do something specific with the static objects surrounding the level to get the navigation mesh to show up? There's rocks, bushes, fences, buildings and other stuff surrounding the area so I would think that would be enough unless I'm missing some kind of setting. I looked in the forum's and found a couple posts about navigation meshes but from what I could tell all you need to place the static objects.
You extend the navmesh by putting a static object there for the Navmesh to extend its generated area. It could be a rock or somthing should do it.
hmm… I have plenty of static objects surrounding the area like I said, I wonder what could be the problem
Here's a demonstration video. I went ahead and placed a couple boxes around the boss fight area as well as the assets that were already there and turned on the monitor to watch the navigation mesh. You can see in the video it only covers part of the level even though static objects are all over. Maybe this is a combination of the script bug and the navigation mesh bugging out.
https://drive.google.com/file/d/1EuArGv73DSakcgpX8GCyyVIKgulDZC7P/view?usp=sharing
Playing around with this some more I put a character creator character out where the Bigfoot is at and gave him the melee script to see if he would have problems. The characters that use the standard scripts can find you through trees and anywhere else with no problems so the problem does seem isolated to the NPC control script
I'm using the NPC control script for a boss fight and when you shoot the character it gets locked into the hurt animation that repeats over and over again so the character won't move. It looks kind of cool and cinematic but it makes for a terrible boss fight. You don't notice this happening if the NPC's health is way down but when you turn it up for a character that has a lot of health it happens constantly. That would probably be because they die before this can happen. I made a video showing what happens here:
https://drive.google.com/file/d/1a2wPzQcYCQdoSpykBHR5tPwnLpG6qBAP/view?usp=sharing