Minetest logo

IRC log for #minetest-dev, 2021-12-14

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

All times shown according to UTC.

Time Nick Message
00:21 Alias2 joined #minetest-dev
00:47 v-rob joined #minetest-dev
01:39 basxto joined #minetest-dev
01:44 proller joined #minetest-dev
01:50 tekakutli joined #minetest-dev
02:29 v-rob joined #minetest-dev
02:33 tekakutli joined #minetest-dev
02:35 kilbith joined #minetest-dev
03:28 queria^clone joined #minetest-dev
03:33 queria^clone joined #minetest-dev
03:58 MTDiscord <exe_virus> Centos 6 and Ubuntu I think 16.04 will miss us, but no biggie
05:00 MTDiscord joined #minetest-dev
05:17 v-rob joined #minetest-dev
05:29 v-rob joined #minetest-dev
05:37 fluxionary_ joined #minetest-dev
06:01 v-rob joined #minetest-dev
07:57 olliy joined #minetest-dev
08:27 calcul0n joined #minetest-dev
09:35 MTDiscord1 joined #minetest-dev
09:39 queria joined #minetest-dev
09:40 Sokomine_ joined #minetest-dev
09:40 basxt0 joined #minetest-dev
09:51 ShadowBot joined #minetest-dev
09:51 clavi joined #minetest-dev
10:31 YuGiOhJCJ joined #minetest-dev
10:43 proller joined #minetest-dev
11:20 Taoki joined #minetest-dev
12:17 olliy joined #minetest-dev
12:23 olliy1or joined #minetest-dev
12:29 olliy joined #minetest-dev
13:10 proller joined #minetest-dev
13:29 dzho joined #minetest-dev
14:04 tech_exorcist joined #minetest-dev
14:29 erlehmann joined #minetest-dev
14:29 erlehmann test
14:29 MTDiscord <Warr1024> success!
14:29 MTDiscord <Jonathon> Test failed successfully
14:30 erlehmann I have decided to no longer bitch about wrong boundaries, but just provide well-tested patches. here is the first: https://github.com/minetest/minetest/issues/11828#issuecomment-993594718
14:30 erlehmann that way i do useful work and do not go on ppls nerves
14:30 erlehmann celeron55 does this count as a trivial patch that can be merged or should make a PR?
14:31 erlehmann it fixes 11828 and also mineclonia issue 183
14:33 erlehmann joined #minetest-dev
14:37 erlehmann <rubenwardy> I think the solution to modders misusing version strings to check for features isn't to withhold the version strings, but to make it easier to check for features
14:37 erlehmann i think the solution is to actually withhold the version string AND make it easier to check for features
14:37 erlehmann otherwise some lazy person is going to use the versoin string
14:40 MTDiscord <Warr1024> Heh, that only works if MT actually knows what features it has.  We would need like has_entity_attachments, entity_attachments_fixed, entity_attachments_working_again, entity_attachments_really_fixed_now_this_time_for_sure...
14:41 MTDiscord <Warr1024> As a gamedev the reason I need to know the version is not to know what APIs MT supports, it's to find out how those APIs actually behave so I can decide whether they're buggy enough I need to rely on fallback behavior.
14:42 MTDiscord <Warr1024> That's not a thing you'll be able to just "fix", either, it's an inevitability of ongoing changes to the engine and its environment.
14:42 erlehmann coming from web development, i think fallback behaviour is almost always the wrong solution
14:42 erlehmann progressive enhancement is the correct solution. what others see as fallback behaviour becomes the baseline, you layer your solution on top of it.
14:42 erlehmann that way, it always works, built up from the lowest common denominator.
14:43 erlehmann i.e. code your page in html, then apply css, then apply js. the html version must be fully working before you do the latter steps.
14:43 erlehmann it means whenever js fails, it is likely that the plain html will still work.
14:44 erlehmann bad web devs do the js thing first and then redirect to some stripped-down page that inevitably sucks or is eventually deprecated.
14:49 celeron55 they don't even redirect you to anything these days
14:49 celeron55 they just say "no content for you. go download the newest browser from our favourite vendor"
14:49 rubenwardy I think it depends on the website
14:50 rubenwardy that makes sense for a news website - but not for a social network. Social networks are inherently interactive, making them work with no JS desn't make sense
14:50 rubenwardy the sort of person that disables JS also probably doesn't use social networks
14:51 celeron55 well, sometimes i have to use facebook marketplace to get something, and F5 would provide me all the interactivity i'd need
14:51 celeron55 same thing goes for almost everything
14:51 celeron55 even discord would be fine with just F5
14:51 MTDiscord <Sublayer plank> some websites don't even show a message when javascript is disabled, they just give you a blank page or gray boxes where content should be
14:52 MTDiscord <Warr1024> erlehmann, sounds like you're saying the same thing that I'm saying but with different words.  I want to progressively enhance what my mods do.
14:53 celeron55 anything that literally needs javascript to be useful is basically a video game
14:53 MTDiscord <Warr1024> There are cases where I have to choose to either use feature A or feature B (where one of those might be "nothing" if there is no option that's beneficial).  Whether you call one of those a "fallback" or the "baseline" doesn't really change the API surface that I would need to achieve that.
14:58 MTDiscord <Warr1024> I actually have a counter-case re: the JS thing.  I would actually prefer that websites be designed to deliver essentially a static client-side app that then talks to a JSON API on the back-end.  I hate having to scrape through messy pre-baked HTML trying to script anything, and sites that are API-based can be easier to work with, depending on how they auth.
14:58 erlehmann joined #minetest-dev
14:59 MTDiscord <Warr1024> CDB is a good example of a compromise, in that it offers both a JSON API and pre-baked HTML views.  For services that can't afford to maintain both, I'd probably rather have the JSON API if I want to seriously use it long-term.
15:01 MTDiscord <Warr1024> For a news site ... I want RSS or Atom.  I've had RSS/Atom support for CDB on my todo list for ... a long time.
15:16 erlehmann Warr1024 i have been a backend developer. i know how to do this! you can see it with my personal page: http://news.dieweltistgarnichtso.net/bin
15:16 erlehmann it generates an atom xml feed first and then applies a stylesheet to it to get the xhtml out of it
15:17 erlehmann that way the feed always works, since there is only one code path
15:18 erlehmann i have also made a backend service for a customer that delivers json responses and then depending on the content type that the browser wanted, i gave out a html rendering of it. i can help you if you want to make something like this.
15:19 erlehmann Warr1024 you say you have atom support for cdb on your todo list. if i offer help, who is the maintainer?
15:19 erlehmann > Social networks are inherently interactive, making them work with no JS desn't make sense
15:20 erlehmann that is not true, you can use the fediverse wih it. also, you can have continuously updating content without js. otherwise early webcams would never have worked
15:22 erlehmann rubenwardy with this short shell script and djb's tcpserver you can monitor a file and push updates over http to the client http://news.dieweltistgarnichtso.net/bin/httptaild
15:23 erlehmann it uses tail -f and chunked encoding, works pretty much everywhere i have tried without any js
15:23 rubenwardy not sure why I'd need that
15:24 rubenwardy I'm the maintainer of ContentDB, the issue is: https://github.com/minetest/contentdb/issues/224
15:24 erlehmann oh i know python, good
15:25 erlehmann i rather use bottle.py than flask but i guess i can figure it out, thanks
15:26 rubenwardy never heard of that one
15:26 rubenwardy eh, WSGI
15:26 rubenwardy I prefer to run stuff separately from nginx, and use nginx as a reverse proxy
15:26 erlehmann bottle.py fills the same niche as flask, just differently opinionated
15:26 erlehmann a very small web framework
15:26 erlehmann single file
15:27 rubenwardy well, wsgi is a standard and not necessarily tied to nginx
15:27 erlehmann yes
15:27 erlehmann very good
15:27 rubenwardy If I were to remake ContentDB, I'd be tempted to use a more complicated framework like Django
15:27 rubenwardy or NodeJS
15:27 erlehmann btw, regarding turning off javascript: try opening 20 tabs on a modern computer with no js blocked. like 20 tabs of youtube. now try it with a proper script blocker. the difference is your computer lagging itself to death or not.
15:27 rubenwardy my computer handles that fine
15:28 MTDiscord <Jonathon> same
15:28 erlehmann people always say that but then they run some ad blockers that block a lot of js anyway
15:28 rubenwardy Firefox aggressively sleeps tabs
15:28 rubenwardy yeah I also use an adblocker because I'm personally not a fan of viruses
15:28 erlehmann not a fan?
15:29 erlehmann i am waiting for someone to claim ”i do not use an adblocker, because it is untested experimental technology and it changes the code on my computer PERMANENTLY” ^^
15:30 erlehmann i trust my natural malware immunity xD
15:51 Fleckenstein joined #minetest-dev
16:03 fluxionary_ joined #minetest-dev
16:11 Fixer joined #minetest-dev
16:44 sfan5 when I first read #11634 I thought that was stupid but I suddenly need one myself
16:44 ShadowBot https://github.com/minetest/minetest/issues/11634 -- Custom error handler
16:45 sfan5 sadly this doesn't seem to be easy to implement
17:03 sfan5 oh god I hate async programming in lua
17:03 rubenwardy are you using callbacks or coroutines?
17:03 rubenwardy not that it makes too much difference
17:04 sfan5 former
17:07 Fleckenstein do you like JavaScript async programming better?
17:08 sfan5 without await it's the exact same mess
17:08 sfan5 with await, yes obviously
17:09 Fleckenstein https://github.com/EliasFleckenstein03/lua_async
17:09 Fleckenstein it got await
17:09 Fleckenstein the error messages suck however
17:10 Fleckenstein and it does not seem to work with non-LuaJIT MT for some reason
17:10 sfan5 I suppose coroutines allow making this less painful? haven't ever messed with them
17:12 Extex joined #minetest-dev
17:14 Fleckenstein yes
17:14 Fleckenstein lua_async internally uses coroutines
18:20 sfan5 okay let's see if I can make this work using coroutines
18:20 sfan5 because that'd be much nicer
18:23 fluxionary joined #minetest-dev
18:54 sfan5 static int ScriptApiBase::luaPanic(lua_State*): A fatal error occurred: LUA PANIC: unprotected error in call to Lua API (bad argument #5 to '?' (function expected, got table))
18:54 ShadowBot https://github.com/minetest/minetest/issues/5 -- Fixed key names so the key set menu now works. by adamnew123456
18:54 sfan5 is this a good sign?
18:56 rubenwardy haha sounds about right
18:57 erlehmann joined #minetest-dev
19:00 kilbith joined #minetest-dev
19:01 kilbith_ joined #minetest-dev
19:04 erlehmann what exactly is preventing https://github.com/minetest/minetest/pull/11858 from being merged as a trivial bugfix? there are no performance arguments here, bounds checking is done anyways. it is only that the current number makes code buggy that previously was not.
19:06 erlehmann i think most of the debates regarding where the world “should” end do not address real-world problems, i.e. game-breaking behaviour.
19:09 MTDiscord <Warr1024> Heh, I actually ran into a related problem a layer of abstraction up.  I want all of my logic that checks for nodes in areas or specific places to "abort" if it encounters an unloaded area, i.e. stop executing that specific registered callback for that position, but continue on to the next one.
19:09 erlehmann Warr1024 do you know if the breaking of lua mapgen at map boundaries affects lighting?
19:10 MTDiscord <Warr1024> The usual way to do this is just having to check for node.name == "ignore" or (not get_node_or_nil(...)) etc but obviously this is not an abstraction, so it's dependent on me remembering to consistently do this everywhere, and if I need to change the pattern, then I have to update thousands of lines of code.
19:10 erlehmann i am thinking of the end dimension in MCL* in particular
19:10 erlehmann it is technically underground
19:10 MTDiscord <Warr1024> The only lua mapgen I do is substitutions so I don't know.
19:11 erlehmann oh, but substitutions are exactly what fail now
19:11 erlehmann if you find them with minetest.find_nodes_in_area()
19:11 MTDiscord <Warr1024> I only do my lua mapgen using the mapgen vmanip, so no.
19:12 erlehmann oh, right, they have not broken that … yet
19:12 erlehmann lol
19:12 MTDiscord <Warr1024> patience
19:13 erlehmann what i hate in particular about this situation is that one value is practically better (less bugs) and the other is only an aesthetic choice (as there is no logical connection to use mapgen limit for this)
19:13 erlehmann aesthetics (yay. using the same limit everywhere) should not trump ethics (not breaking games)
19:13 MTDiscord <Warr1024> I think I also assume that areas outside of the mapchunk I'm given do not really exist, so I do kludgey stuff near mapchunk boundaries where I can't safely make assumptions about whether anything exists on the other side, so there are probably 2-wide planes for instance that don't generate lode ore every 80m because there's no way for me to be sure they wouldn't be exposed to air...
19:14 erlehmann that's fair. i mean i would not decay farmland near ignore nodes because those might hold water when loaded.
19:15 erlehmann i have looked at wuzzy mine shaft generation and if i remember it correctly, it starts in the middle of a mapblock and works itself outwards. similar approach i guess.
19:16 MTDiscord <Warr1024> Haha, yeah, the problem is I just have to go back and audit 20kLOC of game code for places where I need unloaded checks, and then once I do that doesn't absolutely prevent me from making the same mistake again later.  I want there to be an abstraction that I can just use and it will handle all the subtleties for me.
19:16 MTDiscord <Warr1024> I've got some hacks that would probably work but their perf costs are pretty significant.
19:18 MTDiscord <Warr1024> re: mapgen, also, there's one reason to always stick to only inside-mapchunk stuff and never even attempt to look at neighboring mapchunks even if they might be loaded: it helps ensure that maps always generate as close as possible to the same way regardless of the path by which they're explored.
19:18 erlehmann oh yeah, i have noticed that some code, like village generation, will be different depending on how i approach some area. but that's not for the engine to solve, it is a mod problem.
19:19 sfan5 apparently the mere presence of coroutines totally prevents certain callback things from working
19:19 MTDiscord <Warr1024> I was so thrilled when dungeons finally started generating repeatably in 5.3 that I went and reworked all the lua mapgen so all that stuff is repeatable per seed as well :-D
19:19 sfan5 welp
19:23 erlehmann sfan5 i do not understand https://github.com/minetest/minetest/pull/11858#issuecomment-993818705 – the code is buggy right now and the patch fixes it for *all* possible scenarios as far as i see. any discussion of the map boundaries should be subordinate to fixing bugs introduced by an improper understanding of the map boundaries IMO.
19:24 erlehmann you can still move it to whatever value later (introducing new bugs if not careful, or none if everything except the mapgen has the same boundary)
19:25 erlehmann (unless the mapgen boundary is higher than whatever the other value is, of course)
19:26 erlehmann so what is gained by discussing where the boundaries should be (again) now except stalling the obvious bugfix?
19:27 erlehmann FYI: Fleckenstein convinced me that i should not make a game crash if code i am not responsible for misbehaves. it is an issue of ownership after all.
19:28 sfan5 if you want something post in the issue, I don't want to talk about it now or here
19:28 erlehmann ok
19:29 erlehmann sorry
19:34 MTDiscord <Warr1024> sfan5, if you want sane-looking lua async code, you could look for a library that does promises so you can do like a .then(function()...end).then(function()...end) sort of thing.  Uglier than async, but not as bad as nested chains of callbacks in my experience.
19:35 MTDiscord <Warr1024> that, at least should not require coros either.
19:40 Fleckenstein Warr1024, i provide such a library
19:40 Fleckenstein i linked it to sfan5 earlier
19:41 Fleckenstein but i think he wants to make his own with coros
19:42 sfan5 Fleckenstein: here's what I came up with https://github.com/minetest/minetest/pull/11859/files#diff-99c99abc6a9c22c20d2d88aaf961847b7d82e23d9e97e43cea691054ba26ecbaR27-R48
19:42 MTDiscord <Warr1024> yeah, but then he said that coros break everything so 🤷
19:42 MTDiscord <Warr1024> but on the other hand, that promise library looks nice anyway and I wonder if I can use it for something...
19:42 sfan5 in case it doesn't link properly that's the `local function await(invoke)`
19:43 Fleckenstein yea, it's probably better to use this instead of including a library for it
19:44 Fleckenstein test this with plain lua as well as with LuaJIT tho, i've had problems with coros on Minetest + Plain Lua
19:44 Fleckenstein it works with Plain Lua or with Minetest + LuaJIT, but not with Minetest + Plain Lua for some reason
19:45 sfan5 the CI build that also runs the test is without luajit, so let's see
19:46 sfan5 and for @Warr1024 this is what my async-proof function looked https://github.com/sfan5/minetest/blob/eab4c79df3cd32dfe451982f138b39f6d96e2f45/games/devtest/mods/unittests/init.lua#L96-L160
19:49 sfan5 I wonder how an embedding application is supposed to handle a closure being created inside a coroutine that is supposed to be called while the coroutine is suspended
19:49 sfan5 because that's what causes the lua panic I showed earlier
19:49 sfan5 putting it into core.after() is somehow no problem (because it's plain Lua?)
19:50 proller joined #minetest-dev
19:51 sfan5 Fleckenstein: no complaints from CI so that must be up to your specific implementation
19:54 Fleckenstein if you call coroutine.yield() from a function called by some native C code, you get the attempt to yield across C call boundary error
19:55 Fleckenstein e.g. lua code -> table.sort(table, callback) -> callback() -> coroutine.yield() -> error
19:55 Fleckenstein for some reason the same error happens if i use my library inside of minetest + plain lua, LuaJIT however works
19:55 Fleckenstein i haven't quite figured out the problem yet
19:59 sfan5 the flow is lua code -> core.dynamic_add_media(..., callback); coroutine.yield()
20:00 sfan5 then that callback is called from C++ later -> lua panic
20:01 kilbith joined #minetest-dev
20:01 sfan5 it doesn't even matter what kind of function you pass to it: an empty closure, an empty global function, core.show_formspec, ...
20:01 sfan5 it all errors
20:01 sfan5 so I suspect Minetest would have to do something to handle this case with coroutines, but what?
20:03 EliasFleckenstei joined #minetest-dev
20:04 sfan5 probably this https://www.lua.org/manual/5.1/manual.html#2.9
20:06 Fleckenstein joined #minetest-dev
20:10 Fleckenstein joined #minetest-dev
20:26 sfan5 wait maybe I should tried a debugger earlier, not that the error makes more sense but I can tell where it comes from
20:26 sfan5 should havE*
20:45 sfan5 okay so the bug is "simple": Minetest assumes there is only ever one lua_State, but this trivially violated by coroutines
20:46 MTDiscord <luatic> the bug might be "simple", but I suppose the fix will be fairly nontrivial...
20:47 sfan5 this only matters for a few functions to begin with but yeah
20:51 sfan5 in fact the situation is so unique I don't think there's more than dynamic_add_media
20:52 sfan5 ...which is ironically the function I picked to test
21:33 proller joined #minetest-dev
21:53 Fleckenstein joined #minetest-dev
21:54 EliasFleckenstei joined #minetest-dev
21:54 Fleckenstein joined #minetest-dev
22:32 Taoki joined #minetest-dev
22:39 v-rob joined #minetest-dev
22:59 MTDiscord <josiah_wi> sfan, if you're around still, could you clarify whether you want me to keep the shared pointer change or instead re-order the code so the unique ptr can be moved?
23:06 sfan5 you can leave it like this
23:21 MTDiscord <josiah_wi> Does breaks reordering it break something? Or is it just more work to review?
23:26 sfan5 it breaks something if you're not careful, it works with std::shared_ptr
23:28 MTDiscord <josiah_wi> Gotcha. Thank you!
23:51 v-rob joined #minetest-dev

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