Hi, I didn’t find a better place to ask this question.
I have a short technical question for the developers:
If you had to create the modding system again today, would you prefer to use WASM instead of Lua, or is Lua still the better choice for Factorio
WASM instead of Lua
Re: WASM instead of Lua
Not a Factorio dev, but I won't consider WASM for a modding system:
- Bad development ergonomics. You have to compile something else into WASM, so it would be clunky to run something immediate from the map editor.
- Bad performance. WASM trades high interfacing overhead for computational efficiency. The evidence is WASM being much slower at DOM manipulation than vanilla Javascript. For a mod it's usually counter-productive since modding is mostly interfacing.
Do you have some computation-heavy modding ideas in mind? Maybe they can be implemented using some creative shader passes?
- Bad development ergonomics. You have to compile something else into WASM, so it would be clunky to run something immediate from the map editor.
- Bad performance. WASM trades high interfacing overhead for computational efficiency. The evidence is WASM being much slower at DOM manipulation than vanilla Javascript. For a mod it's usually counter-productive since modding is mostly interfacing.
Do you have some computation-heavy modding ideas in mind? Maybe they can be implemented using some creative shader passes?
Re: WASM instead of Lua
Thanks for the great answer! I hadn’t thought about the performance cost between the WASM and engine boundaries.
No, this question isn’t about any specific modding ideas — I’m a developer (but not a game dev). I'm just curious about how things work in the game development world or maybe I should say performance-optimized world.
No, this question isn’t about any specific modding ideas — I’m a developer (but not a game dev). I'm just curious about how things work in the game development world or maybe I should say performance-optimized world.
Re: WASM instead of Lua
I would be interested in trying C# as a modding language alternative, but I haven’t looked into the cons of it, and I’m unsure if it supports running on non-windows.
If you want to get ahold of me I'm almost always on Discord.
Re: WASM instead of Lua
Rimworld modding is C# based, however as far as I understand Rimworld itself is programmed in C# (Unity engine) and the modding "API" is just a hook into the class and object structure directly. It's directly patching the game, not going through a well defined modding api. A different concept than Factorio. And also as far as I know, mods are supported on all the platforms Rimworld is running on: Windows, Mac, Linux. Consoles are supported as well, but I don't know about mods for these.