this week was another short week but it proved fruitful, as work was achieved and i went and picked strawberries.

multi factories

its long been the goal of this game that the player wouldn’t just be making single assembly lines, and that there would be situations where multiple factories would be connected together so dedicate tasks and make it easier to mass produce.

the actual changes needed to achieve this were immense, however. the factory state system is one of the oldest parts of the game back when it was just a random idea of many, and which i wrote on the plane while flying to japan.

luckily i wasn’t completely holiday headed when i did it and i included a few features that made this process easier though still painful.

states

the factory is really just an array of factory entites which have positions, each entity is linked to a display. in the last two weeks this was reworked, now there is another entitity that contains the displays and removes the need for the factory manager to really care about them; the mystical DisplayHandler.

this object takes the factory state like a cassette tape, as mentioned a few weeks ago. it then handles everything from animating entities to handling fusions between them which frees up the factory manager to handle multiple DisplayHandlers instead. this lets us have more than one state in the game.

there were a lot of headaches in this, the short list being

  • factory event queus being run on every running factory making stuff move though walls
  • a new drag and drop system being added to the input manager
  • a lot of toing and froing on where is the best place to store info for dragged states
  • getting literally 2fps when drawing the display entities
  • fixing undo/redo (not entirely solved!)
  • and many more

but the result is this multiple factories running together in harmony

given that the factories are going to be connected with cable conveyors, we also needed a way to rearrange them each factory can be moved using a handle on the top and they dont like to overlap

anyway theres a lot more to do on this, namely getting interfactory connections working. this has proven very complex as theres a lot of constraints both from the game side and from the uv side. thats all for this week though.