Luanti logo

IRC log for #minetest, 2024-09-12

| Channels | #minetest index | Today | | Google Search | Plaintext

All times shown according to UTC.

Enable nick filtering
Time Nick Message
25 more elements. Show/hide.
04:32 untilted How do I match the player gravity with an entity gravity
04:32 untilted I'm using set_acceleration
04:33 MTDiscord <warr1024> smells like an xy problem, seeing how player movement happens client side while entity movement is authoritative server-side and prediction may be off
04:34 MTDiscord <warr1024> if you want them to fall at the exact same rate together, you might have to do some kind of attachment
04:34 untilted Oh I'm not doing a vehicle/boat, it's just a simple walking mob
04:34 MTDiscord <warr1024> otherwise they'll likely drift out of sync just from step jank.
04:35 MTDiscord <warr1024> I think player's gravity is like y=-10 or y=-9.81 or something earth-like
04:35 untilted I'm doing -10 but it still feels very floaty
04:35 untilted I think I'm just misunderstanding how the set_velocity and set_acceleration vectors should work together
04:37 MTDiscord <warr1024> The way I understand it, you just set acceleration for gravity, and you don't have to set velocity
04:37 MTDiscord <warr1024> acceleration modifies velocity (assuming the entity isn't already standing on a surface)
04:37 MTDiscord <warr1024> like, continuously
04:38 MTDiscord <warr1024> you might set velocity if you wanted it to jump, and then let the acceleration handle the ballistic arc after that
04:39 untilted that sounds very nice
04:40 untilted i did a parabolic knockback with just set_velocity vectors lol
04:44 untilted Are player physics written in lua or in cpp?
04:44 untilted I'm comparing the get_velocity vectors of my player and the entities
04:44 MTDiscord <warr1024> All the entity physics I'm pretty sure is C++ engine-side, and involves a bunch of like network prediction and such so it wouldn't be too straightforward to do in Lua that only runs server-side.
04:45 MTDiscord <warr1024> When you get the player's velocity, it'll be delayed, and I think it might even be inferred server-side based on player position updates, i.e. you don't actually know the real instantaneous velocity that the client knows
04:45 MTDiscord <warr1024> this is why stuff like player falling damage calcs are done client-side.
04:47 untilted I see, that's not a big problem because I can still tell from this print that the player reaches about -10y velocity just before landing from a 4 block height
2 more elements. Show/hide.
05:19 untilted Ok I'm obviously doing something wrong using set_velocity to move my mobs
05:19 untilted Are we supposed to just use set_acceleration now?
05:20 untilted along with add_velocity?
05:25 untilted i feel like using set_velocity is the wrong idea, im going to need documentation
3 more elements. Show/hide.
06:14 untilted Yeah I can't use set_velocity on the same on_set callback and then expect set_acceleration to do its thing when im resetting the end velocity every call
06:14 untilted I'm going to have fun tomorrow
72 more elements. Show/hide.

| Channels | #minetest index | Today | | Google Search | Plaintext