Skip to content

Nav-mesh implementation in C# for FlatRedBall game framework.

License

Notifications You must be signed in to change notification settings

Riva3000/FRBNavMesh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlatRedBall NavMesh

C# implementation of 2D Nav-mesh, that uses axis-aligned rectangles, for FlatRedBall game framework.

Usage

  1. Use your favorite way to include FRBNavMesh (project or dll) into your FlatRedBall game project.
  2. Create main nav-mesh object using
    new FRBNavMesh.NavMesh<FRBNavMesh.PortalNode,FRBNavMesh.Link>(..)
    and giving it List of FlatRedBall AxisAlignedRectangles that idealy share some edges. They will be used to define "wakable areas" for path-finding agents.
  3. Use YourFRBNavMeshInstance.FindPath(..) to get shortest path from start to end Point, as both List of Points and List of FRBNavMesh.PortalNodes

More

  • You can use FRBNavMesh.TiledExtensions.BuildNavMeshFromTiled<TLink,TNode>(..) to build NavMesh from Tiled editor .tmx file, loaded by FlatRedBall Tiled plugin.

    • You need to have a separate Object layer in your tmx map, with rectangle shapes in it.
  • You can derive your own PortalNode and/or Link classes from FRBNavMesh.PortalNodeBase<TLink,TNode> and FRBNavMesh.LinkBase<TLink,TNode>. Your classes can than contain additional data used by your project.

    • Your derived Node and Link class(es) must be concrete (not generic) for you to be able to use them with NavMesh<TNode,TLink>. NavMesh class itself can be used as generic, supplying it your classes.

Project doesn't (yet) implement any dynamic obstacle avoidance or flocking functionality.

Will support "floors" later.


This project uses modified version of A* implementation from FlatRedBall.

This project is inspired by Phaser-Navmesh javascript rects-based nav-mesh project for Phaser engine.

About

Nav-mesh implementation in C# for FlatRedBall game framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages