This is a development thread for my upcoming automation game, now titled Factory Farming. The game will be a simplified "Factorio clashes with Stardew", when you will exploit the land using automation to maximise throughput; maximise profit.
I am more of a build-it-then-release it kind of developer, but as the performance of this game is going to be so very dependent on the hardware, and as I don't expect to be able to get an actual Playdate any time soon, I will post snapshots at various points so as to be able to get some continued feedback on the performance.
In Alpha 1 ( Efficient sprite animation? For a large number of sprite instances - #9 by ncarson9 ), I experimented with the Playdate's sprite system on its own, and saw how far I could push it. The answer: not nearly far enough for my goals! But this was not unexpected. The sprite system is a general-purpose tool, it is obviously not optimised to form the backend of a factory simulation...
It's all in the chunks
In Alpha 2 I wrote a proper backend to handle the sending of data to the sprite system and the simulation of the factory. The world gets split into chunks, with sprites in the current and surrounding 8 (when zoomed out), or current and neighbouring-corner 3 (when zoomed in) chunks are delivered to the sprite system and simulate (or "tick") at a fast rate of 16 'regular' ticks/sec.
To balance performance, the sprites for individual conveyors (which are animated) only get added when zoomed in. When zoomed out, all of the graphics except for the moving cargo sprites are baked into the background images.
The rest of the map outside this small region is kept out of the sprite system, but still ticks at a slow rate of 2 'big' ticks/sec. Hence the factory still operates outside of the visible range, just at a lower granularity. The simulation is hence also not in "lockstep", unlike Factorio proper. This Alpha 2 build can still be found on discord in the testing channel ( Discord ).
Adding I/O & Farming Game Fundamentals
Now I am ready to post Alpha 3, the game most importantly now has an automated saving and loading system - so you don't have to start from scratch each time! The game's systems are also expanded to support building more than conveyor belts. Now some crops, a harvester building and a filtering conveyor splitter can all also be placed / planted too (Note: the filtering splitter filters based on the first crop-type to pass over the tile). Hence now the fundamentals of growing crops and moving them around are in place. There is also a box to "sell" crops, though nothing can be subsequently bought yet.
Alpha 4 comes shipped with a small world I was messing around with, but you can reset it from the system menu. You can also manually save and load from here, though you should not need to.
I will try and maintain save-compatibility moving forward, but this obviously cannot be guaranteed at this point.
The world is little less uniform in Alpha 3+. with some different ground types, rivers and lakes. Also to stress: no graphics are final, and I am aware that the visual readability is rather poor in places.
Summing it up
Factory Farming is written entirely in C (and is open source: GitHub - timboe/FactoryFarming ), with the goal of supporting the simulation of good-sized factory setups. I want to support at least 2000 conveyors, hopefully more. Target FPS is 32, the simulation speed is currently tied to the FPS (and it would be tricky to decouple it).
Alpha build UI: Menu items displayed on the right, info ticker along the bottom
- Crank: rotate building in Menu and Placement modes, or zoom in & out in Wander mode.
- A: Enter 'Menu Mode' from 'Wander Mode', select current item in 'Menu Mode' and enter 'Placement Mode', place building or crop in 'Placement Mode'.
- B: Exit from 'Placement Mode' to 'Menu Mode', and from 'Menu Mode' back to 'Wander Mode'
Next Steps: I just started Trello to keep track of what needs doing.
The latest public build is Alpha 6
- With 16x16 world may consume too much RAM on-device FactoryFarming_Alpha_3.pdx.zip (142.4 KB)
- With 8x8 world FactoryFarming_Alpha_4.pdx.zip (127.7 KB)
- With UI FactoryFarming_Alpha_6.pdx.zip (132.0 KB)