[Suggestion] Allow separate accel/speed/handling/weight stat modifiers in Lua
For SRB2Kart I had developed an addon called "Chaos Drives", which allowed racers to collect Chaos Drives to affect one of four stats. In Remix Mode and Perfect Chaos Mode, these stats were supposed to yield the same bonus as setting the racer's speed/weight directly. A character with 9/9/9/9 would simultaneously benefit from maximum acceleration, maximum speed, maximum weight, and maximum handling for a highly performant vehicle.
However, this required strange multiplication that would yield different results based on load order, as the majority of other mods would affect speed additively, not multiplicatively. If I used additive bonuses instead, this would introduce an issue where characters who were supposed to have identical bonuses (e.g. 9/9/9/9) would experience different benefits from the same speed-boosting items.
SRB2Kart was late enough in its lifespan that it wasn't likely to receive regular mechanical changes, and if a load order issue did pop up, that was entirely solvable by just changing the load order.
Ring Racers introduces several more stat-based mechanics that I would have to write my own hacks for. Solely in terms of what stats currently affect in 2.2, there is:
- drift charge rate
- ring boosts
- boost-stacking in general, high-speed characters are able to break through tripwires through sheer willpower alone.
- tether acquisition, losing tethers, tether acceleration, tether speed
But also the game is already receiving some rather significant mechanical changes such as trick angle adjustment and fastfall redirection. Any of my adjustments to vanilla game physics would have to be continuously re-evaluated if I was writing hacks for Chaos Drives instead of editing the stat values directly.
Thus, I would like to change the way that racer stats are used by requesting some new fields in the player structure: additive modifiers for the two main stats and their inverse counterparts. Variable names are simply for demonstration.
- modifyspeed would be added to player.kartspeed for functions such as
K_GetKartSpeedwhere speed has positive effects. - modifyaccel would be subtracted from player.kartspeed for functions such as
K_GetKartAccelwhere speed has negative effects. - modifyweight would be added to player.kartweight for functions such as
K_DebtStingPlayerwhere weight has positive effects. - modifyhandling would be subtracted from player.kartweight for functions such as
K_GetKartTurnValuewhere weight has negative effects.
In this way, a Lua script affecting players could simultaneously fake having 9 speed, 1 speed, 9 weight, and 1 weight depending on whatever is more convenient (or less convenient, if somebody has a handicap script that sets all of their modifiers to negative values.)
Alternatively, we could bake Chaos Drives into the game itself and I could shift the burden of maintenance onto KKD. :^)