General philosophy: every job has its own "warper" and we grab that warper for each villager during the time warp phase of the town flag's loading process.
Each warper simulates the passage of time and then returns an updated town state which is passed into the next warper as the starting point.
Also:
- Store state before restoring villagers so they have the warped state
- Prevent a critical log when nothing is wrong
- Updating all jobs to be more declarative (and thus have warpers)
- Explicit "is player close" logic for time warp
Better handling of multi-villager warps:
First, we calculate the specific ticks where the work for each villager would be run and store a tuple of [tick, lambda function] in a list. Finally, we sort that list by tick and run each lambda in the sorted list. This should mean that each villager action (lambda) is run in the order that it would be run if this were happening in real-time.
Some light play testing shows that this seems to be working well.
Play testing
- Preventing infinite loop when loot table lookup fails
- Fixing job logic for tool-less jobs that require work
- Tested via time warp, NOT TESTED by playing
- Added some new villager skins (Thanks Niki)
- Added logic to show non-error graphics for some production statuses
- Added logic to remove entities from town state when killed
- Fixing world interaction logic to make crafters work properly
- Removed all while loops to avoid game-breaking freezes
- Fixed bug where villagers were taking more than one ingredient from town containers.
- Adjusted gatherers to prefer "no tool" work if it can produce the requested results.
- Fixing world interaction logic to make smelters work properly
- Adding translations for smelters
- TDD: Fix bug where gatherers do not leave Fixed: Gatherers no longer return home when job board is updated
- Make workers stand beside job block ... instead of walking around it randomly
- Also removed some old TODOs that are no longer relevant
- Better "go to job" nav + skin logic fix
- Fixing handling of 1x1 rooms
- Setting some more status art for production jobs
- Fixing bug where job board was missing addable items
- Rendering item in Villager's hand
- Fixed a bug where work results had extra quanties on their NBT
- Added
qtfreeze
flag block command to make it easier to run theqtsetjob
on villagers (because they will stand still) - Introducing randomness so villagers will better share resources, job blocks, and requests
- Villagers will choose a random work room and block and then keep it until they have finished the work.
- Villagers will now "give up" on their current work if they go too long with no supplies in town.
- Adds "explorer" job, who leaves town with paper and food, and brings home maps that are tagged with a biome ID
- Adds "mapped gatherer with axe", who takes food, an axe, and a map to collect wood, saplings, and other supplies from the biome that is tagged on the map.
- Generally improves the AI around jobs to make them work more reliably
- Adds the
/qtsetjob
command for changing villager jobs in creative mode.
See https://modrinth.com/mod/questown/version/1.18.2-0.0.4-beta.1 for more details.
This version is a fresh migration to 1.19.2, so it hasn't been tested as thoroughly as the 1.18.2 version.
New Gameplay Dynamics:
Introducing three new villager jobs: Blacksmith, Smelter, and Crafter.
- Blacksmith crafts wooden pickaxes using fewer materials.
- Smelter extracts more iron from ore using an Ore Processor.
- Crafter produces bowls, paper, sticks, and planks efficiently.
Job Board and Room Quest:
- Added a "Job Board" block for resource requests.
- Right-click to manage requests; villagers produce items based on player requests.
Villager Improvements:
- Villager UI enhancement: Right-click to view required resources for their job.
Developer-Friendly System:
- New system for effortless addition of diverse villager resource production jobs.
Quest Enhancements:
- Improved quest logic for randomness.
- Villagers no longer request endless crafting rooms.
- Players can decline quest batches, with a new batch added the next morning.
Additional Features:
- Numerous new configuration options.
- Performance optimizations for smoother gameplay.
-
Added smelter and generalized jobs to make it easier to add new ones
- https://github.com/bradsk88/Questown/commit/9d27ce6d281ba0f94ad7ccaf9a97e5c583b5ec14
- https://github.com/bradsk88/Questown/commit/5e0b10d5e105fa9674eaa47ba8444b8e52fd051e
- https://github.com/bradsk88/Questown/commit/bb6d86dac92204e76c78926051e50ff1d81b4534
- https://github.com/bradsk88/Questown/commit/c3736a11aa18335ce26623d4965d2e1d445b6cb0
- https://github.com/bradsk88/Questown/commit/d09626442b32bb55d769fc1852c5829522b5e80f
- https://github.com/bradsk88/Questown/commit/24ff6a96c12f8c783e89c3242ffdc1cb08dabce1
-
Smelter's work cycle:
- Add ore to block
- Stay at block and process it
- Extract raw ore
-
- Updated production jobs to go to correct chest for supplies
- Updated InventoryAndStatusMenu to support non-gatherer statuses
- Updated smelter to show InventoryAndStatusMenu1
- Created a central repository for status textures
- Reduced bloat on some logs
- Reduced a redundant calculation in production jobs (rooms needing ingr.)
-
WIP: Smelter's tools degrade (not 100% sure this is working)
-
Adding model for Ore Processing Block
... formerly "smelting oven".
-
Blacksmith declarative job
- Enable walk timeout to be set via Config
- Improvements to pathfinding over water
- Villagers will do a better job of pathfinding on above-water paths
- Increased pathfinding "give up" duration significantly
- Removed "door" position as a wander target
- All positions within room are now included as potential targets
- Also:
- Do not consider stairs "walls"
- Improvements to pathfinding in water
- Very specific edge case with water, under air, under fence
- Villagers will view the "gap" as a wall
- i.e. They will not swim into a 1-block gap
- Very specific edge case with water, under air, under fence
- Server side utilities
- Right click on flag with oak log to write Quests to server logs (get it?)
- Stop logging the town state. I think it was causing lag spikes.
- Baker and room improvements
- Bakers will switch to "relaxing" in the evening
- Doors will be de-registered upon destruction
- Make sure room recipes don't get double-filled on server start
- Quest UUID improvements
- Quests will no longer be assigned a random UUID on creation.
- Quests with an owner UUID that does not match a villager will be replaced with a random villager's UUID.
- Added the ability to see a specific villager's quests
- Added a service function for calculating room recipe item weights
- Added "job" quests that are added after finishing a batch
- Upon completing the quest (e.g. "build a farm", "build a bakery"), a villager will change to the appropriate job.
- Quests will now tend to include a bed if one is needed
- Adjusted factors for quest batch building (and added config)
- Gatherers with axes will acquire biome-specific wood
- Better documentation around job quests
- You get a page in the journal to explain it
- The quests screen will show the villager and job
- The player gets an achievement when a job quest is added