Hi!

Before starting with this week’s update, as always, if you want to learn more about the game, have a quick chat or discuss anything with me, join my discord channel, I’m always around!

This third week I hoped to work more on the super market dynamics, getting the player to actually be able to perform a job to make money but… it was not how it ended up being. I started to get into a point where adding new types of NPCs was getting excessively copypastaish, and I decided to refactor the whole NPC logic to be entirely modular, and in the process make it so citizens actually have needs and wants that they need to live by. I made it so they now have energy, and hunger, and will decide to eat if they need to, looking for the closest shop that is open AND has food in it… and well, lets just say the immediatelly caused a food shortage with their desperate buying habits…

As you can imagine, not unlike real life at the moment, that could make buying stuff a bit… well… challenging…

But, if you managed, you could finally help feed your family…

Regardless, here is a full list of updates from this week!

– All NPCs are now the same base type of NPC, which has needs they need to carry out. At the moment, feeding, working and sleeping;
– Citizens will have generic jobs by default, however they can be recruited by specialist jobs (such as the fruit stand), leaving their previous job and assuming the new behaviour, sharing almost all of the code with other regular citizens;
– Citizens go to sleep when their energy is low, and that includes the addition of extreme poverty NPCs that live on the streets, which instead of going to their homes, will go towards their beds and sleep on the streets;
– Citizens now eat, and they search for food sources such as fruit stands that are nearby, open and have stock;
– Citizens now have money, receiving wages while working and spending them to pay for rent (if they have a house) and eating. In the future if they go negative they might decide to sell their house and downgrade to a worse house (or go to the streets), or if they are doing well, purchase better houses;
– Citizens evaluate their choices on a score based system, so its not always going to be the same decisions since they will evaluate based on their current situations;
– Drastically reducing physics load by handling the stocks of the fruit stands manually (rather than relying on triggers to know if the store has food or not);
– Started getting the game into the expected scale (over a thousand citizens, hundreds of food shops, size of the map), and started dealing with the performance shortcomings;
– Multiple optimization and architectural changes to adapt to new requirements/make moving forward faster.

And thats it for this week’s update! I had different hopes to what the update would look like haha, but thought it would be best to take a step back and work on core elements of the architecture rather than implementing more and more features that might hit some though bottlenecks down the line. Next week will probably look similar, where I’ll use a considerable amount of time to work on said issues, but hopefully I will be able to get the Super market logic in, finally.