space-wizards:master
← Pronana:sliding-into-your-repo-like-hey-whatup-friction-is-inconsistent-and-breaking-things
opened 02:03AM - 23 Apr 25 UTC
## About the PR
This PR is a pretty massive refactor to how friction is calcula…ted and used by mobs to lessen the disparity between the friction for a mob that can and cannot move. It also makes a lot of the values more configurable and make more sense.
This PR also uses some fixes from #35984 but makes enough changes that it's no longer a requirement.
Jetpacks for example, no longer have the bug in space with camera rotation and are no longer relay movers.
Friction is now handled by two distinct systems instead of three, and uses them hopefully consistently. Kinematic Controllers use TileFriction and SharedMoverController for friction, with the final value calculated using the Friction method from SharedMoverController. Everything else uses TileFriction and has the physics engine handle the friction.
There shouldn't be any player facing changes in regards to gamefeel ASIDE FROM THE BUGFIXES TO ANCHORED ENTITIES so if there are, some values may need to be adjusted.
Speaking of Anchored Entities, they now all play (somewhat) nicely together. Conveyors are a different story but they have their own proprietary system for impulse and friction which is layered on top of everything else so they don't bulldoze things, they just are a bit rude.
This means ice crust, puddles, and anything else will no longer have a bulldozing contest to see who's friction value gets used! You can also now use roller skates on ice (Not recommended).
Basically everything friction related has been moved to use a modifier system and rely on CVARs instead of magic numbers whenever possible.
## Why / Balance
Needed for crawling, it didn't feel good to suddenly gain 12x more friction because you stopped being stunned.
Also moving item friction over to the physics engine means we're only applying friction once which is probably a good thing.
In addition, pretty much all sources of friction were a bulldozing contest to see who could bulldoze friction either first or last, now they use modifiers like civilized variables + fixes a lot of bugs.
It's also now more consistent which system is used for applying friction and the values should have parity between each-other.
Also fixes #35655 and #36827 and some others probably.
## Technical details
Complete overhaul of how friction is applied and calculated. There was no way to do this without touching so many files.
Jetpacks now bulldoze movement mods on an entity through events rather than being a relayed mover. They function exactly the same player facing wise, except you don't lose your inputs when turning it on now.
## Media
<!-- Attach media if the PR makes ingame changes (clothing, items, features, etc).
Small fixes/refactors are exempt. Media may be used in SS14 progress reports with credit. -->
## Requirements
- [X] I have read and am following the [Pull Request and Changelog Guidelines](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html).
- [X] I have added media to this PR or it does not require an ingame showcase.
## Breaking changes
<!-- List any breaking changes, including namespaces, public class/method/field changes, prototype renames; and provide instructions for fixing them.
This will be posted in #codebase-changes. -->
- JETPACKS ARE NO LONGER RELAY MOVERS!!!
- Friction has been turned into a modifier based system and *any* values that relied on the old bulldozing system will need to be adjusted.
- CVAR tileFriction mod has been divided by 5 and all tile friction has been multiplied by 5 to get rid of magic numbers (By default tiles have a friction mod of 1 instead of 0.2)
- Movers now respect the _tileFriction and a new CVAR _airFriction with baseFriction now being a modifier to these values rather than bulldozing them
- The application of friction to items has been moved entirely to the physics engine damping system
- MobFriction is now capped by acceleration when a mover is trying to move.
**Changelog**
<!-- Add a Changelog entry to make players aware of new features or changes that could affect gameplay.
Make sure to read the guidelines and take this Changelog template out of the comment block in order for it to show up.
Changelog must have a :cl: symbol, so the bot recognizes the changes and adds them to the game's changelog. -->
:cl:
- add: Items can now slide on ice crust