-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provide a minetest.DEFAULT_PHYSICS
value
#14764
Comments
minetest.DEFAULT_PHYSICS
settingminetest.DEFAULT_PHYSICS
value
I'm not quite sure how I feel about making this engine responsibility. Games need not have a concept of "default physics" at all. I think usually physics overrides are best managed as "monoids": All operations performed upon them must be invertible and associative. This is implemented by mods such as this one. When you have something like minigames where you change physics, I would recommend saving the previous physics (from before entering the minigame) and simply restoring these at exit. I don't think a mod dependency is a big problem. Mods will have to depend on fundamental game mods for fundamental game features (such as this one) anyways. Though now with the addition of the I also don't think moving this inside the Minetest namespace helps much with conflicts: You can still have multiple mods trying to set these defaults and hence conflicting. |
There are default physics values, hence there is a default physics. I've seen the monoid mods but frankly I find it confusing. Also, there are a lot of them
Sure but at least I have a starting point. Mods cannot know what's a server default physics, and this parameter would help because the server could state so. Of course speed potions etc shouldn't touch such a parameter |
One way to change the defaults currently is with the movement_ settings although not sure if setting at runtime works. The physics overrides are relative to these settings |
Problem
Different mods might have to rely on what's the server default physics setting (e.g. to restore it), but there's no way to know what default is
Solutions
Provide a
minetest.DEFAULT_PHYSICS
parameter, so that:If untouched, fields should be equal to the ones inside the documentation
Alternatives
player:set_physics_override()
reset to an internal default value - but that breaks retrocompatibility and it doesn't provide the option to tweak the default value anywayAdditional context
Right now I have to declare things like this https://gitlab.com/zughy-friends-minetest/arena_lib/-/blob/master/IGNOREME/SETTINGS.lua?ref_type=heads#L9 but, since I'm working on another mod that requires exactly the same thing but it's in no way related to the first mod (and yet they must both run), you can smell the air of conflicts approaching. Also, that requires me to update the table every time a new physics override parameter is added
I'm also aware mods like https://content.minetest.net/packages/Wuzzy/playerphysics/ exist, but they can't tackle booleans such as
sneak
and we're also back again to the mod dependency just to reset physicsThe text was updated successfully, but these errors were encountered: