Time Nick Message 00:40 ireallyhateirc and if they use only one material? 00:41 ireallyhateirc then "probably no" is the logical consequence 00:41 MTDiscord a single mesh buffer is pretty much ideal for performance 00:47 ireallyhateirc take a seat: https://files.catbox.moe/k9fe19.png 00:47 ireallyhateirc luatic, it's still one mesh, it's just not a single plane. Idk how that affects buffers 00:54 ireallyhateirc Hmmmmm I have a bug where a newly created 3D model turns black when I start breaking it 00:55 ireallyhateirc other 3D models done basically the same way are not affected 07:14 MTDiscord Since the report function in the forum seems not to work, how do I report spam threads? 10:16 [MatrxMT] bastrabun: You pm me for spam reports, I was brought on as a moderator to deal with it. But I'm always checking the new threads anyway, so I'll probably get to it within 24h usually 10:17 [MatrxMT] just took care of one, probably the one you saw earlier 10:22 [MatrxMT] make that fourm PM/matrix DM or IRC I guess.. but by the time I see a forum PM I'm already looking through the unread post list 10:31 [MatrxMT] forum pro tip for anyone who likes to read it all like me: At the top of each page there's a "Quick links" button, under that is "Unread posts" which shows you all your unread posts. 10:31 [MatrxMT] I'm not saying I've read every forum post ever. But one day I accidentally marked it all as read (there's a button on the home page for that) 10:31 [MatrxMT] and after that I now just have an unread post feed 12:30 MTDiscord <_devsh_> imagine if you could still draw all triangles in a single drawcall and cull together but was able to change the material on a per-triangle basis :mind_blown: 13:22 whosit why this code gives me " already exists in media cache" error when there 2 or more players? https://pastebin.com/XErkTmtW 13:23 whosit if I set ephemeral = false, error goes away, but, according to API, it should be possible to send same file multiple times if it's sent to different players? 13:24 whosit (use case: trying to just dymaically load temporary texture only to the people who can see it) 13:25 whosit what's more strange, if I add ~3+ second delay, I can send same texture with ephemeral=true 13:26 whosit have a full repro, just tell me where to put it, if interested :p 13:44 MTDiscord whosit: i don't see why your code would only send it to different players. you always send to all players. 13:45 whosit this is a minimal repro to trigger the error 13:45 erle luatic are you aware of the dynamic media trick where you make stuff look different for different players? 13:46 whosit I expect to be able to send it more than once with `to_player` set. What happens: it errors on second send to another player 13:46 erle luatic or where you send stuff only once it is necessary? 13:46 MTDiscord erle: i am aware of the possibility of such tricks, yes 13:46 erle also sending to all players may leak info 13:47 MTDiscord ofc 13:47 erle e.g. map data, sign text etc. 13:47 erle (i mean in-game maps a la mcl_maps and xmaps) 13:51 whosit https://github.com/minetest/minetest/blob/b63e988bd60089b5f0595442b974886c17d5e1c9/doc/lua_api.md?plain=1#L7139 13:52 whosit this says I should be able to do this, but I get 'ERROR[Server]: Server::dynamicAddMedia(): file "unique_texture.png" already exists in media cache' 13:52 whosit if I don't wait 3+ seconds between doing dynamic_add_media() 13:53 whosit (with ephemaral=true) 13:58 erle oh lol, commit d4b107e2e85d7d7a36e1b75122e4c94193b98e09 is comedy gold API design 14:00 erle whosit quick test, does it work before that commit or did it never work? 14:01 whosit hmm, I'll try 14:02 erle whosit i am asking because the code checks for ephemeral before and after, so i don't see how that would change much, but it's a recent change. 14:03 erle and i don't see any test case so maybe it broke (if it ever worked with ephemeral at all, which i am unsure about) 14:03 erle like, you see in server.cpp ephemeral is special cased there 14:04 whosit what I see is this: https://github.com/minetest/minetest/commit/d4b107e2e85d7d7a36e1b75122e4c94193b98e09#diff-d0ecb51621381529aa2b31bb04fecee4a1b1b7dc0be53978c4878f2c4d4bfe1fL3579 14:04 whosit this condition is unchanged, and it does not take into account `to_player` field 14:04 erle whosit look for the phrase “media cache” in src/server.cpp. the surrounding code explicitly does ephemeral special casing 14:04 whosit but I didn't read rest of the code :p 14:04 erle and has done since 2021 14:05 MTDiscord "Regardless of any use of ephemeral, adding media files with the same name twice is not possible/guaranteed to work. An exception to this is the use of to_player to send the same, already existent file to multiple chosen players." 14:05 whosit yes, second sentence contradicts how it actually works 14:05 erle well there are no test cases, so you can assume it does not 14:06 erle or are there? 14:06 erle (can't find any, maybe they are somewhere else where i have not looked?) 14:07 erle luatic it makes sense that same name file is not guaranteed to work for one player, but i don't see the special casing of multiple players here in the code. you see it? 14:10 MTDiscord whosit: I don't see a contradiction in the docs. The docs don't seem to be allowing your use case currently. (Sending different files to different players under the same name.) I assume this is because the server has something like a global media cache rather than a per-player media cache. 14:11 erle where do the 3 seconds come from then? 14:11 erle luatic the docs don't contradict themselves, they contradict the lived experience of whosit 14:11 erle (and, arguably, the code) 14:11 MTDiscord I don't know, maybe it's dropping things from this cache once it's sure they have arrived. This is UB either way. 14:12 erle where do you see UB? 14:12 MTDiscord not C(++) UB, luanti UB 14:12 erle oh 14:13 whosit I am _not_ seding different media to specific players under same name, I send same media with same name with `to_player` and `ephemeral=true` 14:14 erle luatic btw i have come to a new perspective regarding testing and API exploration: if someone plays an instrument, they don't always play on stage or in front of an audience, they do deliberate practice. because of this, writing tests and exploring API use cases and considering every possibility on a hobbyist level is not the “NASA style we should dot every i and cross every t” thing people think, it is merely the equivalent of practicing, but for coders. 14:15 erle this also explains why people without any formal education in programming produce vastly higher quality code when simply forced to test and explore edge cases, while people who have 10 to 20 years industry experience and get paid for such stuff fail fizz buzz (or any trivial task, really), if they don't believe in deliberate practice (mostly they say it is a waste of time) 14:15 MTDiscord whosit: you are sending the same media again to players that already have it?? 14:15 whosit no, I send it only once. 14:16 erle https://pastebin.com/XErkTmtW luatic look at the code 14:16 erle it iterates players 14:16 erle sends same to everyone 14:16 MTDiscord i looked at that code. you're saying if you invoke that once it triggers an error? 14:16 whosit yes. 14:16 erle have you tried it luatic? 14:16 erle is whosit mistaken? 14:17 whosit it will error if there are at least 2 players 14:18 erle luatic check line 3627ff of server.cpp 14:18 erle first you have 14:18 erle 3627 auto it = m_media.find(filename); 14:18 erle then you have 14:18 erle 3628 if (it != m_media.end()) { 14:19 erle etc. 14:25 MTDiscord hmm 14:25 whosit https://pastebin.com/DPAbdVAR 14:25 whosit minimal repro you can plug in and try 14:25 MTDiscord // Allow the same path to be "added" again in certain conditions if (a.ephemeral || it->second.path != filepath) { /* error */ } shouldn't it be !a.ephemeral? 14:26 whosit yes, that comment is confusing :) 14:26 whosit I tried changing that condition to allow it - and got some assertion crash later 16:08 whosit minetest-git/src/server.cpp:2772: void Server::stepPendingDynMediaCallbacks(float): Assertion `m_media.count(name)' failed. 16:10 whosit I'm not even sure what it's trying to delete (I don't use any files, I generate textures on the fly) 16:11 whosit (this is with patched server, bypassing that check) 16:37 sfan5 your example code is faulty because "default_stick.png" - being from a textures folder in a different mod - is already collected by the engine as a media file at startup 16:38 whosit it triggers same error as my actual mod though... 16:38 whosit what I'm trying to do: I have a "display" entity, that fetches it's texture via http 16:39 whosit I don't want to litter people's cache directories with textures that are used only once, so I set ephemeral=true 16:40 whosit I also don't want to spam people's connections if they're not anywhere near this display - so I do add_dynamic_media selectively 16:40 whosit I use "filedata" option and don't cache new texture on the filesystem either 16:41 whosit name of the texture is unique each time it's updated 16:42 whosit if two people are near this display when it changes pictures - only one person can get it, rest trigger the error mentioned 16:42 sfan5 if the name is unique how could this error possibly happen? 16:43 whosit it's unique frame00.png frame01.png, not player1_frame00.png player2_frame00.png 16:44 whosit because they all observe same entity, right? 16:46 sfan5 I see 16:47 whosit API says: "An exception to [not being able to send files with same name twice] is the use of to_player to send the same, already existent file to multiple chosen players." 16:47 whosit but the code only checks if name is the same 16:47 whosit and errors 16:48 sfan5 the answer is that adding identical files with the same name never works with `filedata` (or `ephemeral` for that matter) and the docs are not clear on this edge case 16:49 whosit so... my use case is impossible without filling up cache with garbage? 16:50 whosit I can't make texture names unique per player as a workaround - they observe same "display" entity, and it's texture parameter is same for everyone 16:52 sfan5 at the moment this is correct 16:52 whosit and then I don't understand what that sentence from API means at all, it's just wrong then? 16:53 sfan5 it should say "An exception to this is the use of to_player (only with ephemeral=false) to send the same, already existent file to multiple chosen players." 16:54 sfan5 and "the same" needs to be clarified to mean the same `filepath`. passing the same `filedata` twice won't work either 16:55 whosit with ephemeral=false, filedata seemed to work... I will re-check again 16:55 sfan5 anyway feel free to file a bug 16:56 whosit if I can get into github, I will X) 16:59 whosit hmm, does not look like setting ephemeral=false works... 16:59 whosit what's strange, I didn't notice the issue before I set all delays to 0 17:00 whosit so I was sending same filedata under same name to multiple people just fine - I assume because it was cleared from this cache between sends... 17:05 whosit it's a bit weird... I made a prototype according to the docs, we even tested it (with 2 players watching the thing) it worked... and now it turns out it's impossible :D 18:37 MinetestBot 02[git] 04RichardTry -> 03minetest/minetest: Typo in lua_api.md (#15440) 13946b3a4 https://github.com/minetest/minetest/commit/946b3a422272d680d5d9d9a208bb0ffedce0291f (152024-11-20T18:36:35Z) 21:33 erle can a game depend on a mod? 21:33 ROllerozxa sure, but it won't be pretty 21:34 MTDiscord You can make a mod in the game depend on a mod then make the other mods depend on that mod and cry if you ever have to modify this lol 21:34 ROllerozxa ContentDB rejects games that contain unsatisfied dependencies because the engine makes no effort to satisfy the dependency 21:35 MTDiscord You could make it optional to get around this and crash the game if a certain thing isn't there 21:35 erle i am asking because of debian 21:35 erle https://wiki.debian.org/UpstreamGuide#No_inclusion_of_third_party_code 21:35 MTDiscord Debian is very mean to us 21:35 erle haha tell 21:35 erle i was asking in #debian-games on OFTC about packaging one of the bigger games 21:36 erle and was told well, vendored copies … 21:36 ROllerozxa haha 21:36 ROllerozxa anyways exile did this with naturalslopeslib a long long time ago leading to the game booting up to a broken mess out of the box with little information for players that you need to manually install and enable an external mod for each world 21:36 ROllerozxa it ended up being resolved by adding the mod as a submodule to the game. which is what you usually should do when wanting to add third party mods into your game 21:37 erle ROllerozxa well subtree also exists and is less hassle IMO for this kind of thing, but yeah 21:39 MTDiscord How we put substree in the dependency class 21:40 erle it's a git thing 21:42 MTDiscord That sounds like an implementation detail for the game developer and it's their fault if they don't do this 21:43 MTDiscord But, then again, they can also just dump the folder into the game 21:45 erle jordan4ibanez, yes i hate it 21:46 MTDiscord Git is a cruel mistress 23:09 MTDiscord debians packaging of minetest/luanti games/mods is are worth avoiding 23:15 ireallyhateirc is it possible to add an offset to nodes? 23:16 ireallyhateirc I'd like to add different offset to different instances of the same node 23:16 MTDiscord would have to use a custom model, but sure 23:16 MTDiscord then no 23:16 MTDiscord you would need different node defs for each offset 23:17 ireallyhateirc but the offset can be defined in nodedef or only in the 3D model? 23:18 [MatrxMT] <🇬regon> It can only be random, but see my mod that adds that 23:18 MTDiscord only in 3d model iirc, dont quote me on that its not possible with normal node 23:19 [MatrxMT] <🇬regon> https://content.luanti.org/packages/Gregon/mcl_random_plant_positions/ 23:19 ireallyhateirc 🇬regon, link? 23:19 ireallyhateirc ah thanks 23:20 MTDiscord meshoptions only works with plantlife, so not applicable to normal nodes 23:22 ireallyhateirc ok so my options are: 1. doing several meshes with different offset manually or by writing a script 2. making a feature request for param2 type "offset" or something like that 23:22 ireallyhateirc the use case is a table with nonstandard height 23:23 ireallyhateirc I'd like to still be able to place items on it