Skip to content

Path Manager (Team 1)

TazmanSchmidt edited this page Oct 22, 2017 · 8 revisions

Path Manager

!!WORK IN PROGRESS: The following is outdated

Description

The path manager handles the creation and allocation of paths for enemies to follow. The path is given in the form of a Path object, which is a queue of nodes. The nodes are points, represented by Box3D's with z=0, and a height, width & length of 0.

Example graph

The above graph shows the nodes and vertices of a basic 25 by 25 map with 2 static-collideable items in the middle. Nodes have been placed just inside each corner of the map & adjacent to the corners of the objects.

The squirrel shows an implementation of using the PathManager to path find to the player. The Squirrel:

  • Follows it's path.
  • Requests a new path whenever it collides with a staticCollideable entity
  • Moves directly towards the player once it reaches the end of it's path

Entities can call setStaticCollideable(true) when they are created, to indicate that they are solid objects that need to be pathed around.

At the moment there is no way to update the graph once it has been initialized. In the future, calls to AbstractEntity.setStaticCollideable() will trigger an update to the PathManager.

Public Methods

initialiseGraph()

Populates the internal graph representation of the PathManager with nodes and edges based on the current world state.

onTick(Box3D player)

Runs on every game tick, helps process getting to the player.

optimiseGraph(Box3D start, Set vertices, Map<DoubleBox3D,float> edges)

generatePath(Box3D start, Box3D goal)

returns an array of connecting nodes, from current position (enemy) to a node with a direct line of sight to the goal (player)


Gameplay

Design

Asset Creation

User Testing

Code Guidelines


http://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gif

Clone this wiki locally