Pathfinding with collider

Hey guys,

i’m quite new in game development and paradox 3d…
first of all, i realy like the game studio, but it’s quite hard to start without tutorials.
hope you will create more tutorial videos…

e.g. I struggled with creation of an entity with Animation in code. cause everything is described how to add it in the game studio… at least i understood the entities and how to add the components in code…

i started with a character wich walk to the point i click (Raycast).
btw. i have problems with the CharacterController… it seems my character jitter around if i put him to idle - character.Move(Vector3.Zero);

now i want to start with a path finding algorithm. but i realy don’t know where to start. i already read some articles, and had a look at some samples… is there a possiblity to get all colliders on my path? and how can i get the best path through the different collider shapes?

somebody have a sample for me?

best regards,
patrick

There is no easy way to implement pathfinding, but there are plenty of nice tutorials on the subject I suggest you start here:

http://theory.stanford.edu/~amitp/GameProgramming/AStarComparison.html

A lot of modern games these days use what are called navmeshes. It can get a little complex, but people have written libraries you can use:

And here is one I found in C# that is portable too!

I hope this helps! :smile:

-Toaster

2 Likes

hey toaster,

thanks a lot for the fast reply.
I’ll take a deeper look at sharpNav… Hope i get in :wink:

thx a lot and best regards,
Patrick

Hey Toaster,

due to my work i had no time to continue my project.
Yesterday i had a deeper look at SharpNav, and it’s really nice. Thanks again for the great links.

But currently i struggle a bit with the generation. I want to generate the NavMesh from my physic ColliderShapes. SharpNav uses triangles to generate this map. Is there a simple way to get triangles from the different ColliderShapes (Box, Cylinder etc…) or do i have to program them by myself for every single shape type with rotation etc…

btw. is there a possibility to render the ColliderShapes in debug mode?
found this in the documentation but didn’t find these settings. are there any changes in the api?

physicsSystem.PhysicsEngine.CreateDebugPrimitives = true;
physicsSystem.PhysicsEngine.RenderDebugPrimitives = true;
physicsSystem.PhysicsEngine.DebugEffect = new PhysicsDebugEffect(GraphicsDevice);

best regards,
Patrick

1 Like