Since a year or two the engine provides variadic versions of common LUS functions like Turn, Move etc which is meant to save the runtime overhead of multiple function calls. Like this:
- Move(foo, x_axis, 1, 2)
- Move(bar, y_axis, 3)
- Move(baz, z_axis, 6, 7)
+ MultiMove(foo, x_axis, 1, 2,
+ bar, y_axis, 3, nil,
+ baz, z_axis, 6, 7)
The basic way to apply this is to of course edit the script files. The other would be to keep scripts as-is and instead modify the LUS gadget to automatically do some string preprocessing at init.
Caveats:
Turn is actually wrapped in the LUS gadget and would either need support there or be exempt.
- keep in mind the 4th 'speed' arg can be
nil, like in the example above, which can ruin naive parsing.
- the perf gains are apparently quite low, so even though we get them "for free" this is a low efficiency task. Proof of concept and a fresh measurement (on a unit with lots of adjacent function calls, say Dirtbag) would be good.
- this applies to the usuals (
Move, Turn, Spin, Scale) but also Explode (!), SetPieceVisibility, and StopSpin.
Since a year or two the engine provides variadic versions of common LUS functions like Turn, Move etc which is meant to save the runtime overhead of multiple function calls. Like this:
The basic way to apply this is to of course edit the script files. The other would be to keep scripts as-is and instead modify the LUS gadget to automatically do some string preprocessing at init.
Caveats:
Turnis actually wrapped in the LUS gadget and would either need support there or be exempt.nil, like in the example above, which can ruin naive parsing.Move,Turn,Spin,Scale) but alsoExplode(!),SetPieceVisibility, andStopSpin.