I would like to create a simple stealth game, in which the player must hide in the shadows in order to evade guards. Thus, I wanted to create some kind of light meter, just like in the old Thief or Splinter Cell games.
It seems that doing it was pretty easy in UE3, but I can’t seem to find a tutorial for this on UE4.
I was told that trying to actually detect light exposure was kind of resource-consuming, so I gave up the idea. (Unless there is a good way to do it?)
In order to fake it, some people told me to create some trigger zones attached to the lights. The problem is that if there is a prop or a wall between the light and the player, then the system doesn’t work.
Therefore, I thought that maybe I had to use some kind of raycast system. For instance, if the player is near a light source, the light casts a ray to the player. If something interrupts the ray, then the player is hidden. If not, then his “visibility level” increases depending on the distance.
My main problem is that it works with spot lights, but I’m not sure how to deal with the light from the sky. Also, I worry about the refracted light, meaning that even when the player isn’t in direct contact with a light, he may still be in a very lit zone.
Do you have an advice on the matter? I’m not really a programmer to begin with, so I thought that the Blueprint thing could help…
Thanks in advance!