Missed a day, heres some progress!


Yesterday I managed to build out the AStar Pathfinding handler and managed to get it working for spawned units, but felt it wasn't enough to justify an update solely in itself (nothing really visual was happening)...


So, when I jumped into working on this today, my first task was to sort out the Unit's state machines to utilize the pathing, and also flesh out the Excavation mechanic for the Grid tiles. This is what you can see in the video attached.

Workers (Helper-chan) are spawned each time the "Core" (purple thing) is clicked, this is currently bypassing my need for a UI and instantly firing the "Purchase and Spawn Unit" logic for the building -> spawning a Worker. These Workers then register themselves to the System Tick Manager (firing a tick every second). On tick: the Worker calls the Task Manager requesting "Tasks near me, that I can do". The Task Manager then generates a list (based on proximity) of tasks and returns it to the Worker. Based on a configurable number, the Worker will choose one of the first few items in the list (may not always be the closest that is selected, giving them a modicum of autonomy). The Worker then requests a Path from the Pathfinder Manager, and when that is generated (through AStar), begins following the steps in the path towards it's goal. While the Worker is pathing, each tick: the Worker is checking to confirm that the task still exists, if it doesn't -> return to Idle, and start the process all over again! However, if the task exists still, then when it reaches the goal, it will perform the task (Excavate) until the task is complete/removed.

All of the above is visible in the example video, this has been a tonne of fun giving life to Helper-chan, she deserves headpats for being such a patient automaton :P.

Get Crypt Underlord

Leave a comment

Log in with itch.io to leave a comment.