Luanti logo

IRC log for #luanti, 2026-02-02

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

All times shown according to UTC.

Time Nick Message
02:35 Thermoriax joined #luanti
02:36 crazylad joined #luanti
03:49 MTDiscord joined #luanti
04:42 aliasstilltaken joined #luanti
05:00 MTDiscord joined #luanti
05:37 apteryx_ joined #luanti
06:23 cmc joined #luanti
06:48 FeXoR joined #luanti
07:58 swee joined #luanti
08:37 mrcheese joined #luanti
09:57 mrkubax10 joined #luanti
10:20 jaca122 joined #luanti
10:26 mrkubax10 joined #luanti
12:01 Fleckenstein joined #luanti
12:03 LizzyFleck joined #luanti
12:27 PoochInquisitor joined #luanti
12:51 gera joined #luanti
13:41 serp3 joined #luanti
14:00 turtleman joined #luanti
14:01 user333_alt joined #luanti
14:02 user333_alt left #luanti
14:07 turtleman joined #luanti
14:52 Bombo hi can someone help me fixing a bug in a mod? this is the issue: https://github.com/ElCeejo/creatura/issues/35 lines: https://github.com/ElCeejo/creatura/blob/main/mob_meta.lua#L212 i added this: 'if vel.x ~= vel.x then vel.x = 0 end' for x y and z right before self.object:set_velocity() and it seems to not crash anymore but not sure if that made sense
14:55 Bombo adding a minetest.log shows it happens a lot that it is NaN
14:57 [MatrxMT] <Blockhead256> it's kind of a band-aid solution. It fixes a NaN after it's happened, instead of at the cause. The stack trace might be able to tell you where it came form
15:01 [MatrxMT] <Blockhead256> something's a bit suspicious about using the `and` keyword and the `or keyword` on floating point values in the first place. It's very rare in floating point to get an exact 0 figure
15:02 [MatrxMT] <Blockhead256> well, that's used because `data` might have a falsy value. That sounds like a lack of initialization problem..
15:03 Bombo yes band aid, that's why i'm asking for help here ;)
15:03 [MatrxMT] <birdlover32767> the 0 number is still true as bool?
15:04 Bombo i don't know too much about lua, still learning
15:05 [MatrxMT] <Blockhead256> `if 0.0 then print('boo') end` -> prints it. Yeah, 0.0 isn't falsy. But it seems more like it's there to guarantee init
15:08 [MatrxMT] <Blockhead256> Bombo: the original reporter didn't have any more stack trace. Do you also not have any more stack trace?
15:09 Bombo original reporter is me ;)
15:09 kamdard__ joined #luanti
15:09 [MatrxMT] <Blockhead256> oic
15:09 Bombo no thats the only stack trace
15:10 Bombo server shutting down, then these lnes show up
15:13 Bombo i can add more minetest.log to check values
15:15 [MatrxMT] <Blockhead256> how many birds in the box and how long?
15:17 Bombo i spawned 10 but it really depends, right now it happens right when i join, yesterday i had to wait 30min
15:17 MTDiscord <luatic> you need to trace the data flow back: where did the NaNs first arise? what populates self._movement_data?
15:20 [MatrxMT] <Blockhead256> an owl came and ate my testing birds
15:20 Bombo hnm if its not a number what is it, isn't there a way to find that out? or get an error msg why its a nan
15:20 Bombo happens hehe
15:22 [MatrxMT] <Blockhead256> any time you do floating point maths, there's a chance it comes out to NaN. Usually if you try to divide by zero. There's no immediate warning and no easy way to track it back to where it happened, it just turns everything it does arithmetic with into also NaNs until something handles it or crashes
15:28 Bombo there were no nans for 15mins, all the birds were eaten, then i spawned one only and it started again
15:28 Bombo now i restarted the server, 10 birds, non nans hmm
15:32 [MatrxMT] <Blockhead256> creatura/boids.lua function creatura.get_boid_dir(self)
15:33 [MatrxMT] <Blockhead256> there's a division by lift_no and at the top of the function it's initialized to 0. So there's the chance it stays that way if the ipairs() loop never runs. Don't know the odds of that
15:35 [MatrxMT] <Blockhead256> "boids" is a flock simulation that's common in programming by the way. It would be to get the songbirds to fly as a flock together
15:37 ireallyhateirc joined #luanti
15:58 bgstack15 joined #luanti
16:01 Bombo hm i get 'attempt to concatenate vert_vel (a nil value)' when i tried to minetest.log with "vertvel is: "..vert_vel or "nothing"..
16:02 Bombo shouldnt that print nothing if vert_vel is nil?
16:04 calculon looks like it needs parenthesis: "vertvel is: "..(vert_vel or "nothing")..
16:15 jaca122 joined #luanti
16:56 Bombo ah nice, well its nothing
17:16 calculon btw "if its not a number what is it" -> funnily not a number is a number :)
17:16 calculon ie it's a value with type "number"
17:17 calculon and you can check if a value is nan with if x ~= x (because nan is never equal to another nan)
18:56 qqq joined #luanti
19:03 jaca122 joined #luanti
19:05 jaca122 joined #luanti
19:42 crazylad joined #luanti
19:42 pgimeno you only get NaN for 0/0, not for other values /0, for those you get infinity
19:49 Krock how about -NaN?
19:50 pgimeno I'm not sure if Lua produces -NaN, that's indeterminate as opposed to not a number, but it's very platform-dependent
19:50 user333_ player:set_pos({x=nan, y=nan, z=nan})
19:51 pgimeno 0/0 is -nan; sqrt(-1) is nan
19:51 Krock so nan * nan = -1?
19:51 Krock unfortunately it propagates
19:51 pgimeno no :) nan * nan = nan
19:51 pgimeno yeah
19:52 user333_ nan * nil
19:55 pgimeno $ luajit  -> =0/0  -> nan
19:55 pgimeno $ lua  -> =0/0  -> -nan
19:57 pgimeno actually in puc lua, math.sqrt(-1) produces -nan in my system, but math.acos(2) produces nan
20:02 PoochInquisitor joined #luanti
20:09 mrkubax10 joined #luanti
20:52 MTDiscord <sheriff_u3> Which is generally preferred: Using an item/node full name or alias in a crafting recipe.
20:52 MTDiscord <sheriff_u3> Both work, just wanted to know if there was a standard.
20:57 chilledfrogs joined #luanti
23:34 panwolfram joined #luanti

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