1
\$\begingroup\$

I'm making a spaceship game where the enemies and the player have the full 6 degrees of freedom, so can move forward/backwards, left/right, up/down and can also rotate in all three axes. I'm wanting to add some simple pathfinding so the enemies can move towards the player.

I tried to use the guide in 3D Navigation Overview in the docs but the "3D" navigation really seems to be 2D to me since the agents always only have two translational movement options (forward/backward and left/right) but in 3D there should be three translational movement options (forward/backward, left/right, and up/down).

Most of the "3D" navigation tutorials for Godot also seem to be 2D or 2.5D where the agents can up ramps and onto higher platforms, but they can't fly around or anything.

I tried fiddling around with the settings for NavigationRegion3D and its child MeshInstance3D but I can't figure out how to get the baked NavMesh to actually be 3D. Right now I've made the MeshInstance3D a cuboid, but when I bake the NavMesh only the upper face is displayed as navigable:

large cuboid mesh in godot game engine, with a light blue NavMesh on the upper face

How can I allow my agents to pathfind anywhere within a rectangular region? Ideally they'd be able to use all 3 dimensions at all times.


Edit: Godot does not support volumetric pathfinding (I ended up implementing it myself). If you'd like to see built in support, please leave a comment on the issue I opened for it here

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

These are 3D in the sense they works with 3D nodes. 2.5D is not a well defined term anyway.

If the environment is fully enclosed, it might still be useful for a 3D flying agent, given you use some form of obstacle avoidance. Otherwise, it does not really work for 3D flying agents.

In general, I would expect that going directly to the target with obstacle avoidance would work for open spaces. Then if the agent is inside a given area, it might also use navigation... Or to AStar3D. This, of course, requires you to specify the areas where it uses what strategy.

\$\endgroup\$
3
  • \$\begingroup\$ So there is no solution? (I did also define 2.5D for the purposes of my question: "... or 2.5D where the agents can up ramps and onto higher platforms, but they can't fly around or anything") \$\endgroup\$
    – beyarkay
    Aug 15, 2023 at 6:38
  • \$\begingroup\$ @beyarkay There isn't a solution out of the box. And I mean, you can't expect Godot to call their class NavigationServer2dot5D or something like that, that would only raise more questions. Yet, even if it is not what you expect, NavigationServer3D remains useful, in 3D, for other use cases. \$\endgroup\$
    – Theraot
    Aug 15, 2023 at 12:00
  • \$\begingroup\$ I wasn't suggesting a funky name, just kinda surprised is all. I've opened a GIP to see if the core devs would accept a PR to implement this. github.com/godotengine/godot-proposals/issues/7504 \$\endgroup\$
    – beyarkay
    Aug 15, 2023 at 15:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .