Valheim
Install with App

Details

Latest version
0.15.0
Last Updated
First Uploaded
Downloads
1.9K
Likes
2
Size
120KB
Dependants
ADDatHost Valheim hosting
30% off

CI Package License: MIT

DvergrWorkers

Workers

Dvergr workers help around your base and defend it when it is under attack:

  • Repair Worker - fixes damaged structures around the base.
  • Woodcutter Worker - fells trees and collects wood.
  • Blacksmith Worker - manages smelters, kilns, and blast furnaces.
  • Refueler Worker - keeps torches, fires, braziers, stone ovens, hot tubs, and shield generators topped up with fuel.
  • Farmer Worker - harvests crops and plants your tilled soil.
  • Tree Farmer Worker - plants trees from seeds.
  • Barley Worker - feeds windmills with barley and collects the flour.
  • Flax Worker - feeds spinning wheels with flax and collects the linen thread.
  • Eitr Worker - feeds eitr refineries with sap and soft tissue and collects the eitr.

Workers in Action

To test the productivity and coordination of the workers, I set up a small base in the Plains with various structures and chests for each type of worker.

Base 1 Base 2

I gave them a handful of seeds and plantable crops, along with some copper ore. I then sat back and watched as the workers went about their tasks.

Input Chest 1

After a few rounds of work, the workers had become fully self sufficient. The initial progress was slow, but as they gathered more resources and completed more tasks, they became more efficient and filled their chests whilst sustaining their own job needs.

Output Chest 1 Output Chest 2

How It Works

Dvergr workers each have a job to do around the base. They have designated beds that serve as their spawning point and their work area. They use chests for storing resources and materials needed for their tasks. They even fend off enemies attacking the base! Players cannot hurt them, and at night they go to bed and sleep instead of working.

Roles

Each job loop:

  • Repair Worker - finds all damaged pieces within its work area and repairs them.
  • Woodcutter Worker - fells trees, chops logs, clears leftover stumps, and collects wood, resin and feathers within its work area.
  • Blacksmith Worker - adds wood to kilns, refuels smelters and blast furnaces before adding ores/scrap to them, collects the finished products and delivers them to the output chests.
  • Refueler Worker - tops up the torches, fires, braziers, stone ovens, hot tubs, and shield generators you have built with resin, coal, wood, greydwarf eyes, guck, and bone fragments from the input chest, returning any spare fuel afterwards.
  • Farmer Worker - harvests ripe crops growing on tilled soil and plants every free tilled spot within its work area. It never tills, so you decide where the farm is. It plants seeds from the input chest, spreading crops evenly, and plants raw ingredients (carrots, turnips...) to make more seeds when a crop's seeds run low. Each crop is only planted in the biome it grows in, and tree seeds are ignored. Crops go to the output chests and seeds back to the input chest.
  • Tree Farmer Worker - plants tree saplings from the seeds, cones, and acorns in the input chest on suitable ground within its work area. It plants species evenly, only where each grows, keeps well clear of buildings and farmland, and stops once the area holds a configurable number of trees. The woodcutter collects the seeds that felled trees drop, so the two keep a forest going.
  • Barley Worker - keeps windmills within its work area fed with barley from the input chest, collects the flour, and delivers it to the output chests.
  • Flax Worker - keeps spinning wheels within its work area fed with flax from the input chest, collects the linen thread, and delivers it to the output chests.
  • Eitr Worker - taps sap extractors within its work area, keeps eitr refineries fed with that sap and the sap and soft tissue from the input chest (spare sap goes to a chest), collects the eitr, and delivers it to the output chests.

Beds

Each role has a buildable bed that spawns the corresponding worker. The worker will perform its tasks automatically within its designated area (a configurable radius around its bed). Workers will respawn if they die as long as their bed remains intact, and destroying the bed will despawn the worker. The bed's hover text indicates the worker's status (e.g., idle, working, resting, or waiting for resources) and which way the worker is from the bed (e.g., "23 m north-east, 4 m above").

Taking a break: press Shift+E on a worker's bed, or on the worker itself, to send it on a break. It finishes the round it is on, then starts no new ones (handy when the chests are filling with things you do not need right now) while still strolling about, sleeping at night and defending the base. Press Shift+E again to send it back to work.

Finding a worker: press E on a worker's bed to be shown the way to it.

Chests

The workers use the Worker Input Chest and Worker Output Chest (buildable, same cost as the reinforced chest) to store and retrieve materials needed for their tasks. These chests must be within the worker's job radius to be used. Currently, the workers share input and output chests within their job radius. This may be changed in the future to allow for more complex chest management or individual chest assignments.

When a worker deposits an item, it first looks for a chest that already holds that item, even if it is further away. If no chest does, it starts a new category in an empty chest, and only then uses the nearest chest with room. Workers deposit one kind of item at a time, so different items do not get mixed together. This keeps your chests organised.

Workers that need chests will not begin their jobs until they are built within the job radius. If the output chests are full, the worker stops and the bed's hover text says so.

Workers also tidy up and use items lying on the ground, so you do not always have to visit the input chest:

  • Machine workers (blacksmith, barley, flax and eitr) use input items dropped right next to one of their machines, e.g. ore beside a smelter.
  • The refueler uses fuel dropped right next to the fire it is refuelling.
  • The tree farmer picks up tree seeds, cones and acorns lying near somewhere it would plant a tree, plants as many as it can close to where they lay, and returns the rest to the input chest.

Workers also pass items along to each other. If another worker nearby makes an item, a worker that needs it will take it from the output chests. Items no worker produces are never taken from output chests, so your finished goods stay put. When several workers use the same item, they split the stock of it equally rather than one taking it all. For example, the farmer can keep replanting barley while the barley worker mills the rest.

Role Input Chest Output Chest
Repair Worker ❌ ❌
Woodcutter Worker ❌ ✅
Blacksmith Worker ✅ ✅
Refueler Worker ✅ ❌
Farmer Worker ✅ ✅
Tree Farmer Worker ✅ ❌
Barley Worker ✅ ✅
Flax Worker ✅ ✅
Eitr Worker ✅ ✅

Configuration

Settings are in the BepInEx config file javidahmed64592.dvergrworkers.cfg. Settings marked "(Synced with server)" use the server's values when the server has the mod installed.

Compatibility

  • Mods that change Dvergr behaviour, beds, or the machines workers tend (smelters, kilns, windmills, spinning wheels, eitr refineries, fires) may change how workers behave.
  • Mods that automatically move items in and out of chests may take items from worker chests before the workers do.
  • This mod has not been tested with a gamepad, only with keyboard and mouse.

Uninstalling

Worker beds, worker chests and the workers themselves disappear from the world when the mod is removed, along with anything stored in the chests and the workers' own inventories. Empty the worker chests and deconstruct the beds and chests first to get their materials back.

Known Limitations

  • Workers use the player's swing animations for their tools, but these are not adjusted for the Dvergrs so they may look slightly off or unnatural.
  • Occasionally workers may get stuck or be prevented from reaching their work stations. If a worker cannot quite get close enough to a target, it will work from a little further away than its normal reach. Clear pathing around the base minimises how often this happens!

Roadmap

Social behaviour such as chatting and greeting players, and smarter inventory management for workers.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.