C
C#2y ago
D.Mentia

❔ Game Design Brainstorm - Workers, Jobs

Not Unity's Workers or Jobs; I have an idea for a colony simulator style game, but keep struggling coming up with a good design for handling the jobs system and specifically, resource reservation.
I figured you guys could come up with lots of interesting ideas, if you find the problem interesting. I'm looking for something similar to Surviving Mars; very automated, intended to encourage more workers than jobs (to handle bursts), with little player interaction, and the main challenge is the logistics of keeping things close to reduce travel times. Not like Rimworld, with lots of fiddling with priority and more jobs than workers Desired behavior: Basically, when a Job is possible, the nearest available Worker is assigned to do it. As a simple example, we'll say we have a Steel Factory, which requires 2 iron ingots, and 100 units of 'work', to produce 1 Steel Sheet. For simplicity we'll assume one recipe per machine, and each Worker can carry one item in its inventory When that factory is turned on, 2 workers should each retrieve an iron ingot from the nearest location, and bring it to the factory. This is where resource reservation comes in; we don't want multiple workers trying to grab the same resource and having to reroute. We also don't even want to tie up workers when all the iron ingots are already reserved for other jobs When the factory has the resources it needs for a recipe, a worker should be assigned to 'work' the factory to create the recipe output. A worker then delivers that output to a storage facility, and the process repeats Extra concepts: - Workers may have a Class and level, and certain jobs may require a specific class and level of worker - Jobs include things like, delivering to and building blueprints, delivering resources to storage, delivering resources to a machine, working a machine; the design should be generic enough to apply to all of them I have a big ole design ready, but it feels clunky and every time I try to use it I feel like something's wrong. I'm not sure if I want a Resource<T> or an IronIngot : IResource, for example.
Here's an early pass at that, though I'm still tweaking it: https://paste.mod.gg/pbwbwzttbrum/0 And again, I'm just asking for ideas on the patterns and structures to use for this. Performance will likely be a concern, I'm assuming thousands of workers and jobs at any given point (but DOTS can power through a lot of overhead).
BlazeBin - pbwbwzttbrum
A tool for sharing your source code with the world!
1 Reply
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.