I've been developing an open world game in Unreal Engine 5 for about a year and a half, featuring interplanetary travel. To make the experience more immersive, I've decided to model the planets as spheres. This has worked well for player movement, but I'm facing challenges with the AI. The AI's tracking and perception systems seem to malfunction when dealing with spherical surfaces. Currently, my AI characters are properly oriented with gravity and move toward their destinations, but they lose track of moving targets because their tracking system doesn't activate until they reach the target's last known location. I'm working with the Blueprint system due to storage limitations, so I'm not looking for code snippets specifically, just general advice on how I might approach this problem. I'd love any insights or suggestions you have!
1 Answer
It sounds like you might need to create custom AI logic since the standard systems could struggle with the curvature of the planet. One approach is to implement a spherical coordinate system for NPCs to better track targets. You could also consider creating a system that continuously updates the AI’s target visibility rather than just at waypoints. It's true that building the AI from scratch can be daunting, but it gives you the flexibility to adapt it to your unique gameplay.

That makes a lot of sense. I've found similar challenges when working with different terrains. You might also want to consider setting up an event trigger that checks for line of sight periodically rather than only at destination points. It could help your AIs react quicker to dynamic targets!