Time Nick Message 03:26 hephaestus hello, I already had a problem with apples that not decaying when you dig all trunks, but I dont remember why? I'm using lumberjack but in another server it not a problem 03:26 hephaestus oh and I have techpack too 03:36 MTDiscord This is quite a condensed problem 03:36 MTDiscord A focused one, which mod provided apple trees? 15:44 ireallyhateirc is there something like minetest.register_on_generated but for mapchunks that have already been generated? 15:50 ireallyhateirc like minetest.on_emerge that would get called every time a chunk finishes being generated and/or is loaded from disk 15:59 sfan5 there is no generic load block callback, no 16:01 MTDiscord You'd have to register an LBM for every node type, and then waste 1023 of the 1024 callbacks you get each mapblock. 16:02 sfan5 i think you mean 4095/4096 16:03 ireallyhateirc what I do currently is running a loop that scans mapchunks around the player and checks if they're loaded 16:04 ireallyhateirc and then I get a VM for that chunk 16:04 ireallyhateirc also LBMs are cringe 16:04 sfan5 what is your use case? 16:05 ireallyhateirc My mod gets generated mapchunks and generally speaking changes stuff in them using a VM 16:06 ireallyhateirc one example is changing seasonal soil in Exile 16:06 ireallyhateirc I also wrote a snow placer using the mod that is fast and works outside of the active area that ABMs operate on 16:07 ireallyhateirc so: get mapchunks around the player -> get metadata (the chunk has winter soil, snow) -> modify the chunk based on some external trigger (it's summer, we want to remove snow) 16:09 MTDiscord So you're reinventing ABMs. Cool. 16:09 ireallyhateirc ABMs were too slow and didn't work well 16:10 MTDiscord Lol, yeah, ABMs are always slower than reimplementing ABMs until the reimplementation is actually complete. 16:10 MTDiscord The only reliable way I've found to find mapblocks around a player is just to check something like get_node_or_nil for one node inside the mapblock. 16:11 MTDiscord You also have to make certain assumptions about what mapblocks could be loaded, e.g. that the only ones you care about will form contiguous bubbles around players or something. 16:12 ireallyhateirc I assign labels to the chunks and store that in mod storage 16:12 ireallyhateirc so during mapgen I add "has_trees", "has_ocean", etc. 16:12 ireallyhateirc and then the mod only modifies the chunks of interest 16:13 ireallyhateirc AFAIK checking a label per chunk is faster than whatever ABMs do 16:14 MTDiscord Congrats, you reinvented ABM caching too. That kind of thing is not obvious at first. 16:15 MTDiscord IIRC there's a PR or issue or something to add block-level ABMs (we should call them ANMs just to be consistently wrong); that's what the engine needs to make this sort of thing actually fast at scale... 16:17 ireallyhateirc still unimpressed 16:18 ireallyhateirc I wouldn't try to reinvent the wheel if it worked as it should 16:19 ireallyhateirc ABMs can't be turned off and that's their main con 16:20 ireallyhateirc my thing works only if it needs to 16:20 MTDiscord Yeah, it's not easy to impress people when we've been around the track a few times. I've seen a lot of people get excited about a promising approach that's working really well so far, only to find out that the last little bit needed to get to an actually complete working solution is where things suddenly end up worse than the original. 16:21 MTDiscord Sometimes things can actually be improved upon but there are often reasons why the original is the way it is, and unless you're working on a very narrow specific case, when you try to reinvent an API, you often either run into those, or you make something that's fast but buggy or unreliable. 16:22 MTDiscord If you do come up with a better way of approaching ABMs than the existing implementation, then we should definitely consider updating or expanding the existing ABM implementation in the engine to support that approach. 16:22 Mantar warr: check out seasonal changes in Exile's v4 branch sometime 16:23 MTDiscord what should I be comparing it to? 16:23 Mantar (we haven't released it to CDB yet as we've got a few things that aren't ready for primetime) 16:23 Mantar whatever you like, I'm not aware of any MT game that's done seasons on this scale before 16:24 Mantar oceans freeze out to the horizon, leaves vanish from trees, soils change, plants die 16:25 MTDiscord Ah, okay, I thought this was a "we did it faster than anybody else" kind of thing. That's kind of tautological if there are no comparisons. 16:26 ireallyhateirc warr1024, I really tried to use ABMs for that stuff but it was slow and we constantly got warnings about ABMs failing to process mapblocks 16:26 ireallyhateirc my mods uses VMs to process entire chunks 16:26 Mantar other mods have done "seasons" but they don't reach our scale because, as ihirc says, abms limit it in several ways 16:27 MTDiscord What kind of "slow" are we talking about? Like huge lag spikes, or like the season changes taking too long to reach certain mapblocks? 16:27 MTDiscord It's pretty well known that the ABM scheduler is shit. 16:27 ireallyhateirc both 16:27 Mantar yeah 16:27 MTDiscord A better scheduler could get about 5x the performance on default configuration 16:27 Mantar lag is a major problem, but so is the short range 16:27 MTDiscord The problem is that that's just a single fixed one-time speedup. 16:28 Mantar the shepherd beats abms on both counts 16:28 ireallyhateirc (my mod that is) 16:28 Mantar and it still has room for improvement IMO 16:28 Mantar afk 16:29 MTDiscord In my case, I've been looking for a general-purpose API to replace ABMs 16:30 MTDiscord I've found some things, but they all require ABMs too so far 😆 16:31 ireallyhateirc my mod is poorly documented for now, so I haven't released it on ContentDB yet 16:32 MTDiscord Is it exile-specific or does it work for other games? 16:32 MTDiscord Also, what kind of licensing? 16:32 ireallyhateirc GPLv3 and is not exile-specific 16:33 MTDiscord Ah, okay. 16:33 ireallyhateirc I could consider relicensing if you're interested in my spaghetti code 16:34 MTDiscord If it actually works for my use-case, and it were MIT, then I might be able to use it. 16:34 ireallyhateirc well, I can always do dual-licensing 16:35 ireallyhateirc implementation of seasonal changes using the mod is here: https://codeberg.org/Mantar/Exile/src/branch/v4/mods/nodes_nature/seasons.lua 16:35 ireallyhateirc and the mod is here: https://codeberg.org/Mantar/Exile/src/branch/v4/mods/mapchunk_shepherd 16:36 ireallyhateirc Though the code is a huge mess for now and I'm going to clean it up later 16:36 MTDiscord "mapchunk shepherd" ... does it operate on blocks or chunks? 16:37 ireallyhateirc chunks 16:37 MTDiscord oh weird 16:37 ireallyhateirc would loading blocks in the VM be any faster? 16:38 MTDiscord I don't know, since I don't know how the mod works 16:38 MTDiscord usually I check for block-level loading, since there's no guarantee that block loading or unloading actually happens at chunk boundaries 16:39 ireallyhateirc For simple tasks it can process a chunk in 10ms IIRC 16:39 MTDiscord as far as I've heard, chunks are only used at mapgen time. 16:40 MTDiscord I think the last time I messed around with chunk-level stuff was trying to fit the levels in Klots into the fewest chunks I could. Chunk alignment is a bit weird because the 0,0,0 block is actually in the center of the central chunk, not the corner as I had expected. 16:41 MTDiscord counterintuitive since blocks are aligned the way you'd expect, and the 0,0,0 node IS in the corner of the 0,0,0 block 16:41 MTDiscord Handling partially-loaded chunks sounds like it could be complicated 16:41 ireallyhateirc well, another weird thing is that the grid starts at xyz = -32 16:42 ireallyhateirc just so Sam can spawn in the middle of the mapchunk rather than in the corner 16:43 MTDiscord I think that's by design. It seems like they wanted to be able to just generate a single chunk and load all the terrain close to the player. If they were corner-aligned instead of center-aligned then they'd have to generate 8 chunks to be able to show terrain in all direections 16:44 ireallyhateirc why not for example spawn the player at xyz +32 instead of xyz 0 ? 16:44 MTDiscord Processing every node in a chunk sounds like a lot of work though. You'd need to defer callbacks into a queue and run a scheduler to avoid them triggering a ton of lag. Either that, or you'd be stuck doing only like contentid->contentid stateless transformations, couldn't access metadata, and couldn't even run very much logic in the callbacks. 16:44 ireallyhateirc it would probably do the same thing without making grid coordinates weird 16:44 ireallyhateirc I have a queue and a scheduler 16:45 MTDiscord tbh they probably just didn't think of it at the time 16:45 MTDiscord it's not automatically obvious that making grid coordinates weird would have far-reaching consequences 16:49 ireallyhateirc sometime this summer I'm going to improve handling of edge cases, possibly add asynch support and write a proper documentation for the mod 16:50 MTDiscord It looks sort of like it solves a problem that's adjacent to but not overlapping the ones I have in any of my games, but I'll have to see how it progresses. 16:50 MTDiscord In my case, it's not like there's some kind of global state like season and I have to make a deterministic replacement based on that; it's more like each node responding to its local conditions independently. 16:50 ireallyhateirc and if you're really interested then I could add a MIT license to that 16:51 MTDiscord That kind of localism is a big thing in NodeCore in particular. That game has probably like 90 VABMs in the base game or something (probably close to 40 engine ABMs) 16:51 ireallyhateirc I also use the shepherd for processing moisture movement through soil 16:52 MTDiscord If you have more than 63 ABMs then the performance suddenly takes a shit, so I forestall that by combining ABMs that have compatible signatures. 16:52 ireallyhateirc the shepherd shares the VM object among multiple workers 16:53 ireallyhateirc which also improves performance 16:53 ireallyhateirc anyway, faster ABMs are always welcome 17:00 MTDiscord ABM performance is ... surprisingly weird. The ABM cache is a huge factor. Including a "neighbors" check is a huge factor. Neighbor inversion can have a rather big impact on performance. 17:02 MTDiscord I've seen attempts to recreate the API but in pure Lua, which resulted in ... about the same overall performance. I've also attempted "laundering" the callbacks so they aren't all crammed into a single 200ms lagspike, and ... got bad results (spread the bad latency around, but there was still a spike due to the neighbors check, and the overall throughput was lower) 17:20 jonadab How parallelizable would the neighbors check be on a multi-core system? 17:38 MTDiscord This sounds more like a case for vectorization than for multithreading, since the neighbors check checks a small, constant amount of neighbors. Multithreading ABMs in general sounds like an idea worth trying though; it should be possible to process (at least the insides of) different mapblocks independently. 17:47 ireallyhateirc btw, why didn't this get any support? https://github.com/minetest/minetest/pull/14258 17:47 ireallyhateirc with not so impressive ABM performance I thought it would be good if you could turn off some of them at times when you don't need them 17:48 ireallyhateirc sfence implemented that thing in response to the issue I started: https://github.com/minetest/minetest/issues/13112 17:50 ireallyhateirc We previously used ABMs for our rain soaker that made soil wet during rains in Exile 17:50 ireallyhateirc but the ABM was always active, even with no rain because there is no way to disable it 17:51 ireallyhateirc so the ABM ran "if not raining() then return end" for every node? 18:01 jonadab Not just for soil nodes? 18:04 Mantar no, he means "every soil node." 18:08 ireallyhateirc that's about 19200 nodes per mapchunk assuming a 3 nodes tall layer. To prevent lag spikes we increased the interval to around 100s 18:10 ireallyhateirc with my mod we only run the rain soak worker when it rains and we can do so every 30s without problems 18:15 jonadab Interesting. 18:15 jonadab Is rain server-wide or localized? 18:17 ireallyhateirc server-wide, but I guess I could program it to be localised too 18:17 jonadab I mean, ABMs only run in loaded-in areas. 18:18 jonadab So that may not be a big deal, depending on the _number_ of simultaneous players you need to scale to. 18:19 ireallyhateirc ah, not like that. Currently there's no catch-up because it'd need programming a simulation of rain+evaporation 18:19 ireallyhateirc but it does work on servers - each player gets rain when it rains and soil becomes wet 18:19 ireallyhateirc but only land around players gets processed 18:20 ireallyhateirc but all loaded chunks get processed, not only the "active" area as ABMs 18:22 jonadab Ah. 18:27 shaft Most games use player API and the minetest game player model but ship an outdated renamed version. Why? 18:28 shaft Repixture got updated but still ships the old b3d with the player floating in air during sitting animation, lordofthetest still has the bug where you sometimes don't sit when you just did the right click animation 18:30 shaft It would be super easy to have working chairs for every single game made with MT engine if not for the horrible mod soup maintainers 18:30 shaft I just have to let this out somewhere. Sorry. 18:32 sfan5 The only reliable way I've found to find mapblocks around a player is just to check something like get_node_or_nil for one node inside the mapblock. 18:32 sfan5 minetest.compare_block_status()? 18:33 ireallyhateirc yeah I use the what sfan5 just said 18:34 sfan5 A better scheduler could get about 5x the performance on default configuration 18:34 sfan5 has someone proposed one? in writing I mean, not code 18:35 sfan5 ireallyhateirc: reading your usecase it sounds like we should give modders the tools to track active/loaded blocks 18:35 sfan5 or maybe easier just introduce a global table that mirrors the C++ state? 18:36 ireallyhateirc whatever works, if not I can still use my hacked together garbage. though would be cool to have something like that 18:36 sfan5 can you search for an existing issue and if there's one bring it to my attention? or if not, create one? 18:38 ireallyhateirc okay, will do so later 18:41 shaft Should I just give up on supporting mod soups? 18:44 ireallyhateirc shaft, yes 18:44 shaft okay, seems like the sane approach 18:44 ireallyhateirc generally speaking you shouldn't assume that a single mod can be compatible with multiple games 18:45 ireallyhateirc just make your mod work for your favourite games 18:45 shaft It could totally. 18:45 ireallyhateirc as for player_api, what's the upstream for that? MTG ? 18:45 ireallyhateirc I just grabbed it for my game from there I believe 18:46 shaft Yes. MTG is probably the newest while every other game copy pasted some old but renamed version of it with some of them still using the one where the functions are indefault 18:46 shaft in default 18:46 MTDiscord Almost, every other game 18:46 ireallyhateirc you could ask mod soup maintainers to update their player_api 18:46 shaft Every game except for node core 18:47 shaft EVERY SINGLE ONE 18:47 ireallyhateirc I believe we have it in Exile too, just don't know what version and if it was ever modified 18:47 MTDiscord U r very mean I wrote mine from scratch 18:47 MTDiscord https://tenor.com/view/la-noire-subtle-lies-lie-lying-gif-23157493 18:47 shaft Sure you have. 18:48 MTDiscord Yes, because it's written in typescript with only procedural animation off a static model 18:48 Mantar Exile's was ported from somewhere way back and has now been extensively rewritten 18:48 Mantar it's misleadingly named at this point, and will probably get folded into an "exile" core mod in the near future 18:49 sfan5 ireallyhateirc: actually i guess https://github.com/minetest/minetest/issues/14723 does the trick 18:49 Mantar well, maybe not "extensively" yet, there are still a bunch of inherited funk, but parts of it have been redone 18:49 Mantar *there is 18:51 shaft I'm calling out your bullshit. I just registered furniture for exile and player_api works perfectly fine just like in MTG. Good job, keeping it up to date 18:53 ireallyhateirc sfan5, yeah that would do probably 18:53 ireallyhateirc "If nodenames are not defined (empty table or nil) the action should be called once on activation with the first pos in the mapblock and a nil node." - so it would get called only once upon activation? 18:54 MTDiscord Shaft who are you talking tooooooo 18:54 sfan5 don't read too much into that proposal 18:55 shaft Mantar. He says his player API is totally different but it's the same. 18:55 shaft (which is a good thing) 18:55 Mantar heh 18:55 MTDiscord Hmm 18:55 Mantar good to hear we still have compatibility there 18:55 MTDiscord Mantar use my trash instead https://github.com/jordan4ibanez/forgotten-lands/blob/main/source/animation_station/init.ts 18:56 ireallyhateirc sfan5, as long as it works for all mapblocks and not only for active mapblocks then that would indeed work for my use case 18:57 Mantar jordan: looks pretty nice, might be worth replacing our setup 18:57 shaft What is your "wood" in Exile and how does crafting work. I can add support for your game. 18:58 Mantar oh we have soft and hard wood logs, and sticks 18:58 MTDiscord https://tenor.com/view/who-knew-never-thought-id-get-this-far-plankton-spongebob-gif-16160045 18:58 Mantar and fancier wood objects are oiled as well 18:58 ireallyhateirc sfan5, so "loaded" too in that case, but AFAIK LBMs work only once for each mapblock (they work for blocks that existed before the LBM started working) 18:59 Mantar and we use rubenwardy's crafting mod for menu crafting, though there are big changes to it in our dev branch 18:59 ireallyhateirc if so then it wouldn't work for me 18:59 sfan5 you can already mark LBMs to run every time 19:00 Mantar see mods/crafting/readme.md for how to register a recipe 19:00 Mantar I should write up an exile specific crafting.txt and drop it in docs 19:00 ireallyhateirc sfan5, riiight forgot 19:00 ireallyhateirc okay so it would work then 19:03 shaft I only see logs. Can you not process them further? 19:04 MTDiscord Have you tried hitting the top with an axe? 19:04 Mantar nope, we don't do interim "wood" stages. you can add your furniture to the carpentry bench, and that will imply all the tooling and processing 19:04 ireallyhateirc we have some planks later though? 19:05 ireallyhateirc or not 19:05 Mantar we have wooden floors, that's about as close as we get 19:08 MTDiscord What about wooden ceilings 19:09 MTDiscord :thonking: but then you get to the issue of wooden walls 19:11 Mantar we have tiled roofs and floors, and log roofs are popular. we have wattle walls too 19:12 MTDiscord Any thatched roofing? 19:12 Mantar yeah thatch is the easiest roof to set up 19:13 Mantar wattle-and-thatch is my go-to for a first structure, and is the best portable hut atm 19:13 MTDiscord That's amazing 19:13 Mantar and you need a portable hut, the weather will kill you 19:13 Mantar overland travel is rough 20:03 shaft do you have woods other than wooden floor boards and logs? 20:04 Mantar sticks are used for many things, they stand in for beams and planks and things 20:04 ireallyhateirc wattle is made from sticks 20:05 ireallyhateirc it's a wicker+grass primitive material 20:47 shaft Okay. Exile support is in. Enjoy https://content.minetest.net/packages/shaft/tables_chairs/ 20:48 ireallyhateirc t-thanks 20:54 Mantar nice ^_^ b 21:01 shaft I should take over player_api and force everyone to use the most recent version or something. 21:03 ireallyhateirc you could extract it from MTG and put as a separate mod on ContentDB 21:04 Mantar player_api_plus 21:04 Mantar the plus is for Please Load Update, Slowpokes 21:04 shaft Player movement should be overhauled too. You guys remember smart moving from Minecraft? 21:05 Mantar ¯\_(ツ)_/¯ 21:05 ireallyhateirc you mean something like XaEnvironment? 21:05 Mantar I found Minecraft kinda boring 21:06 ireallyhateirc yeah, we wouldn't be here if we liked minecraft lol 21:06 ireallyhateirc btw what are the features of player_api? 21:06 ireallyhateirc I just shoved it into my Perfect City game (not yet released) and don't know the implications 21:07 shaft It's a mod that allows climbing, proper swimming, you fold the hands when it detects you're jumping into water, it has a falling animation, you can crawl and swim through 1 block tall holes etc 21:07 ireallyhateirc ooh that'd be cool to have 21:07 ireallyhateirc btw if you want to fork player API then make sure it supports different scales of players 21:08 ireallyhateirc I'm using a player model that's 3.33 nodes high 21:08 shaft And you can move hand over hand along steel bars over your head 21:08 ireallyhateirc to make the scale of stuff more natural (similar to what backroom test did) 21:08 shaft It was pretty popular for parkour maps 21:09 shaft I think it had had you jump farther too if you ran more before jumping 21:13 ireallyhateirc I'm going to make a character model with knees and elbows, is this supported by player_api? 21:15 shaft I don't think player api cares. You need to make the animations after all 21:15 ireallyhateirc that's good 21:25 Mantar we have some of that in Exile, crawling through 1 block holes and a swimming animation