The Way Forward ... Making Blitzmax Trax ...
Following on from "On The Right Path, A* Pathfinding In Leadwerks" I thought before I archive the code, I'd have a little "dabble" with a basic function to get an NPC reading the path data and then following it to the "target" I had a couple of ideas on how to do this but as time for playing in leadwerks was running out I opted for a basic idea.
1. Target Position Selected
2. Path from NPC to selection calculated.
3. Path transfered to a temp storage array for that particular NPC
4. An NPC Pilot reads that data.
5. NPC follows the pilot.
Think of the "pilot" as the plastic stick thing on the underside of a scaletrix car .. it follows the groove in the track and the car follows right along. This was the quickest and dirtiest method but solved a variety of issues in one. Plus I just wanted to get the NPC moving and the sands of time were running out.
So an hour later and I have not only the NPC following the generated path but the path is updated with a repositioning of the target and the pilot takes the NPC off onto the new track.
This is all still quick and dirty, when I can remember what the code does and does not need, I will up a small demo.exe to the thread Pathfinding With A*
EDIT: I have uploaded a demo.exe here : Hide And Seek Demo
1 Comment
Recommended Comments