Post feature RSS Detecting the player

Let's talk about NPCs visual and auditive detection.

Posted by on

NPCs can see and hear the player.

Visual detection

Visual detection is obviously done by raycasting from the eyes of the NPC and checking if the player is hit. If this is the case, another verification process is launched to check the player "brightness". This is done by calculating the intensity and distance of all lights reaching the player. In addition, Aluma clothes have a brightness score that is added to the calculation. NPC attention is triggered if the result number is higher than its visual perception threshold.

alert


busted


Player "brightness" calculation allows the player to use shadows and dark places to avoid being detected and not only hiding places. Detection will be triggered though if the NPC is too close to the player even if Aluma is standing in complete darkness. This is done to reproduce real life where you can "feel" people when they are close to you even if you can't see them.

Auditive detection

Sound detection on the other hand is done by assigning a volume score to each sound produced in the game, excluding ambient musics, and calculating the output sound volume score depending of surrounding elements. Particularly floor type for footsteps and walls, doors or windows to calculate the occlusion. NPC attention again, is triggered if the result number is higher than its auditive perception threshold.

playing


sound alert


Consequently, the player can switch between 3 different motions each one having its own sound score, in addition to what type of shoes Aluma is wearing.

I currently uploading the demo of the game too, so anyone interested in trying it out will be able to do so soon. Feedbacks obviously are welcomed. Thanks.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.