AI and Pathfinding

I've managed to get quite a lot done of the past couple of weeks and there is now a very basic form of AI which can mine, chop and weed based on commands I give. At the moment these are tied to key presses but eventually they will form part of the character's routines. For example, their daily schedule may involve tending their shop in the morning and doing one of these tasks in the afternoon.

xDaXmHnaCAR_O4Ww.jpg

The plan is for you to be able to request they do certain activities (which they may or may not do depending on how much they like you) which will help the community grow. If you need more wood to build a new house for example you can get members of the village to help you. Building relationships with the other villagers in order to get their assistance will be a core component of the game. I have only created one character so far, Marie, who will most likely be the first person to come to the island after you arrive.

EBa3jE_D7mo2Ug1N.jpg

In order to get the AI working correctly I had to write my own pathfinding methods, which was a lot of fun. I've implemented the A* pathfinding algorithm which uses heuristics to initially estimate the fastest route and means the whole process is quite quick. It's also running on a separate thread so any long-running pathfinding calculations shouldn't significantly affect framerates. I'm not sure how well it's going to scale to a large map so I'll probably have to revisit it at some point, but for now it works well. If you're interested in the basics of how A* pathfinding works then I'd recommend giving this site a vist: https://www.raywenderlich.com/4946/introduction-to-a-pathfinding