This week I finally finished Big Task #2 of 3 in Build 11. I worked on it for 2 months so it's a little disappointing to only cross one thing off the list of outstanding tasks, but awell. It's done.
To get the economy working correctly (well, close to correctly) a lot of things had to be done. For those who are interested they are below.
So when will Build 11 be done? I am working on a few of the smaller items on the Outstanding Tasks list before tackling #3 which is the emergent quests, lairs, and completing quests for people. Based on what I know right now it is not a 2 month task, it is much smaller, but we'll see.
Progress since the last update:
- Every town now has an automatic towncenter (mayor works here), inn (necessary for player and NPCs), and marketplace (keeps the stockpile and allows trading)
- Mayor now builds all buildings in a town beyond those.
- He also builds the Homes people live in, so they are paying rent to the Township not to him personally. When an NPC makes enough money, or if a player feels nice, they can purchase the home from the township and no no more rent. Yes, eventually the player can own houses and rent them to NPCs.
- Mayor now builds buildings based on available resources (around the town, and globally) and with global uniqueness in mind "I need to build something, and no one has a tailor, so I'll build a tailor workshop"
- Got mayor not to build duplicates of unique buildings (There is no value to two outfitters, or inns, in the same town)
- Fixed traders repeatedly going to the same town. Revising the scoring algorithm with stock levels made them go to the best choice. One town may have metal which is really needed, but another town has grain, livestock, and ale which is less needed but overall more beneficial to meet 3 needs instead of 1
- Fixed traders never buying a second time. Whoops!
- Started moving processing around between hourly turns, daily turns, weekly turns, monthly turns. It was naive and difficult to follow when things were happening when it was all jammed into one Turn()
- People who haven't been paid at their job quit after N days
- Added paying rent to owner or town (depending on who owns building), and if can't, get kicked out of home.
- This is quite complicated because I have to figure out if the person in question is the "head of the household", and if they can't pay the rent, then the whole family gets kicked out and lives on the streets. And if their luck turns around they all move back into a house too.
- Fixed issues with family money pooling in Streets
- By default family members pool their money and items into one inventory, the one in their home. But living on the street is like one BIG home that houses multiple families, and it was pooling everyone's stuff together. So if they live in a house, everything pools in the house, if they live on the street, everything pools with head of the household
- Look for a house before building a new one.
- This was important, otherwise the mayor would kick someone out of their home, and then when they got money and wanted a house, he'd build them one. Infinite empty houses in a town!
- Death & passing on to heirs
- As explained in the video it was important to figure out who the direct heir is of someone who dies and pass ownership of home and business to them. If a son inherits his dad's inn, he also needs to become an innkeeper and leave his original job... unless it was a good one. Pretty thorny stuff. The idea here is to be medieval and keep jobs within the family.
- Fixed a bug where the population of a town never changed
- Added NPC remembering what he ate and when he ate it. This was necessary to figure out "I haven't eaten in N days and I have no job, this place sucks, i'm outta here!" and they move to a new town and try their luck there.
- Added criminality to NPC brain. Continued suffering increases thier likelihood to "break bad"
- Added NPC becoming a bandit (sorta)
- Added begging for beggar job. They currently beg other NPCs, i still need to add in begging the player.
- Fixed market problems and some UI issues
- Added logging of town storehouses every month so i can monitor the economy. I need some better tools to be able to balance the economy better
- Supply/demand trading economy now works!
- Made NPC sleep cycle self healing, if someone goes to bed super late they are sleep deprived and make it up getting them back to a normal cycle
- Fixed double greeting problem on marketplace
- Fixed a menu performance issue
- Fixed gambling encounter, it broke when i put in the new menu system
- Gambling now passes time, so you can waste away your life gambling if you desire
- Fixed bug where encounter dialog stayed open after being kicked out of a building