Update #74: Accelerating Progress

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:

  1. Every town now has an automatic towncenter (mayor works here), inn (necessary for player and NPCs), and marketplace (keeps the stockpile and allows trading)
  2. Mayor now builds all buildings in a town beyond those.
    1. 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.
  3. 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"
  4. Got mayor not to build duplicates of unique buildings (There is no value to two outfitters, or inns, in the same town)
  5. 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
  6. Fixed traders never buying a second time.  Whoops!  
  7. 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()
  8. People who haven't been paid at their job quit after N days
  9. Added paying rent to owner or town (depending on who owns building), and if can't, get kicked out of home.
    1. 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.
  10. Fixed issues with family money pooling in Streets
    1. 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
  11. Look for a house before building a new one.
    1. 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!
  12. Death & passing on to heirs
    1. 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.
  13. Fixed a bug where the population of a town never changed
  14. 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.
  15. Added criminality to NPC brain.  Continued suffering increases thier likelihood to "break bad"
  16. Added NPC becoming a bandit (sorta)
  17. Added begging for beggar job.   They currently beg other NPCs, i still need to add in begging the player.
  18. Fixed market problems and some UI issues
  19. 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
  20. Supply/demand trading economy now works!
  21. 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
  22. Fixed double greeting problem on marketplace
  23. Fixed a menu performance issue
  24. Fixed gambling encounter, it broke when i put in the new menu system
  25. Gambling now passes time, so you can waste away your life gambling if you desire
  26. Fixed bug where encounter dialog stayed open after being kicked out of a building