Minetest logo

IRC log for #minetest, 2021-05-11

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

All times shown according to UTC.

Time Nick Message
00:00 specing_ joined #minetest
01:56 est31 joined #minetest
02:10 MTDiscord <exe_virus> Oh that was a different testing I promised to Xenith, my bad. What do you want me to benchmark for you? I could show you my lua processing times for boxgen, it's very compute intensive and will demo the differences starkly haha
02:10 MTDiscord <exe_virus> I can show luaJIT vs PUClua5.1 vs luaJIT with JIT off, and lua 5.4 if desired
02:11 MTDiscord <Jonathon> see ping in #modding
02:12 MTDiscord <exe_virus> kk, I'm caught up, Give me a bit here to get that typed up
02:12 MTDiscord <Jonathon> ty
02:27 MTDiscord <exe_virus> Here's my test program I'm using so far. It's bad because os.time() is only accurate to seconds, does provide some info though:  lua a = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"}  local time = os.time() b = {} c = 0 for i=0, 5000000, 1 do     for i, v in pairs(a) do       b[i] = v     end end print("Pairs executed in " .. os.time()-time .. " seconds.") time = os.time() for i=0, 5000000, 1 do     for
02:27 MTDiscord i, v in ipairs(a) do       b[i] = v     end end print("IPairs executed in " .. os.time()-time .. " seconds.") time = os.time() for i=0, 5000000, 1 do     for i=1, #a, 1 do       b[i] = a[i]     end end print("Indexing executed in " .. os.time()-time .. " seconds.")
02:38 MTDiscord <exe_virus> For PUClua 5.1, That resulted in: 2 seconds for pairs() 4 seconds for ipairs() 2  seconds for indexing()  For luaJIT that resulted in: 0 seconds for all....  So I took the for-loop max variable size and increased it by a factor of ten for each, resulting in: 1 seconds for ipairs() 5-6 seconds on average for pairs() 1 seconds for indexing.  I am testing luaJIT again to compare indexing to ipairs better now
02:40 MTDiscord <exe_virus> Scaling up another factor of ten, indexing was 12 seconds and ipairs was 12 seconds, but realize my method of access is probably less than ideal using indexing. Often indexing is fastest on luaJIT. roughly 5-10% gains in my experience.  Now for PUClua 5.4
02:40 MTDiscord <exe_virus> and luaJIT in interperter only mode
02:52 MTDiscord <exe_virus> For luaJIT in interpreter only mode with the same setup as PUClua 5.1, I got: Pairs(): 0 seconds
02:52 MTDiscord <exe_virus> IPairs executed in 1 seconds. Indexing executed in 0 seconds.
02:53 MTDiscord <exe_virus> so much faster than PUC lua in all regards, same relative relationships
02:56 MTDiscord <exe_virus> Finally, results from PUClua 5.4: Pairs executed in 2 seconds. IPairs executed in 2 seconds. Indexing executed in 1 seconds.
02:57 MTDiscord <exe_virus> @wsor, user of things  Based on my tests, yeah luaJIT still kicks butt in either interpreted mode or JIT mode. Pairs is better for interpreters for speed, but you also don't have nicely sorted output.
02:57 MTDiscord <exe_virus> It also shows that indexing is likely better on PUC lua in general
02:58 MTDiscord <Jonathon> thank you
03:00 Surfer2011_ joined #minetest
03:36 nuala2 joined #minetest
03:43 PjotrOrial joined #minetest
03:43 PjotrOrial joined #minetest
04:00 MTDiscord joined #minetest
05:10 delta23 joined #minetest
05:20 proller joined #minetest
05:43 Flabb joined #minetest
05:46 illwieckz joined #minetest
06:42 MiniontobyPI hey
07:42 hlqkj joined #minetest
08:00 ShadowNinja joined #minetest
08:11 MiniontobyPI hey
08:17 MiniontobyPI how to resize a picture for a hud image
08:21 Lunatrius joined #minetest
08:21 MiniontobyPI like this
08:21 MiniontobyPI [combine:8x8:-8,-8=character.png
08:21 MiniontobyPI how to do this for an hud image
08:23 hlqkj_ joined #minetest
08:31 FeXoR joined #minetest
08:38 calcul0n joined #minetest
08:43 Taoki joined #minetest
08:53 MiniontobyPI can someone help me?
09:12 SwissalpS joined #minetest
09:30 Fixer joined #minetest
09:50 entuland joined #minetest
09:54 proller joined #minetest
10:11 entuland MiniontobyPI: reading the API seems like there are fields you can pass to decide the scale, there shouldn't be any need to use those image filters
10:11 MiniontobyPI hmmm
10:11 MiniontobyPI sad
10:12 entuland why sad? doesn't matter how you achieve it, the point is achieving it, no?
10:16 MiniontobyPI idk how
10:31 whosit found a cause for some broken recipies in mods: empty fields in recipies (now?) are treated same as skipping them?
10:31 whosit so {"mymod:diamond_fragments", "", ""}, is equivalent to {"mymod:diamond_fragments"}
10:32 whosit but modding book says that empty fields must also be matched for recipie to work
10:32 whosit this breakes recipies like this:
10:32 whosit https://github.com/runsy/jonez/blob/master/init.lua#L277
10:33 whosit for palace_window_top and palace_window_bottom
10:33 whosit since "" are just thrown away, those recipies are conflicting
10:33 whosit when this change has happened? is it a bug?
10:53 riff-IRC joined #minetest
11:09 basxto joined #minetest
11:13 MTDiscord <entuland> there is a ton of such recipes leveraging on partial use of the crafting grid, if those empty strings were ignored, lots of default minetest recipes would either stop working or work in different ways
11:13 MTDiscord <entuland> say, the simple torch
11:13 MTDiscord <entuland> are you sure that is the exact spot of the problem?
11:18 whosit sorry, it's hard to explain it clearly, but I will try :)
11:20 MTDiscord <entuland> uhm... maybe the torch wouldn't be affected in that case, gotta check the source
11:20 whosit there are "shaped" recipies, and modding book says that you can either specify empty slots in them (with empty strings "") or leave them out. And recipie matching behaviour will be different
11:20 whosit if you leave them out - the recipie should be movable around the grid
11:21 whosit if you specify empty strings, for example around torch, then it will match only placed in the center of the grid
11:21 whosit that's how Modding Book says it should work
11:22 whosit and I found some recipies (like jonez mod) that depend on this behavior of "matching empty strings"
11:22 whosit but, currently, that does not work in the engine
11:22 whosit and {"mymod:diamond_fragments", "", ""}, is equivalent to {"mymod:diamond_fragments"}
11:23 MTDiscord <entuland> yes, I get the point, I'll try to repro it
11:23 whosit so, book says: first will match only in the left slot of the grid, and second recipie you can move around the grid
11:33 MTDiscord <entuland> I can confirm that no matter the emtpy strings, 5.4.1 allows for moving the items around the crafting grid as if they weren't there
11:34 MTDiscord <entuland> can't tell if it's a bug or if it's an intended change of behavior and the book hasn't been updated to match the change
11:37 entuland joined #minetest
11:51 MTDiscord <entuland> I'm no expert in the core engine code but my understanding is that the way recipes are checked hasn't changed in a few years, I'm afraid you'll need to get the attention of more knowledgeable people around
11:52 whosit should I ask about this in #minetest-dev?
11:53 MTDiscord <entuland> I think it fits there, yes
11:53 whosit ok, thank you
11:53 MTDiscord <entuland> yw
11:54 tech_exorcist joined #minetest
12:01 specing_ joined #minetest
12:01 tech_exorcist joined #minetest
12:13 Verticen joined #minetest
12:15 kamdard joined #minetest
12:28 ghoti joined #minetest
12:28 proller joined #minetest
12:42 ghoti_ joined #minetest
13:06 Bombo anyone got the draconis mod? there is a book called 'Bestiary' but i can't read it, can't place it anywhere
13:21 Thomas-S joined #minetest
13:21 Thomas-S joined #minetest
13:26 MTDiscord <wwar> @ElCeejus, Synthwave Warlord ^
13:34 olliy_ joined #minetest
13:35 bingfengzs joined #minetest
13:52 craigger joined #minetest
14:15 Taoki joined #minetest
14:15 hlqkj joined #minetest
15:16 Hawk777 joined #minetest
15:28 absurb joined #minetest
15:29 big_caballito joined #minetest
16:01 Fixer joined #minetest
16:15 olliy_ joined #minetest
16:16 FeXoR joined #minetest
16:19 delta23 joined #minetest
16:20 AntumDeluge Bombo, on ContentDB it says "Most other info you may need to know is detailed in the Bestiary". But I don't know how to use it either. Maybe its a work-in-progress.
16:27 AntumDeluge There is a bug in the code. I'm looking at it now.
16:34 AntumDeluge Oh, I think it might not be a bug...
16:36 AntumDeluge It has something to do with the "draconis:lectern" node. It looks like you have to use it to fill out the bestiary.
16:41 Verticen joined #minetest
16:52 fizi joined #minetest
16:56 specing joined #minetest
17:08 Talkless joined #minetest
17:09 Dyedefra joined #minetest
17:11 erlehmann joined #minetest
17:13 proller joined #minetest
17:26 proller joined #minetest
17:40 tech_exorcist joined #minetest
17:42 MTDiscord <appguru> @ElCeejus, Synthwave Warlord
18:01 Dyedefra left #minetest
18:02 Peppy joined #minetest
18:29 Bombo AntumDeluge: hm i tried it, i put the bestiary in the lectern, looks good, but still no text
18:30 Bombo hm there are two slots in the lectern
18:50 ghoti_ joined #minetest
18:52 AntumDeluge Bombo, the other slot is for "draconis:manuscript". But I still don't know how it works.
19:02 Bombo AntumDeluge: yes i saw that too, and i put the manuscript there, nothing happens
19:16 MinetestBot [git] sfan5 -> minetest/minetest: Fix swapped vertex colors on GLES2 69c70dd https://git.io/JsJfe (2021-05-11T19:15:39Z)
19:16 MinetestBot [git] SmallJoker -> minetest/minetest_game: Attachments: Proper data cleanup in callbacks (#2865) 71ea0c6 https://git.io/JsJfv (2021-05-11T19:15:47Z)
19:25 AntumDeluge I have a problem with formspec security. I have created a shops mod ( https://forum.minetest.net/viewtopic.php?t=26645 ). The problem is that the formspec is associated with node meta. So if a second player interacts with the formspec, it affects the transaction of the first player. I'm using node meta to set formspec because I need the "allow_metadata_inventory_put" functionality....
19:27 AntumDeluge I've thought about trying to suppress showing a formspec if it is already in use by another player, but I'm not sure if that is possible with using node meta data...
19:27 AntumDeluge I also came across the ActiveFormspecs mod ( https://forum.minetest.net/viewtopic.php?t=19303 ), which looks like it could be a solution if it does what I think it does...
19:28 AntumDeluge But I wanted to know if someone knows something I don't about securing formspecs.
19:28 AntumDeluge If I can avoid depending on another mod, I'd probably rather do that.
19:35 AntumDeluge Is there a way to retrieve a formspec instance & store it an a variable/table?
19:35 sfan5 formspecs do not have instances
19:35 sfan5 you use a node's inventory in a formspec completely disconnected to the node
19:35 sfan5 though this would still mean multiple players can't put items at the same time
19:36 AntumDeluge Isn't there a Lua or C++ object that is created when a formspec is shown?
19:36 sfan5 Lua certainly not, C++ probably; but it's all on the client
19:37 AntumDeluge So, no wait to retrieve & manipulate that.
19:37 AntumDeluge *way
19:38 Andrew__ joined #minetest
19:38 sfan5 if you want to control what gets shown to who use minetest.show_formspec()
19:38 sfan5 (obviously)
19:39 AntumDeluge Yes, but as I understand it, I won't be able to retrieve the "allow_metadata_inventory_put" callback.
19:40 AntumDeluge Or am I mistaken about that?
19:41 sfan5 the callback happens on the node
19:41 sfan5 you can tell the formspec to show the node inventory and it'll function like usual
19:42 AntumDeluge Oh, I see. Thanks sfan5. I'll explore that.
19:44 AntumDeluge "though this would still mean multiple players can't put items at the same time" Actually, I don't think that will be a problem for me as the inventory itself doesn't actually hold anything. It is simply used to drag items onto to invoke the "allow_metadata_inventory_put" callback.
19:45 AntumDeluge However, I do store a value in the nodes metadata that is important. But that should be easy to get around by using a key with the player's name.
19:54 AntumDeluge Does it make a difference whether "meta:get_inventory():set_size()" is called in "on_construct" or "after_place_node"?
19:59 tech_exorcist joined #minetest
20:05 entuland joined #minetest
20:13 FeXoR joined #minetest
20:13 TomTom joined #minetest
20:13 n_to joined #minetest
20:13 Fusl joined #minetest
20:13 [m]testman joined #minetest
20:13 Noclip joined #minetest
20:13 z812 joined #minetest
20:13 Quiark joined #minetest
20:14 Fusl joined #minetest
20:33 proller joined #minetest
20:34 AntumDeluge Bombo, I got a response about the bestiary: https://github.com/ElCeejo/draconis/issues/9
20:38 Noclip joined #minetest
20:38 z812 joined #minetest
20:41 rschulman joined #minetest
20:42 FrostRanger[m] joined #minetest
20:42 Quiark joined #minetest
20:42 freshreplicant[m joined #minetest
20:50 _Zaizen_[m] joined #minetest
21:08 IceDragon joined #minetest
21:10 wsor4035 joined #minetest
21:10 LoneWolfHT joined #minetest
21:11 kb1000 joined #minetest
21:12 moreavy[m] joined #minetest
21:12 Panquesito7 joined #minetest
21:17 est31 joined #minetest
21:17 entuland_ joined #minetest
21:23 [m]testman joined #minetest
21:24 freshreplicant[m joined #minetest
21:26 Verticen joined #minetest
21:27 rschulman joined #minetest
21:28 Noclip joined #minetest
21:29 Quiark joined #minetest
21:30 z812 joined #minetest
21:38 _Zaizen_[m] joined #minetest
21:38 proller joined #minetest
21:42 calcul0n_ joined #minetest
21:45 Kray joined #minetest
22:03 delta23 joined #minetest
22:09 illwieckz joined #minetest
22:21 Fixer joined #minetest
22:24 est31 joined #minetest
22:25 Fixer_ joined #minetest
22:36 Verticen joined #minetest
23:05 v32itas joined #minetest
23:13 Verticen joined #minetest
23:35 beanzilla Hi all, I would like to know how to do a goto within my mod. (I keep getting a `'=' expected near 'skip'`, My paste is https://pastebin.com/y4SvDMbY)
23:37 entuland your code seems malformed to begin with
23:37 MTDiscord <Jonathon> Don't use goto unless you know everyone that uses your mod will use luajit
23:37 entuland you were missing a doublequote before the steel definition
23:38 entuland and yes, please try and avoid that goto, you don't need it there for sure
23:38 entuland this is a better spot to post your code for the future as well: https://ideone.com/w4lg6E
23:39 entuland as you can run it there and verify if it's okay (assuming it doesn't contain any call to minetest-specific stuff or the alike)
23:40 beanzilla So I guess really to not use the goto I'd need too do ... https://ideone.com/P8qlfz
23:41 entuland yeah that may work, or use the inequality operator, really matter of tastes there likely
23:42 beanzilla Anyway, thank you Jonathon and entuland for the help.
23:42 entuland yw
23:44 AntumDeluge Is there no way to catch "put" & "take" events in the player inventory?
23:48 AntumDeluge Oh, maybe I don't need to do that. I misunderstood something sfan5 said.
23:48 MTDiscord <entuland> uhm... isn't that just a formspec like any other which you can intercept with on_player_receive_fields?
23:49 MTDiscord <GreenXenith> Put/take doesnt seem to be a field
23:49 AntumDeluge on_player_recieve_fields works for buttons & other fields. But not for put/take for "list".
23:50 MTDiscord <entuland> oh okay
23:50 MTDiscord <GreenXenith> Seems like an oversight
23:51 AntumDeluge I think I actually want a "detached" inventory, not "player". But I think I still end up with the same problem.
23:51 MTDiscord <GreenXenith> Ah, minetest.register_on_player_inventory_action
23:51 AntumDeluge Oh, nice. Thank you GreenXenith.
23:51 entuland that sounds promising indeed by the name :P
23:51 MTDiscord <GreenXenith> Knew there had to be something :]
23:52 MTDiscord <GreenXenith> No idea if it will work for detached inventories
23:52 entuland there always is a way (tm)
23:52 entuland sometimes it involves threatening with a large mallet, but hey
23:52 MTDiscord <GreenXenith> Detached inventories actually have their own callbacks
23:53 MTDiscord <GreenXenith> defined when registering them
23:54 AntumDeluge I'm guessing detached is what I want to use, as sfan5 said.

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