Archive 17/01/2023.

Flying AI in urho3d

GodMan

Any one approach anything on flying AI? I’m thinking of maybe taken the approach were flying AI can move to designated points in the air using predefined points in the environment.

Modanung

Don’t overcomplicate things and vector math is your friend.

Dot Product Cross Product
Image Image

Maybe also splines?
Are there any obstacles in this airspace, btw?

GodMan

No their are no obstacles. It’s just an open map, the same one in my screenshots in the Random Project Shots thread. Unless you count cliff walls, but mostly an open area.

GodMan

I’m just looking for something, for my sentinels from halo.

Modanung

Would that be more of a (strafe-)hovering with target tracking instead of the airplane I had in mind?

ab4daa

I used to add sphere obstacle in RVO2-3D (test proj).

(But it is not actually “piloting” the vehicle, I never played halo so don’t know how realistic piloting you want.)

GodMan

@Modanung Yes they hover while targeting an enemy. Yes lol no airplane like movement. .

Modanung

In that case I imagine something like:
A custom LogicComponent (with probably an abstract AI class in between) that knows at least two states: Patrol and alert. In the patrol state the AI would find the nearest point on a predefined spline path and accelerate towards a point further down the same path. When it sees a target it should probably stop patrolling and instead orbit and attack its target from a preferred distance.

dertom

Not sure if that would be overkill, but you could have a look at opensteer:

code(seems to be a newer fork): https://github.com/meshula/OpenSteer
docs: http://opensteer.sourceforge.net/doc.html

There were a very good website, that showed all types of steering behaviour, but those were java-applets which are not supported anymore. :expressionless:

GodMan

Thanks everyone. I might look into @Modanung approach first.