Abstract:
This article presents a newly developed visual perception algorithm for game agents, implemented in the Unity game engine. The proposed method is based on comparing images from two cameras, taking into account complex visual effects (lighting, shadows, occlusion), and is supplemented by line-of-sight checks, consideration of object velocity, and gradual detection mechanics. The algorithm was optimized using asynchronous computations, dynamic camera activation, and accelerated algorithms. The system was tested under various load levels, and conclusions were drawn regarding the optimal conditions for the algorithm’s operation. The paper also analyzes the scientific literature on similar solutions, identifying their strengths and weaknesses. The results can be applied in video game development to create realistic behavior for non-player characters, especially in games with stealth elements.