Ideas - heinermann/factorio-starcraft GitHub Wiki

Overview

Nothing ironed out yet.

Transpiling to Lua

It should be possible to transpile C++ to Lua code using wasm2lua if necessary. It may be tricky to rewrite everything due to the sheer quantity but transpiling also won't consider any intricacies of Factorio or utilize any performance optimizations that the Factorio API may offer.

Logic

The biggest issues will be identifying where exactly Factorio logic can be used directly instead, assuming that Factorio APIs are more performant than the Lua script processor.

We can have unique structs/dictionaries for units and some bullets with lookup on entity updates, but no relationships to sprites or images like in Starcraft. In many cases animated image overlays and smoke can be done natively in Factorio without any Lua code. Since there will be performance issues, the focus should be offloading as much functionality as possible to Factorio where possible.

Specifically on bullets, some will need special handling such as lurker spines, valkyrie missiles, and mutalisk glaves.

IScript

IScript will be similar to the callbacks used in the current VespeneGeyserSpecialState1. This can be simplified so the verbosity of function definitions isn't apparent.

AIScript

The AI will need to be custom. The built-in AI and even BWAPI AIs will make assumptions about map sizes or number of bases. It doesn't need to be good. A lot of the AI ability targetting and basic reactions can come from a decompile.