[Suggestion] Scale Rework
- Add object fields
gravityscale
,speedscale
, andwaterscale
- Add thrust flag constants
TF_GRAVITYSCALE
,TF_SPEEDSCALE
,TF_WATERSCALE
,TF_FLIP
, andTF_RELATIVE
- Add new thrust and scale functions to facilitate scaling types
- Modify gravity, friction, and other existing forces to apply thrust based on relative gravity, speed, and water scaling. Detach from
mo->scale
- Add skin field
gravityscale
gravityscale
is essentially an object specific gravity multiplier and would double as a vertical thrust multiplier to compensate. For example, P_DoJump
, P_DoSpring
etc. would compensate for object specific gravity when determining the proper thrust height to launch the player. This would allow for objects to have flexible rising and falling speeds without their interactions with the environment becoming broken.
speedscale
is an object specific horizontal speed modifier. Notably, the impact of friction and slope momentum would be scaled according to this.
waterscale
determines the percentage amount to speed up or slow down the object whilst moving through liquids. Would be set somewhere approximating FRACUNIT * 11/20
by default for most game objects.
mo->scale
would be detached from all physics interactions, meaning that scale is responsible strictly for determining visual and hitbox sizes. This would allow for objects to be resized dynamically while respecting the integrity of their physics relative to other game objects.
Adding new thrust and scale functions would be strongly recommended to facilitate the scaling types. Said functions would use an argument for the aforementioned TF_
constants, allowing the user to specify how to scale the operation according to object-specific attributes.
Existing lua scripts will break. Because of the scope and severity of the restructuring that this would entail, the rework would need to be slated for 2.3 at the earliest.