Skip to content

4- Dactorio

5 – Dactorio: The game is almost “playable”? – Summer & work

So hello! Its been a while since my last post due to some small problems like schoolwork, final projects, and oh, the coronavirus. But finally I’m one with all that so here is an update!

During this time I didn’t get to do much coding, however I did some research on moddability and did some general architectural design.

Apparently, scripting moddability is generally not very allowed on mobile platforms due to security reasons. Apple, of course, is even more strict, and there is only one app where you can code on the AppStore.

Also, scripting mod support is HARD. It’s a whole new world of design with a multitude of possible deadends and heavy tech debt issues if you don’t do it right. Apparently, there is a reason why there aren’t many games with extensive modding support. You need to expose a careful API, deal with ridiculous bugs, compatibility, version control, and these are even more difficult to do with Unity.

Due to these reasons, I decided to have a less extensive modding support, at least for the first launch. I will have all the buildables and item recipes associated with that exposed, with a possibility to have custom graphics, so people can have mods with more complicated supply chains and recipes. But crazy overhaul mods won’t be possible for a while. I don’t even know if people will mod the game at this point, so that seems to be a good compromise.

On the architecture side, I drew some relation graphics and made sure there wouldn’t be circular references, which you can’t do if you want to have unit testing in unity. It was an interesting challenge, but fairly straightforward. I’m quite sure the actual coding step will create lots of unforeseen problems though.

The internal architecture of all the major scripts

I also looked into ways I can set up the crafting recipes without getting lost with the complexity, and figured a node system would work. I found the library xNode to be nice and very easy to customize, and got it to work after some usual struggle.

So much automation!

After getting done with the core system and have the game playable, I’m also thinking of moving all the belt and building update logic to DOTS, as currently a big section is handled by regular C# and objects, not delivering the performance I would like in my old modest android phone. But my phone struggles even with google or youtube so even this state will most likely okay for a first release. I can also always make most recipes use very little items, as an ‘artificial’ performance boost. However I personally like seeing thousands of items move around, so I will try to avoid that.

Next update, hopefully in a week or two, there will be buildings!