I'm proud to announce the first public release of jKılavuz
: the first and only available path engine for Java.
jKılavuz consists of an extensible set of tools for collecting pathfind data and finding and executing paths. Despite the complexness of subject it is designed for ease of use.
jKılavuz is written in Java 5 and is pure Java.
jKılavuz can work on almost arbitrary geometry. To collect pathfind data, it flood fills over surface starting from a set of points on ground. This way a kind of 2d grid in 3d space is created which can take us up or down slopes, across bridges and over and under overpasses. The process also takes care of jumping over obstacles and gaps. The default implementation uses jPCT
's collision detection system but a custom implementation may be plugged. Later this massive information is collapsed into sectors and portals which are then converted into a very compact form to use in runtime. All the process is automized although users can intervene. Custom portals can be defined for elevators, teleporters etc.
Pathfinding is performed among sectors and hence can be considered as a hierarchical approach. This makes it quite fast and efficient even for very large maps.
jKılavuz provides the necessary methods to actually execute the found path. It provides a clean and uniform interface to iterate over paths over time. The iterator is suitable for both fixed and delta time approach. Paths can be merged and customized in certain ways. Users can still create their own executable paths by using Lego like path segments.
More can be found on http://www.jkilavuz.com
Here is a web start demo
where jKilavuz is applied to a Quake level.
Move the camera around and click anywhere on the map. If the clicked point is reachable, markers will be placed on the corners of the path and the avatar will follow them. Press F
to follow avatar and return back to free camera mode again. Although very unlikely if avatar stucks press R
to reset to starting position. Use arrow keys, A, Z, S, X
to move the camera around, Control
to strafe, V
to visualize path finding sectors.
Here is a shot from demo. Top view with sectors visualized
And this is how our grid looks like. Notice how the found path goes upstairs passing over itself. You can see the cells (the small circles), transitions between cells and sectors and portals herer a f t