-
-
Notifications
You must be signed in to change notification settings - Fork 18
Motion Planning
This chapter covers pathfinding and motion planning functions. It is a common scenario to have an object navigate trough a "maze" from point A to point B. Whenever you encounter this need, mp_
prefixed functions come in handy. There are several algorithms included and it is very important to choose the one which suits the problem the best. Linear functions are the simplest ones - object will try to navigate in a straight line to a target specified and in case an obstacle is encountered it stops. Grid is an A* algorithm implementation, space is divided into cells of desired size and marked as empty or filled. An algorithm then computes a shortest path to the target location (in case a path exists) and then returns this path. Grid has been optimized using a fast heap implementation, therefore the performance scales well with the grid size. When about to use the function - always think whether it is more efficient to create one large grid that will be shared among your objects or create a grid for each instance. A large number of grids takes a lot of RAM.