-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange line of sight behaviour #157
Comments
Hey @JaredP94! Sorry for the late reply. I assume that your actors don't have "Ignores Height Levels" checked on their RTSVisionComponent. Assuming that's not the case, the plugin will compare the height level of the tile being looked at to the height level of the moving actor. These tile heights in turn are cached when the game starts (ARTSVisionVolume::Initialize) for performance reasons, so my next question would be whether your level geometry (vision obstacles) are in place from the very beginning, or not. If so, the tile height is determined by casting a ray from "infinity" (Z = 10000.0f) downwards (to Z = -10000.0f) against the HeightLevelTraceChannel of your vision volume, so you'd want to check whether these traces are actually able to hit your vision obstacle. If so, the resulting Z value is divided by the Level Height of your vision volume (and floored) to get discrete height levels. If that resulting height level of the tile is above the one of the actor, the actor is considered to have no vision on that tile. If the actor has vision on a nearby tile, the algorithm continues to check the next tile along line of sight using a simple Bresenham algorithm, until it hits a tile the actor doesn't have vision on. Does that make any sense to you? |
Hi @npruehs, Appreciate the detailed feedback! > I assume that your actors don't have "Ignores Height Levels" checked on their RTSVisionComponent. >so my next question would be whether your level geometry (vision obstacles) are in place from the very beginning, or not. > so you'd want to check whether these traces are actually able to hit your vision obstacle. What's interesting is how some objects seem to block vision from one direction, but not from the other, or that objects of equal height seem to exhibit completely different vision blocking. I thought the rugged terrain might have an impact since the demo level is flat, and the shift in terrain is causing some interesting behaviour, but I would expect a bigger tile height to resolve that (and it doesn't really affect the main point of reliable vision blocking from tall objects). |
"objects of equal height seem to exhibit completely different vision blocking" Technically, this could happen if you're you're not using enough tiles, i.e. we use too few rays to properly sample the heights everywhere. "some objects seem to block vision from one direction, but not from the other" This however is hard to explain and sounds more like a bug to me... Hard to tell without having a closer look on your setup. Any chance you might be able to share your project, or a minimal repro if you're more comfortable with that? |
> Technically, this could happen if you're you're not using enough tiles, i.e. we use too few rays to properly sample the heights everywhere. > Any chance you might be able to share your project, or a minimal repro if you're more comfortable with that? Thanks again for digging into this! |
Sure, whatever works for you. I've got UE5 installed as well :) |
Nice, that should work out the box then! Don't mind the current state of things, seems upgrading to UE5 has broken quite a few things in our project, most notably around animation. Guess it's time to hop over to control rig once and for all :) I have added you as a collaborator, please shout if you have any issues getting everything to build and run :) |
Which repo is that? I don't think I got a notification - I might have just missed it, though. Filters show nothing. |
Sorry for the delayed response! I see the invitation is still pending - you should be able to access it here: https://github.com/JaredP94/Unreal-CoH |
It says "This invitation has expired." |
Hi @npruehs, sorry for the delay - life has been a bit busy :) I've just sent a new invite! |
Hi @npruehs!
Been a little while, hope you're well :)
I've been attempting to implement the complete fog of war functionality, with the last step being the line of sight feature. On the demo project, it works as expected, but I'm seeing fairly unreliable line of sight behaviour within my project (video attached below).
I've played around with the Level Height setting of the vision volume but either yielded the same behaviour, or reduced to a value where line of sight was never blocked by objects.
Any advice on where to dig further into this?
Thanks!
UnrealCoH.-.Unreal.Editor.2021-05-18.21-21-01.mp4
The text was updated successfully, but these errors were encountered: