Posted December 05, 2019 by Compiled Games
#updates
Hello, Kirthos here.
We just released our first update. The game has been on itch for 2 weeks and we got many bug reports and feedbacks. I tried to fix most of them in this update. For players interested in the list of bugs fixed. The changelog is available at the end of this devlog.
One of the bug reports we got was about crafting. The bug is related to crafting tables and occur when multiple different recipes are planned on the same table. For instance, let's take the stone or electric oven: You have 1 oven on which you ask to craft 1 bread and 1 apple pie. You don't have bread (needed to make the apple pie) but you have apple and wheat. Apple for the apple pie and wheat for bread. The right behavior would be: the pawns make the bread using the wheat with the oven then the pawns do the apple pie with the crafted bread and apple. But the issue was that the oven was trying to first craft the apple pie, asking for apple and bread. Apples were hauled to the furnace and placed inside and then the oven waits for bread. Since you only have one oven in my example you cannot craft the bread with the wheat you have since the oven is already used to make the apple pie. That also means, that in the worst-case scenario, you needed at least as many furnaces as the requested number of apple pie + 1 in order to never get stuck, which was ... impractical.
I rewrote how the crafting system works. Before, the game would set the craft order inside a table directly when you asked it, search if materials are available and wait if there is not enough material. Now the game verifies you have the material available to make the craft. Then it reserves all materials and finally sets the craft in the table. If there is a problem (for example, an item is no longer available because you build a wall between the table and the item) everything is canceled correctly and the table can be used to craft something else instead.
One problem was left, when you loaded a game from the previous version, the new crafting system broke everything. Tables were reserved by craft jobs but were not supposed to, since the materials were not available. I have written a small code to migrate saves. This allows us to run code when loading a game from version A to version B. Now I just needed to cancel all crafting jobs when you load a save made in version 1.1.0 with version 1.1.1 and re-assign all tables using the new crafting logic.
Let us know your thoughts in the comments below.
Thank you for reading. The changelog is available below.
CG Out!