Back to Space Fortress Overview

The Job System

The biggest thing about this game is managing workers to do all the jobs you would like to have done. The whole point is to direct your asteroid to success. It is important to have a good system in place for managing the work that has to be done. What does a good work system need? I've broken it into three levels, and it seems to work nicely.

  1. Orders
  2. Tasks
  3. Jobs
The language is a bit ambiguous, so I'd like to have some better names for these. But I figure that conceptually, a three level approach is the best for the way this will work.

Something else is the idea of a worker. A worker is an entity that you can order around and can do jobs. They can become as complex as we'd like, but for now they just do what they're told. Examples of complexity might be worker aptitude for certain tasks (mole-people dig better than a race of clever slugs) in how they move (dolphins in spacesuits can fly while humans have to walk on solid ground), you can work in experience levels for veteran workers, but right now I just have a vanilla robot that can do stuff.

Orders: The Player's Mandate and the GM

When you want something done in your little asteroid, you have to pass an order to the general manager. The order is a very high-level request that comes out of player input. In mining, the order would be designating a specific area to be mined. In building, the order would be saying "Place a building at x, y", which is accomplished by a series of mouse-clicks. This very high level request is passed along to the general manager.

The GM is the organizer for everything you want to have done in the game. It micromanages so you don't have to. When the GM hears "Mine area x1,y1 to x2,y2", it will add every single one of those tiles to the designated tiles. It will then figure out which tiles are to be mined right now, and which can wait. It will figure out which ones require a warning or player input. It takes all that away. It works by delegating to specific sub-managers, there is one for every group of tasks that becomes sufficiently complex. For instance, there is a mining manager that juggles all the tiles to dig and rubble to be hauled. Managers are amicable and communicate well amongst themselves.

So, to summarize, an order is a high level, unprocessed request from the user. Basically the summary of some player input. It's bundled up and passed over to the GM who then chews it over.

Tasks: Orders Refined to Compound Jobs

A task is a slightly more processed order. A task can be assigned to a worker and it produces jobs. It's really a lot like a compound job, or a set of jobs (we haven't defined job yet, though). An example of a task might be "Go fix Robot #33". So, it is lower level than the order that came from the user (which might have been "Fix all the robots in my selected box" or "fix all robots that are broken"), however it is still not simple. What does "Fix Robot #33" mean? It's a handful of small jobs. First you have to walk over to the robot, then you have to diagnose it, having diagnosed do you fix it there or pull it to the garage, do that, now it's fixed. Many jobs, but one task.

When a worker gets assigned a task, it can then poll the task for jobs. The manager in charge of the task then figures out what job to give the worker based on the current situation.

Jobs: The Atomic Action

At the very bottom of it all we have jobs. Jobs are tiny little things. They're done one at a time, and a worker devotes it's entire existance to whatever job it is currently assigned. Jobs are small, discrete units of work. Examples would be "Walk to position x, y", "Dig hole downwards", "Pick up item at feet", or "Scrub the floor immediately below you".

Robot Maintenance Example

Here's an example of how a worker would end up fixing a little robot, using this job system.