As I do every week, here is a link to my discord channel, its pretty lonely here at the moment haha but, if you want to have a quick chat or discuss anything with me, I’m always around!
This week I finally focused on the player’s job. It was a bit of a journey, in the sense that I had to do a lot of refactoring to make the game even more modular to allow for more complex behaviors, but, it is coming along! Had to think a lot as well about what the job would actually be in game… the idea is that you will work at this supermarket, restocking shelves as they get cleaned by the population, but I wasn’t entirely sure what that would mean in practice. I came up with this idea that I think is pretty cool, so, here’s how it works.
Step 1 – If the supermarket is open, which means at least one of the 3 managers is working at the moment (supermarket is not open 24h per day and if one of the managers has more pressing matters to attend to… it might be closed at other times as well), go in, speak the your manager to start working, and go pick up boxes.
Step 2 – Bring the stock box to the correct shelf, open your “carrying” slot panel (which is named inventory in the video because Im that smart), drag the box from your hand into the shelf, and click on it like crazy to destroy it, restocking the shelf with its contents.
Step 3 – Start practicing for the box carrying olympics.
Step 4 – Die inside the market because the last manager went home and you got locked inside, while people queue in the morning waiting for the market to open. Some might not survive the night waiting for the market to open… the pandemic will spread… but sure enough, people will have their bread, all thanks to you!
And thats it! Just feel the satisfaction of a job well done! I mean, there might be a few changes to the process in the future but… who knows? At any rate, here is the full list of changes for this week:
-Added basic cheating system so you can kill other characters by pressing “K”. Very important for testing, not because I like killing citizens, obviously;
-Completely re-doing AI system once again to allow for more complex, multi-step behaviors for NPCs;
-All AI tasks re-implemented with the new system, including the two jobs that had been lost for a bit, Supermarket Manager and Supermarket Cashier (they just stand there but imagine there was a desk and tills);
-Created character animations for picking up light, medium and heavy objects in the world;
-Created logic so you can pick up “Carryable” objects in the world;
-Created logic so carrying objects affects your movement speed, animation, food and energy consumptions;
-Created temporary “Carrying” interface, which is a way to bring whatever object you are carrying from the game world to the physical world, like the stock box into a shelf;
-Implemented all logic for how these objects can be picked up/dropped, like with double interactions, sneezing, dying, etc;
-Created concept of “Breakable” objects, which can be clicked X times before breaking;
-Created concept of breakable objects being able to spawn sub-objects, liek the stock box spawning apples when broken;
-Implemented basic interaction with Supermarket Manager to start your shift, still temporary;
-Re-adding family members to the simulation which had been removed during the AI refactors;
-Adding the concept of “Health” to family members;
-Adding the concept of entity parenting, which is different from ownership, so for example, the shelves are children of the supermarket, which is a strong, immutable relationship;
-Created prefabs for the other types of food with proper values, however still no art, only apples;
-Refactored basically all the physical world logic to make it more flexible and easier to extend, as I was running into a few self imposing limitations while making the current interactions;
-Implementing very simple point->box detection logic so we dont need Unity colliders or triggers to know where dropping entities in the phyiscal world and what to do with dropped entities, as Unity’s colliders end up facing annoying limitations related to object life-cycle (being disabled for example);
-Implemented system where shops can close/open based on how many employees have checked in, which was necessary because the supermarket has 3 managers in 3 different shifts which overlap a little to account for delays in living too far away and so on;
-Properly implemented the NPC supermarket jobs;
-Making it so pharmacies do not have endless stock, might need to revisit;
-Adding some randomness to the “Eat” task, so citizens will pick more varied shops to eat from;
-Added a way to name entities by instance rather than by prefab;
-Fixing quite a few bugs related to physical world and entity death;
-Housekeeping on the project to remove classes/assets that are already no longer in use.
And thats it for this week’s update! Next week I hope to finish up the player’s job interactions, the player still needs to earn money, some rules are still not implemented and so on, and hopefully from that point onward the game will start getting into shape, with the full cycle of maintain needs (sleep, eat, healthy) -> work to earn money -> spend money to buy supplies for you and your family -> feed family -> repeat.