Minetest logo

IRC log for #minetest-dev, 2015-05-01

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

All times shown according to UTC.

Time Nick Message
01:07 Hijiri joined #minetest-dev
01:57 pozzoni joined #minetest-dev
02:35 est31 joined #minetest-dev
02:46 Zeno` joined #minetest-dev
04:07 Hijiri joined #minetest-dev
05:02 est31 is this << stuff really that bad?
05:03 est31 When I edit or read network code, I'm interested in the logic
05:03 est31 what the program does
05:03 est31 I dont want to waste my time scrolling over
05:04 est31 resp_pkt.putString(str);
05:04 est31 resp_pkt.putInt(1);
05:04 est31 resp_pkt.putCString(str,3);
05:04 est31 and so on
05:04 est31 and splitting it up just hides the problem
05:05 est31 because then you can't get an overview of what happens
05:05 est31 with << I can use kate's doubleclick word highlight feature and quickly see where data is accessed
05:05 est31 ok that one is perhaps replaceable by doubleclicking resp_pkt
05:19 est31 Zeno`, about #2657, do you know whether /MT option is harmful or bad?
05:19 ShadowBot https://github.com/minetest/minetest/issues/2657 -- Fix several MSVC issues by SmallJoker
05:19 est31 because if not then I'll merge the patch
05:20 est31 (cant test though)
05:32 est31 whatever, its used elsewhere too
05:32 est31 people will have to recompile when they update windows their fault
05:33 est31 (or perhaps windows has binary compatibility?)
05:33 est31 I think I remember faintly of linus saying something around that linux doesnt promise binary compat
05:33 est31 perhaps that was meant in comparison with windows
05:36 Zeno` I have no idea what the MT option is
05:37 Zeno` oh multithreaded linking
05:37 Zeno` umm, I dunno tbh
05:37 est31 MD is multithreaded too
05:37 est31 but src/cmakelists.txt has mt too
05:37 Zeno` :/
05:38 est31 so then, if the binary interface of windows sys libs change, users are already screwed
05:38 Zeno` I really don't know. Krock is (basically) the only one who makes MSVC builds so...
05:40 est31 what do you think about adding this to gitignore:
05:40 est31 +## Files related to minetest development cycle
05:40 est31 +/*.patch
05:41 Zeno` It'd be nice
05:41 est31 Then I'm merging
05:41 Zeno` I have it already in my personal repo
05:41 est31 there are tracked files inside build/android but those arent catched because its /*.patch and not *.patch
05:42 Hunterz joined #minetest-dev
05:42 est31 pushed
05:45 hmmmm est31, you've got to remember to add newlines to the end of files
05:45 est31 didnt I?
05:46 hmmmm not for test_utilities.cpp
05:46 hmmmm but thank you for adding a unit test
05:46 hmmmm we need more of this
05:46 hmmmm oh and not for json/CMakeLists.txt either
05:46 hmmmm your editor should have an option to add newlines to the end of files
05:46 est31 hmmmm, I added them: https://github.com/minetest/minetest/commi​t/6626a3f72f66703a161abccab90cffcec31c3932
05:46 hmmmm if you don't do this it causes an undisableable compiler warning, and git/github moan about it too
05:47 est31 I dont see the red "newline missing" symbol
05:47 hmmmm oh okay
05:47 hmmmm it showed that in the pull request
05:47 est31 yes krock didnt add them
05:47 hmmmm ohh derr
05:47 est31 I removed them
05:47 hmmmm that's krock's patch not yours
05:47 hmmmm sorry
05:47 est31 added them*
05:48 est31 I also moved the s32 cast out like Zeno` suggested at my patch
05:48 Zeno` ?
05:48 est31 I wrote return (s32)(f < 0.f ? (f - 0.5f) : (f + 0.5f));
05:49 Zeno` oh ok
05:49 est31 instead of return (f < 0.f ? (s32)(f - 0.5f) : (s32)(f + 0.5f));
05:49 Zeno` yep
05:49 hmmmm you don't really need that cast
05:49 hmmmm it's implicit due to the return type
05:49 Zeno` you don't but see my comment in the PR
05:49 est31 yes Zeno` has said that
05:50 hmmmm i don't see it
05:50 est31 its outdated
05:50 hmmmm oh nevrmind it hid it
05:50 hmmmm man
05:50 hmmmm yet another hack tacked onto our make system
05:51 Zeno` I was concerned that somebody might one day change the return type to double to match C's round() and stupidly remove the cast
05:51 hmmmm that cmake file is frankly a wreck
05:51 hmmmm it's because nobody here really, truly understands CMake more than one needs to be to be functional with it
05:56 Zeno` quite funny really. I'm normally the one getting angry about casts where they're not necessary :D But in this case it's more "functional" (if you get my drift)
06:02 selat joined #minetest-dev
06:03 est31 btw, free does need casts, when you are freeing a const void * pointer
06:04 Zeno` err
06:04 est31 otherwise it wont compile
06:04 Zeno` you should not be freeing const void pointers lol
06:04 est31 they are freed automatically???
06:04 Zeno` no
06:04 est31 so leak them?
06:04 Zeno` but why is it const?
06:05 est31 because API
06:05 est31 shitty API
06:05 Zeno` (or rather why is it pointing to const data)
06:05 Zeno` well if it's a shitty API then yeah, you'd need to cast it because you're free()ing something that is supposed to be constant
06:06 Zeno` Where does this occur?
06:06 est31 I just dont understand why C allows to modify const data
06:06 est31 https://github.com/minetest/minetest/pull/2620/​files#diff-4655ab09ebe57e0ea50afe7ea42c7973R90
06:06 est31 thats the method
06:06 est31 or some other inside that file
06:07 Zeno` Oh, that's the developer's attempt at being opaque
06:07 Zeno` I don't see where the free is though
06:08 Zeno` ah
06:08 Zeno` ok
06:08 Zeno` that's dumb :)
06:09 Zeno` it shouldn't be const in the first place if the caller has to free it :/
06:09 est31 eg here https://github.com/minetest/minetest/pull/2620/f​iles#diff-34f48ad91ac6c202ac60b0348ae90e30R1024
06:09 Zeno` anyway, not our problem I guess
06:10 Zeno` crazy
06:11 est31 so when "should" const be used?
06:11 Zeno` when the data is constant
06:11 Zeno` and you should not modify it
06:11 Zeno` (or you're passing something to a function where the function does not modify it)
06:12 est31 I guess I'll change the library then
06:12 Zeno` Nah leave it
06:13 est31 I've more or less forked it
06:13 est31 https://github.com/est31/csrp-gmp
06:14 est31 already 12 patches by me :)
06:18 sofar do you want me to ask some folks to do a security review of it?
06:18 est31 would be great :)
06:18 sofar my first comment would be: kill SHA-1
06:18 est31 I guess though that minetest itself needs one too
06:19 sofar it likely does
06:19 est31 I dont use sha-1
06:19 sofar README says it's in the code
06:19 sofar that's what I saw
06:20 est31 yes old authentication uses sha-1
06:20 est31 ah you are at csrp-gmp
06:20 sofar am I looking at the wrong tree?
06:20 est31 no
06:21 est31 csrp-gmp and my srp patch for minetest are different things
06:21 est31 I try to keep them even but one of the changes is the hash method
06:21 est31 btw, sha-1 isn't *that* bad for password hashing
06:22 est31 I mean sha-1 is still strong for second-preimage attacks
06:24 hmmmm i think since it's technically a fork of csrp we're using now, you should clean up the interface at some point
06:24 hmmmm i.e. cut that crap where the author attempts to make the srp structure opaque
06:24 hmmmm it's messy
06:24 est31 why?
06:24 hmmmm like i said... mess
06:25 est31 so people start relying on the internal struct, the implementation changes, and bam they have a problem
06:25 hmmmm i very much, highly, highly doubt people will not rely on the internal struct.
06:26 hmmmm when's the last time you've seen people access a FILE ?
06:26 est31 so where exactly does the ugliness show up?
06:26 hmmmm when you need to cast things just in order to free them
06:26 hmmmm so either that or don't leak any details at all and put it all in srp_free() or something
06:27 est31 there is something like that
06:27 hmmmm why aren't you using it then
06:27 est31 I am
06:27 est31 its only catching a small part
06:27 hmmmm huh
06:27 est31 I'll document what is freed and what not
06:29 est31 I've updated the PR and fixed most things
06:29 est31 the casts are still open
06:30 est31 about auth.{cpp,h} location, where do you think they should be?
06:30 est31 read this: https://github.com/minetest/minete​st/pull/2620#discussion_r29312976
06:30 hmmmm i think the main directory
06:30 hmmmm authentication is a central part of multiplayer
06:31 hmmmm it's not a utility at all
06:31 hmmmm that's like if i put mapgen.cpp in util
06:32 hmmmm script apis in l_util.cpp doesn't necessarily mean that they expose functionality from src/util/
06:32 hmmmm i mean what about l_setting_set()?  that's in settings.cpp
06:33 hmmmm just because a directory is 'cramped' doesn't mean that you should put a new file in an inappropriate location... we need to move other files to a more organized area
06:33 est31 yea the cramped argument is bad
06:34 hmmmm hrmm
06:34 est31 ok then ill put it into main src dir
06:34 est31 what about srp.cpp? move it too?
06:34 hmmmm i never wrote out my file-move-migration roadmap
06:34 hmmmm hrmm
06:34 hmmmm i thought it was srp.c
06:34 est31 no I made it cppp
06:34 hmmmm i have mixed feelings
06:34 est31 because I used pcgrandom
06:35 hmmmm should it be considered third party code??
06:35 est31 I want to keep the diff between that file and csrp-gmp small
06:36 est31 if you want I can move csrp-gmp to the minetest group so that all of you can change it
06:37 hmmmm hmm
06:38 hmmmm so you don't consider srp.cpp part of minetest, or do you?
06:38 hmmmm it's up to you i think
06:38 hmmmm how do you get randomness in your fork?  do you just read everything from the system random?
06:39 est31 yes
06:39 est31 urandom
06:39 sofar that's all you can do
06:39 sofar or use PRNG or a hw PRNG
06:39 est31 urandom is ususally fast enough
06:39 est31 and it is also secure
06:40 hmmmm hmm
06:40 hmmmm why did you use PcgRandom again??
06:40 hmmmm I mean if you're using the hardware random already for seeds to pcgrandom i'm not sure what the point is
06:41 hmmmm we assume that the system random is secure
06:41 est31 yea perhaps thats a good idea
06:41 est31 just what to do on exotic platforms?
06:41 hmmmm mmeh
06:42 est31 I mean right now we are initializing pcgrandom with a constant and some time there
06:42 hmmmm i don't know
06:42 hmmmm well the implementation for pcgrand is simple enough
06:43 est31 I can use it under MIT?
06:43 hmmmm why not add a very small portable version of pcgrandom?
06:43 hmmmm yes
06:43 est31 great
06:43 hmmmm what is your current license?
06:43 est31 MIT
06:43 hmmmm ok
06:44 hmmmm as for the seed I would've recommended something like
06:44 hmmmm ((intptr_t)getpid() ^ (intptr_t)time(NULL) ^ (intptr_t)printf);
06:45 hmmmm hrmm
06:45 hmmmm or wait, getpid() is posix
06:45 est31 I'm doing this right now: https://github.com/minetest/minetest/pull/2620/​files#diff-2f6369328116e9b654242a7597658a48R534
06:45 hmmmm time(NULL); is good
06:45 hmmmm hrmm
06:46 hmmmm I would say gettimeofday() but compatibility for that frankly sucks
06:46 hmmmm the problem with time(NULL) is that the seed is the same for instances started within that same second
06:46 hmmmm gettimeofday() has a reasonable difference
06:46 hmmmm why do things need to be so imcompatible!?
06:47 est31 yea :/
06:50 est31 this is why its good to have threading in c++11
06:50 est31 no need to use porting tricks
06:50 hmmmm hindsight is 20/20
06:50 est31 ?
06:51 hmmmm in any case I'm looking through my c89 spec and it doesn't seem like there's any really good ISO C conformant way to get a seed other than time(NULL)
06:51 hmmmm sorry :/
06:54 est31 what about clock() ?
06:55 hmmmm oh yeah that helps actually
06:55 hmmmm time(NULL) ^ clock()
06:55 est31 great
06:56 hmmmm clock helps but you can't really be sure about its quality
06:56 hmmmm nothing is defined about it other than it's monotonically increasing
06:57 est31 lol
06:57 hmmmm rather, there is CLK_TCK
06:57 hmmmm hrmm
07:05 nore joined #minetest-dev
07:12 est31 so I'll use pcgrandom for non-windows operating systems where no /dev/urandom is available. on other platforms I think its better to have a resource which is reseeded
07:12 est31 from time to time
07:25 kahrl on windows you could use CryptGenRandom
07:30 est31 yup using that
07:31 est31 (not for the patch but for csrp-gmp)
07:31 est31 goal is to unify, then cryptgenrandom seems best
07:56 kilbith joined #minetest-dev
07:59 est31 hmmmm, how would you propose to open files?
07:59 est31 not with FILE * then with what?
08:00 hmmmm why not file?
08:00 est31 <hmmmm> when's the last time you've seen people access a FILE ?
08:00 hmmmm that was referring to opaque structures
08:00 est31 ah ok
08:04 Yepoleb joined #minetest-dev
08:09 est31 ok, now using unified random
08:12 cib0 joined #minetest-dev
08:18 Anchakor joined #minetest-dev
08:20 FR^2 joined #minetest-dev
08:22 Calinou joined #minetest-dev
09:11 sfan5 >Minetest aef1b41
09:11 sfan5 what the fuck is this
09:12 sfan5 where is the version
09:12 sfan5 [...] "Minetest/aef1b41 (Linux/3.19.3-3-ARCH x86_64)" "-"
09:12 sfan5 also this is wonderful for statical purposes
09:12 sfan5 not
09:14 sfan5 ..would be nice if it could displays the version if there are no tags in the repo
09:14 sfan5 -s
09:14 selat joined #minetest-dev
09:21 est31 here we are again
09:21 est31 lemme see I had a PR for that...
09:22 est31 sfan5, #2357 might help
09:22 ShadowBot https://github.com/minetest/minetest/issues/2357 -- Make git version discovery work on master by est31
09:22 est31 only user agent modifications have to be done
09:23 Megaf_ joined #minetest-dev
09:26 sfan5 est31: that code looks hacky
09:26 sfan5 what i would do is just fix it next release (tag master, not stable-0.4)
09:26 sfan5 (or merge them or whatever)
09:27 est31 why does it only display the hash?
09:28 est31 so in theory it should output something with 0.4.11, no?
09:31 sfan5 i used --depth=1
09:31 sfan5 that means there are no tags in the repo
09:31 sfan5 a lot of android versions have this too
09:32 sfan5 it would way easier to identify them if they still had the version
09:32 sfan5 it's not like tags are the only way to get the version
09:38 est31 yes
09:38 est31 I think I have a fix
09:38 est31 (at least in my brain, have to code and test it)
09:57 est31 sfan5, what about this: https://github.com/est31/minetest/commit/​4a9c8ce10bc8fcc652fc57d99f691d91ad8f0487
09:58 est31 Its same behaviour as before when there are tags, only printing something like "0.4.12-dev-4a9c8ce" when no tags are found in history
09:59 sfan5 that looks like it might work
10:12 err404 joined #minetest-dev
10:13 cib joined #minetest-dev
11:02 OldCoder joined #minetest-dev
11:02 MinetestForFun joined #minetest-dev
11:03 MinetestForFun joined #minetest-dev
11:06 Player_2 joined #minetest-dev
11:12 est31 joined #minetest-dev
11:46 Kopharex joined #minetest-dev
11:46 Kopharex Hello everyone
11:47 Kopharex I was wondering if someone could explain to me, a humble c++ beginner, how the minetest world generation works.
11:53 celeron55_ at what level?
11:54 celeron55 are you interested about the overall framework or maybe about the noise techniques, or what?
11:55 Kopharex I'm interested in a generic overview
11:55 Kopharex I'd like to create a world generation library as an exercise
11:56 Kopharex I got that perlin noise is used to create chunks, but i'm not sure how you actually do that
11:56 Kopharex The parameters in the noise function etc...
11:57 Kopharex and how that doesn't result in completely different chunks
11:57 Kopharex I'd like to understand so i can write a diagram for myself to use
11:57 celeron55 so you _do_ want to know about how perlin noise is used
11:57 Kopharex Yes, if you don't mind.
11:59 celeron55 i'm going to try to google a good introduction to this before trying to explain myself, because this is quite common in game programming
11:59 Kopharex Thanks
12:01 celeron55 hmmh, well i think you can just search for "perlin noise world generation" and get a lot of information, but i'll say a thing about chunked generation
12:01 celeron55 the thing about perlin noise is, you can query the value at a coordinate independently of anything else you might be doing
12:02 celeron55 and given the same seed and coordinate and parameters, it's going to be predictable
12:02 Kopharex i see
12:03 celeron55 so minetest can generate a chunk, and not care about what happens near it; it uses the global coordinate system to query the perlin noise so it's naturally contiguous between chunks
12:05 celeron55 this is of course possible only as long as the generator isn't modified
12:06 Kopharex ok
12:06 Kopharex so that's how the terrain is generated
12:06 Kopharex what about oceans?
12:06 celeron55 well i mean, that's how we keep it contiguous between chunks
12:07 Kopharex do you just set water under a level after the generation happened?
12:07 celeron55 of course there are many things related to for example performance and storage that you need to keep in mind, but the subject gets kind of broad if we go there
12:07 celeron55 there's generally a constant water height
12:07 Kopharex ok
12:08 Kopharex how do you create biomes after the generation?
12:08 Kopharex there were cells i recall
12:08 celeron55 some generators (see paramat's work) manage to make rivers and small lakes that can be at higher elevations
12:08 celeron55 i'm not familiar with how he does those
12:09 celeron55 there are quite many biome systems
12:09 celeron55 the simplest ones just use a few pre-selected noise parameters and have hardcoded logic for deciding based on those biome noises
12:10 Kopharex ok
12:10 celeron55 some create eg. a humidity and temperature noise and base their biome selections on those
12:12 Kopharex what if i have a container of biomes, dynamically added
12:12 celeron55 i think the built-in "v5"/"v7" biome system uses something like that and dynamically allocates biomes to a 2d result space of those two noises... or something
12:13 Kopharex some biomes include conditions, right?
12:13 celeron55 https://github.com/minetest/minetes​t/blob/master/src/mg_biome.cpp#L86
12:13 Kopharex like the minecraft extreme hills biome
12:13 celeron55 this is how the built-in biome system decides which biome to use
12:14 celeron55 each biome has an ideal point in those two parameters and it picks the one that is closest to whatever the noises say at a given position
12:14 Kopharex i see
12:15 Kopharex thanks for the info, i'll try to work out a flowchart.
12:15 celeron55 i don't think minetest's internal implementations ever looks up anything from the biome when generating the ground shape
12:15 celeron55 but of course a fancier system could
12:16 OldCoder joined #minetest-dev
12:17 celeron55 you'll need to strike a balance between useless and useful complexity; useless complexity tends to make things slower and hard to understand and tune
12:18 Kopharex i was also thinking that being indipendent units chunks would be perfect for threaded optimization
12:19 celeron55 yeah it is; note that when you generate for example trees, the trees must be able to be placed between the chunks so that parts of them are on both of them
12:19 celeron55 you need some kind of a merge algorithm at the end
12:20 celeron55 or some other way of dealing with it
12:20 Kopharex couldn't you just pick a block and generate the structure around it?
12:20 celeron55 MT's multithreaded generation is kind of broken at the moment because that functionality is a bit broken
12:21 celeron55 pick a block?
12:21 Kopharex yeah, pick a block that satisfies a set of condiotions
12:21 Kopharex like if you wanted to create a mineshaft
12:22 celeron55 you mean, avoid crossing the chunk edges?
12:22 Kopharex no, just using the block as a reference point
12:22 celeron55 oh or are you referring to the way MC generates structures?
12:22 celeron55 that's indeed a possibility
12:23 Kopharex say i want to generate a tree, i pick a block on the ground, put a log there, get the one on top of it and put another log there
12:23 Kopharex seems more elegant to me
12:24 celeron55 i mean, minecraft generates structes so that it re-generates them as many times as how many chunks they can possibly touch, and always discards the generation that would go on a neighboring chunk
12:24 celeron55 in that case you can't ever cheat at all and everything must use predictable seeded pseudorandom algorithms
12:25 Kopharex ok
12:25 celeron55 (otherwise the neighboring chunks won't connect properly)
12:25 celeron55 structures*
12:26 celeron55 that's fully threadable though, so you might want it
12:39 Kopharex i was reading about the simplex perlin noise
12:39 Kopharex it is a registered patent
12:39 Kopharex it means i can't use it for commercial purposes, right?
12:40 celeron55 dunno; we use just the regular stuff
12:40 Calinou is it still patented today?
12:40 celeron55 oh wait, we actually support simplex too
12:40 Calinou https://en.wikipedia.org/wiki/Simplex_noise
12:41 Calinou “Uses of implementations in 3D and higher for textured image synthesis are covered by U.S. Patent 6,867,776
12:41 Calinou , if the algorithm is implemented using the specific techniques described in any of the patent claims.”
12:42 Kopharex so...?
12:43 celeron55 well, personally i don't care
12:45 Kopharex If i manage to create such a library i'd like to be able to use it in commercial games as well
12:45 Kopharex and not get sued doing it
12:46 celeron55 the general answer to this is that you should ask an actual lawyer
12:46 ElectronLibre joined #minetest-dev
12:47 Kopharex I'll go with the classical noise just to be safe.
13:44 selat joined #minetest-dev
14:06 johnnyjoy joined #minetest-dev
14:40 hmmmm joined #minetest-dev
14:42 ElectronLibre joined #minetest-dev
15:05 VanessaE joined #minetest-dev
15:33 cib0 joined #minetest-dev
16:15 rubenwardy joined #minetest-dev
16:16 VanessaE minetest_gave devs:  what's the status of https://github.com/minetes​t/minetest_game/issues/451 ?
16:17 VanessaE (short version:  no-rotate flag for nodes for the screwdriver mod to check)
16:35 err404 joined #minetest-dev
16:57 MinetestForFun joined #minetest-dev
16:58 Amaz joined #minetest-dev
17:16 Krock joined #minetest-dev
17:30 Amaz joined #minetest-dev
17:37 rubenwardy joined #minetest-dev
18:13 kaeza_ joined #minetest-dev
18:33 Calinou celeron55, minetest.net seems to be having issues?
19:16 celeron55 well what the hell
19:16 celeron55 this server sucks
19:34 leat2 joined #minetest-dev
20:03 Darcidride joined #minetest-dev
20:27 Hijiri joined #minetest-dev
20:30 paramat joined #minetest-dev
20:33 ShadowNinja I noticed that the forum mixed content warnings are from the theme -- it's using the favicon and background image from the main site's theme instead of providing it's own.
20:34 ShadowNinja It shoudln't do that anyway since the sites are seperate, may have different themes, and shouldn't have their availability tied together,
20:37 paramat any thoughts on #2662 ? back later
20:37 ShadowBot https://github.com/minetest/minetest/issues/2662 -- Make cloud radius settable in .conf
20:37 paramat left #minetest-dev
20:38 Amaz joined #minetest-dev
20:56 err404 joined #minetest-dev
21:34 jin_xi joined #minetest-dev
21:34 Wayward_Tab joined #minetest-dev
21:39 Darcidride joined #minetest-dev
23:55 hmmmm hmm
23:56 hmmmm i'd like to move away from making new settings
23:56 hmmmm we have too many settings the way it is and each of them are quite game-specific to begin with

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