Biomechanically Constrained Gaze Control for NPCs in Unity: A VHP-Based Approach with Context-Aware Target Prioritization

  • Guadalupe Prado Saldanha Ribeiro UNIFOR
  • Maria Andréia Formico Rodrigues UNIFOR

Resumo


Introduction: Gaze is a central non-verbal cue for communicating attention, intention, and social presence in virtual characters. In games, however, Non-Playable Characters gaze and aiming behavior often remain mechanically rigid, visually inconsistent, or weakly connected to scene context. Objective: This paper presents a Unity-based gaze-control extension for the Virtual Human Project (VHP), designed to improve the plausibility of NPC gaze through biomechanical constraints, binocular coherence, and context-aware target prioritization. Methodology: The proposed approach modifies the VHP gaze pipeline with three mechanisms: angular eye clamping based on human ocular ranges, a unified focal-center strategy that prevents asymmetric eye convergence, and a target-weighting layer that increases gaze priority for semantically relevant objects. The system was implemented in Unity and analyzed through controlled runtime cases involving extreme gaze targets and multiple competing points of interest. Results: Runtime traces and visual inspections show that the extension limits excessive yaw and pitch, avoids cross-eye artifacts from independent per-eye constraints, supports head-eye coordination, and biases target selection toward user-defined contextual-priority objects without replacing the VHP gaze pipeline.

Palavras-chave: NPC Gaze, Procedural Animation, Virtual Humans, Unity, Eye-Head Coordination, Context-Aware Target Selection, Game AI

Referências

Canales, R., Jain, E., and Jörg, S. (2023). Real-time conversational gaze synthesis for avatars. In Proceedings of the 16th ACM SIGGRAPH Conference on MIG, pages 1–7.

Garau, M., Slater, M., Vinayagamoorthy, V., Brogni, A., Steed, A., and Sasse, M. A. (2003). The impact of avatar realism and eye gaze control on perceived quality of communication in a shared immersive virtual environment. In Proc. of the SIGCHI Conf. on Human Factors in Computing Systems, pages 529–536.

Gorisse, G. (2020). Virtual Human Project (VHP). [link].

Han, S. H. and Lee, Y.-H. (2022). Implementation of Target Object Tracking Method using Unity ML-Agent Toolkit. KSDET, 21(3):110–113.

Hu, Z., Haeufle, D., Schmitt, S., and Bulling, A. (2025). HOIGaze: Gaze Estimation During Hand-Object Interactions in Extended Reality Exploiting Eye-Hand-Head Coordination. In Proc. of the Special Interest Group on Computer Graphics and Interactive Techniques, SIGGRAPH Conf. Papers’25, New York, NY, USA. ACM.

Hwang, J., Hong, S., Seon, J., and Kang, H. (2025). How Does a Virtual Agent Decide Where to Look? Symbolic Cognitive Reasoning for Embodied Head Rotation. In Proc. of the SIGGRAPH Asia 2025 Conference Papers, pages 1–12.

Itti, L., Dhavale, N., and Pighin, F. (2006). Photorealistic attention-based gaze animation. In Proc. of the 2006 IEEE Intern. Conf. on Multimedia and Expo, pages 521–524.

Kim, D. and Jung, H. (2021). Performance analysis of target tracking AI based on unity ML-Agents. The Journal of Korean Inst. of Information Tech., 19(12):19–26.

Knabe, T. (2024). Unity Asset: Realistic Eye Movements. Last visited: 7 April 2026.

Lee, S. P., Badler, J. B., and Badler, N. I. (2002). Eyes Alive. In Proc. of the 29th Annual Conference on Computer Graphics and Interactive Techniques, pages 637–644.

Lee, W. J., Kim, J. H., Shin, Y. U., Hwang, S., and Lim, H. W. (2019). Differences in eye movement range based on age and gaze direction. Eye, 33(7):1145–1151.

Lee, Y.-H. (2024). Implementation of Intelligent Agent Based on Reinforcement Learning using Unity ML-Agents. IJIBC, 24(2):205–211.

Luz Junior, J. A., Ribeiro, G. P. S., Pessoa, R. F., Magalhães, A. H. T., and Rodrigues, M. A. F. (2025). Generative AI for facial expressions in 3D game characters: A retrieval-augmented approach. In Proc. of the 9th ICSE GAS, pages 9–16. IEEE/ACM.

Luz Junior, J. A., Rodrigues, M. A. F., and Hammer, J. (2021). A storytelling game to foster empathy and connect emotionally with breast cancer journeys. In Proc. of the 9th Intern. Conf. on Serious Games and Applic. for Health (SeGAH), pages 1–8. IEEE.

Ruhland, K., Andrist, S., Badler, J., Peters, C., Badler, N., Gleicher, M., Mutlu, B., and Mcdonnell, R. (2014). Look me in the eyes: A survey of eye and gaze animation for virtual agents and artificial systems. In Proc. of Eurographics, pages 69–91, Strasbourg, France.

Slater, M., Spanlang, B., Sanchez-Vives, M. V., and Blanke, O. (2010). First person experience of body transfer in virtual reality. PloS one, 5(5):e10564.
Publicado
29/09/2026
RIBEIRO, Guadalupe Prado Saldanha; RODRIGUES, Maria Andréia Formico. Biomechanically Constrained Gaze Control for NPCs in Unity: A VHP-Based Approach with Context-Aware Target Prioritization. In: SIMPÓSIO BRASILEIRO DE JOGOS E ENTRETENIMENTO DIGITAL (SBGAMES), 25. , 2026, Goiânia/GO. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2026 . p. 1060-1069. DOI: https://doi.org/10.5753/sbgames.2026.26406.