Time Nick Message 01:29 fluxionary today, i discovered lua coroutines. i love them in python, but i'm unsure about whether i want to use coroutines in mods. i've never seen them in mod code i've contributed to (noting that a search shows they're in techage, techpack, lwcomputers, and modlib). 01:30 fluxionary they *absolutely* make an iterator i'm working on much saner though, if you understand what you're looking at. 01:36 fluxionary the application is an attempt to make `minetest.get_objects_in_area` faster 02:10 muurkha in Lua (and Squirrel) they're more flexible than Python generators; they have stacks 03:05 fluxionary i agree, they're more powerful than python generators, but python also has equivalent coroutines 03:06 fluxionary (coroutines equivalent to what lua has) 04:20 muurkha well, Python has threads, which you can make equivalent to Lua coroutines by adding a single lock to your program so they can't ever preempt each other 04:21 muurkha but possibly you are incorrectly thinking async and await in Python is equivalent to Lua coroutines; they aren't and you can't simulate Lua coroutines with them 04:21 muurkha and Python threads are OS threads, so they're orders of magnitude less efficient than Lua coroutines 04:22 lissobone Hi. 04:24 lissobone I've finished the checkpoint mod, but I want to know your opinion: when I use the ret pad and teleport back, the velocity with which the player was moving prior teleportation remains. Would it be wiser to limit the freedom of movement and set player velocity to (0, 0, 0)? 04:25 lissobone Basically, if you were falling and teleported back, you might take fall damage. 04:25 lissobone Leaving this opens up some room for tricks and hacks. 04:33 lissobone I'll just add 2 types of checkpoints: one that keeps velocity and one that doesn't. 04:38 Blockhead256[m] lissobone: it's probably for the best to set an exact point and 0 velocity (or pre-defined, if you must, though with lag that might be bad) to restore the player to. Otherwise the player risks getting stuck in a loop. 04:44 lissobone Hmm, alright. 04:45 lissobone I limited the pad use range to 2.7 so the player would have to stand pretty close to it, thus reducing the chance of randomly falling anywhere. 05:44 lissobone Players, unfortunately, do not support set_velocity, but I hacked my way to winage and remembered how I studied math at school: x - (x + x) equals -x, and adding -x to x (negative velocity plus regular velocity) yields 0 ({x = 0, y = 0, z = 0}). 05:47 lissobone Here's how to make use of it: 'local vel = player:get_velocity() player:add_velocity(vector.subtract(vel, vector.add(vel, vel)))' 06:49 whosit lissobone: that is equivalent to: vector.add(vel, vector.multiply(vel, -1)) 06:50 lissobone Well, that's also true. I had the multiply way in mind, but instead I wanted to subtract the double of the vector from itself. 06:52 whosit just saying :) 06:53 lissobone And your way yields a null vector, I believe: vel + -vel = 0. 06:54 whosit hm? 06:54 whosit that wasn't the point? to zero out the speed? 06:56 lissobone Players don't support set_velocity, only add_velocity. 06:57 whosit you mean player:add_velocity(vector.multiply(player:get_velocity(), -1)) ? 06:58 lissobone Yes, that. But the documentation page said something about deprecation, maybe I read it wrongly (?). 07:02 whosit I found only this: https://github.com/minetest/minetest/blob/1b95998d11fb0d51fbfeedc56de4ca2191ad3f7a/doc/lua_api.txt#L7261 07:06 whosit was just saying you can do same thing with less steps, which does not matter in this case, except may be less confusing (at least to me) 09:09 lissobone I have released the checkpoint mod, but -- oops! -- forgot to add the license notice. 09:15 MTDiscord fluxionary: making iterators more convenient is a typical use case of coroutines, go right ahead :) 09:15 MTDiscord in fact the usage of coroutines in modlib is due to iterator utils 09:22 lissobone Final question. 09:24 lissobone When a player punches the checkpoint, it blinks with green for approximately 1/√2 (0.717) seconds, then turns red again. Would it be appropriate to set the checkpoint position metadata only after the green period? This opens up room for some cool tricks. 09:24 lissobone Why am I even asking? 09:28 lissobone I only wonder how to change anything in the inventory inside a minetest.after() clause. 09:29 sfan5 @luatic the patch you provided for spiraling-down seems to incomplete, I don't see a single call to register_mapgen_dofile 09:29 sfan5 +be 09:30 MTDiscord let me check 09:32 sfan5 even better when you have the changes just push them to a branch 09:32 MTDiscord ah yeah, I had an uncommitted file that didn't make it into the diff 10:01 MTDiscord sfan5: here you go: https://github.com/spiraling-down/game/tree/mapgen-threads (got sidetracked while compiling https://xkcd.com/303/) 10:01 MTDiscord thank you very much for your work, it makes SD almost playable now that the main thread isn't constantly blocked :) 10:06 lissobone Almost playable? 10:09 sfan5 fyi you can import files even from the mapgen env, so the sd_map:stuff hack might not be necessary 10:11 MTDiscord lissobone: there's still quite some optimization to be done even if mapgen doesn't block the main thread anymore 12:05 sfan5 @luatic I can't reproduce the error messages you meant 12:06 sfan5 plus: I spawned inside a node, this text is overlapping: https://0x0.st/HT1p.png, the window with the story didn't disappear automatically 12:06 sfan5 and the music is quite loud 12:08 sfan5 and there's z-fighting on sd_map:deco_pebbles_basalt_1 12:09 sfan5 respawning drops me far in the sky 12:09 sfan5 also z-fighting on snow somehow 12:10 sfan5 plus it's hard to keep track of the information I get dumped on me in the beginning 12:10 sfan5 at least a "show item name when hotbar selection changes" thing would be nice 15:20 MTDiscord sfan5: It currently doesn't error for me either. This was a while ago, you've probably fixed the underlying cause since then. 15:20 sfan5 I don't think I have but 🤷 18:33 Wuzzy do i have access to moveresult to players, too? 18:33 Wuzzy because I want to look at touching_ground (which tells me if an entity is touching the ground) 18:34 sfan5 nope 18:34 Wuzzy Someone reported a strange bug for my game. Apparently the player Y velocity isn't reliably 0 anymore when the FPS is high, like 165. https://codeberg.org/Wuzzy/Glitch/pulls/35 18:35 Wuzzy i suppose looking at the player Y velocity to check if im touching the ground isnt a great idea, right? :D 18:36 sfan5 that's an engine bug, probably 18:37 sfan5 similar to this https://github.com/minetest/minetest/issues/10962 18:40 Krock the movement is really jerky with 800 FPS according to my tests 18:41 Wuzzy any tips on how to check "this player is standing on the ground?" 18:42 Krock pos.Y - 0.1 18:43 Wuzzy not precise for me. if the player moves vertically, thats not "standing". seems like i kinda am forced to test vertical vel but it goes weird at high FPS 18:46 Krock when they're moving vertically they have no solid ground under their feet position, neither if the speed is positive 18:47 Krock it could be that the collision detection does not exactly set the player at the node's surface, resulting in slightly nonzero downwards velocities. these however should still be <0.1 in absolute value 18:50 Wuzzy funny you say this because 0.1 is exactly the value suggested to me by the PR author :D 18:51 Wuzzy it still feels off the vel Y value wiggles around 0 instead of staying exactly 0. 18:52 Wuzzy but yeah the issue in my game seems to be i set the current threshold to 0.001 instead of 0.1 so maybe it was just too low. 19:13 zuffnick wo gibts die besten mods? 19:13 Krock bei Marcel D'Avis von 1&1 19:13 zuffnick :) 19:14 zuffnick oder bei obi? 19:14 Krock #minetest-de ist übrigend wür deutschsprachige Diskussionen. hier nur auf English. 20:25 uyku Desour: sup 20:25 Desour hi 20:26 uyku Desour: send another msg, am testing something 20:26 Desour ok 20:26 uyku Yass, it works 20:27 uyku Are you playing today? 20:27 Desour maybe 20:52 MinetestBot 02[git] 04numberZero -> 03minetest/minetest: Cull liquid back face on liquid-glasslike interface (#13594) 13f1feeb3 https://github.com/minetest/minetest/commit/f1feeb319c0a64ee18fb8b29571d5540c084e12c (152023-06-18T20:52:14Z) 23:22 Guest20 is there an sdl2 build of minetest for windows? many mouse issues in the non-sdl2 version of it 23:22 Guest20 seemed like sdl2 might fix it but i can't find builds 23:25 Desour Guest20: yes 23:25 Desour build with -DUSE_SDL2=1 23:25 Guest20 no i mean ready builds 23:25 Guest20 i tried to do it myself but idk how to use all this stuff 23:26 Desour no 23:26 Guest20 will it switch to sdl2 in the next release at least? 23:27 Desour possibly 23:27 Guest20 heres hoping then 23:27 Guest20 thanks for the helpe 23:27 Guest20 *help 23:27 Desour !next 23:27 MinetestBot Another satisfied customer. Next!