Content Patcher

Content Patcher

463k Downloads

[Automate] Interest in including a base class modders can extend?

cosmicdreams opened this issue ยท 1 comments

commented

After reading the code sample provided for the Automate mod, the first thing that struck me was "Wow, we could add our own items to the game that do even more, Awesome!". The second thing that struck me was that a lot of the additional items that would be added would have to write the same code to do things.

We could provide a base class and an interface that includes common methods that certain kinds of machines need in order to do their work and allow the modders to either override or implement the remaining methods. This would simplify / speed development and reduce the occurrence of errors.

commented

A universal machine format is something I've wanted for a long time, but it's difficult. For example, Automate can't support some of the features in machine framework mods like Custom Farming Redux and Producer Framework Mod (they each have bridge mods to extend Automate with their particular features).

Automate's implementation is also heavily geared towards automation, including a lot of abstractions and optimizations that aren't needed for a simple machine mod.

When adding items there's also a lot of edge cases that Automate doesn't handle (since it doesn't add any items), like removing them from the world before save, dealing with custom locations, etc.

The ideal would be if the game itself had something like IMachine instead of hardcoding all the logic, but in the meantime it's best to use a dedicated machine framework like Custom Farming Redux and Producer Framework Mod.