Skip to content
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

Detection of shadows & silhouetting #173

Open
Mooses2k opened this issue Jul 26, 2022 · 0 comments
Open

Detection of shadows & silhouetting #173

Mooses2k opened this issue Jul 26, 2022 · 0 comments
Labels
major effort This will take a lot of work

Comments

@Mooses2k
Copy link
Owner

Mooses2k commented Jul 26, 2022

SHADOWS

I was thinking when player in an area of a light, and that light area is in the enemy view cone, send a ray through player randomly each frame, then a ray from impact to enemy to see if there's no obstruction.

some related thoughts from Stewie:
we could compute the light on the cpu, As an approximation of the actual shader
but still, with no shadow data, it's not that good of a deal

And also, we are kind of running on one of the limits of godot here
which is the lack of query APIs on the internal servers

for example, here's all the instance related functions under RenderingServer on godot 4
An instance is basically anything that gets drawn
if you create one yourself, you get an RID, which gives you full control over it, and that's how the node system interacts with the rendering server internally
but there's no way to simply go to the rendering server and get a list of all instances RIDs
and here are the lightmap functions, again no way to get all lightmaps, or to even get a texture out of a lightmap, only set
I doubt it, most people don't want to go into the guts of the internal servers
It might not be that hard of an issue tho, just exposing stuff, so maybe they would do it with some interest
or maybe it's way too hard to do, can't be sure

SILHOUETTEING

a few rays from viewer to player's extremities and behind to bright light should lead to detection.

this could be done on the same raycast check to the player in direct_player_sight. If connects with player but player's light_level is too low for detection, cast a few more points through player, maybe one a frame, cycling between 4 to 8 points at edges of player's collision to see if hit, if hit, send another through player at same angle and see if surface behind is lit, then player silhouette detected.

@Mooses2k Mooses2k added this to the 0.5a Stealth Prototype milestone Jul 26, 2022
@Mooses2k Mooses2k added the major effort This will take a lot of work label Aug 1, 2022
@Mooses2k Mooses2k changed the title detection of silouhetting Detection of silhouetting Jun 27, 2023
@Mooses2k Mooses2k changed the title Detection of silhouetting Detection of shadows & silhouetting Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major effort This will take a lot of work
Projects
None yet
Development

No branches or pull requests

1 participant