Now that we can spawn a citizen on the map (a white rectangle sprite ๐Ÿ˜…), let's make it move! The first thing a citizen needs to do is to find accommodation. That's the settler behavior. I used the LimboAI library, and built a first working draft for this:

20240321.btree_editor.settler.png

Both nodes with a yellow question mark icon are custom:

  • LocateBuilding is an action that finds the closest building of the given type and with some capacity left.
  • Navigate is an action that leverages the node's navigation agent (an entity hooked to the map's navigation system) and navigates it towards the given cell ID at a given speed.

Once the citizen reaches a home, it settles in it and gets ready to live it daily life. Here's what it looks like in action:

Now this is a satisfying proof of concept, and opens the door to multiple areas for development!


Published

Category

blog

Tags