+1 vote


I'm creating a 3D space game with ships, where I control then using Yaw and Pitch to maneuver. And I'm creating a context-based steering behaviour that chooses a direction to follow as enemy AI. I'm using C# because I'm more used to it in terms of OOP that GDScript.

Basically, I watched a devlog from Game Endeavor: https://www.youtube.com/watch?v=6BrZryMz-ac (The Trick I Used to Make Combat Fun! | Devlog), where he explains that he used a context-based steering bevahiour in the enemies AI to follow the player in a more complex pattern, trying to avoid obstacles, getting away from the player or circle around the player when is close enough.

So I made a AI to my game that follows the player when is a bit far, and circles around the player when is close enough. All of this only changing the yaw and pitch of the ship.

The problem is that I need to convert somehow the direction into Yaw and Pitch commands, ranging from -1 to 1, that latter is remapped to -[yaw/pitch]speed to [yaw/pitch]speed.

What I already have is a AI that follows a target, but is a bit unstable. There is some situations where the ships goes up or down too much, while the yaw remains stable.

I can't explain very well what is happened and what is the expected bevahiour, maybe testing my project is better: https://github.com/ghsoares/Space-Game/tree/master

Godot version v3.2.3.stable.mono.official
in Engine by (25 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.