Screenshots:
http://code.google.com/p/irrcodes/downl ... shot_1.png
http://code.google.com/p/irrcodes/downl ... shot_2.png
Download:
http://code.google.com/p/irrcodes/downl ... inding.zip
Regards,
smso
Waypoint editing and path finding by astar
Re: Waypoint editing and path finding by astar
Info
====
Features
--------
1. Simple editor for placing nodes/waypoints in the world and connection between nodes are done automatically by
- adjustable distance (MaxDistSQ)
- line-of-sight test
2. By marking nodes as reserved, player avoidance, co-ordinated movement of NPC (non-player character)'s, etc. can be stimulated.
3. Node path is smoothed by spline and movement of NPC can be paused, resumed and stopped.
About the classes
-----------------
Use of Model–View–Controller (MVC) pattern in c++ classes:
NaviNode => model
NaviNodeView => view
NaviNodeControl => controller
NaviNode is the data structure and it also interfaces with the astar algorithm.
NaviNodeView is responsible for drawing and uses Segment which represents the connection between nodes.
NpcPathControl makes use of results from astar search to move the NPC.
Gotchas when adding nodes
=========================
Occasionally, when you press 'A' to add a new node, it is not connected to other nodes inside the large pale blue circle.
Reason:
This is due to the slightly uneven ground which in turn causes the line-of-sight test to fail.
Remedy:
Deleted the node by pressing 'X'.
Then press 'Z' to add a new node with no line-of-sight test.
Sometimes connections which are blocked by the world mesh object are still formed on adding a new node.
Reason:
Due to the finite precision of float values (f32), line-of-sight test may yield UNEXPECTED positive result.
link:
http://irrlicht.sourceforge.net/forum/v ... 2&p=263477
Remedy:
Deleted the node by pressing 'X'.
Decrease MaxDistSQ by making the pale blue circle smaller and add the node again.
Acknowledgement
===============
Some codes are based on PathCreator by kazymjir:
http://irrlicht.sourceforge.net/forum/v ... hp?t=38645
CityDriving.irr scene file is ripped from CityDriving.zip of sio2:
http://irrlicht.sourceforge.net/forum/v ... hp?t=45781
Astar algoithm is written by Justin Heyes-Jones:
http://code.google.com/p/a-star-algorit ... mentation/
Most updated version of stlastar.h and fsa.h can be obtained from the above.
Thanks.
smso
====
Features
--------
1. Simple editor for placing nodes/waypoints in the world and connection between nodes are done automatically by
- adjustable distance (MaxDistSQ)
- line-of-sight test
2. By marking nodes as reserved, player avoidance, co-ordinated movement of NPC (non-player character)'s, etc. can be stimulated.
3. Node path is smoothed by spline and movement of NPC can be paused, resumed and stopped.
About the classes
-----------------
Use of Model–View–Controller (MVC) pattern in c++ classes:
NaviNode => model
NaviNodeView => view
NaviNodeControl => controller
NaviNode is the data structure and it also interfaces with the astar algorithm.
NaviNodeView is responsible for drawing and uses Segment which represents the connection between nodes.
NpcPathControl makes use of results from astar search to move the NPC.
Gotchas when adding nodes
=========================
Occasionally, when you press 'A' to add a new node, it is not connected to other nodes inside the large pale blue circle.
Reason:
This is due to the slightly uneven ground which in turn causes the line-of-sight test to fail.
Remedy:
Deleted the node by pressing 'X'.
Then press 'Z' to add a new node with no line-of-sight test.
Sometimes connections which are blocked by the world mesh object are still formed on adding a new node.
Reason:
Due to the finite precision of float values (f32), line-of-sight test may yield UNEXPECTED positive result.
link:
http://irrlicht.sourceforge.net/forum/v ... 2&p=263477
Remedy:
Deleted the node by pressing 'X'.
Decrease MaxDistSQ by making the pale blue circle smaller and add the node again.
Acknowledgement
===============
Some codes are based on PathCreator by kazymjir:
http://irrlicht.sourceforge.net/forum/v ... hp?t=38645
CityDriving.irr scene file is ripped from CityDriving.zip of sio2:
http://irrlicht.sourceforge.net/forum/v ... hp?t=45781
Astar algoithm is written by Justin Heyes-Jones:
http://code.google.com/p/a-star-algorit ... mentation/
Most updated version of stlastar.h and fsa.h can be obtained from the above.
Thanks.
smso