Minetest logo

IRC log for #minetest-dev, 2012-11-10

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

All times shown according to UTC.

Time Nick Message
00:00 celeron55 plus a few more 'm's
00:07 hmmmm where exactly does the 'gamedef' come into existance
00:07 hmmmm i can see the different defs being created in Server ctor but not the gamedef itself
00:08 hmmmm this is the sort of situation where globals would REALLY be helpful
00:08 hmmmm i am spending a lot of time trying to find the "right" places to put things
00:09 celeron55 oh 8)
00:09 celeron55 http://minetest.net/wiki/doku.php?id=code:general_architecture
00:09 celeron55 that does mention it
00:10 celeron55 the gamedef is an interface that is implemented by the Server and the Client classes (for the applicable parts)
00:10 hmmmm ohhhhh
00:10 hmmmm the server class itself IS the gamedef
00:10 hmmmm pffffffffftttttttthh
00:13 hmmmm why is IRollbackReportSink part of IGameDef and not simply Server?
00:13 hmmmm same with sound
00:19 celeron55 because IGameDef is automatically available where those functionalities are needed
00:19 celeron55 not Server, or Client
00:19 celeron55 it's the same pointer, but casting it for that would be silly
00:25 celeron55 IGameDef is kind of a "resource router" thing
01:13 hmmmm oh right
01:14 hmmmm so asynchronous reads of the map
01:14 hmmmm because you're using sqlite3 (or leveldb, or whatever), you're going to be io bound when the emerge thread could be doing something more worthwhile
01:14 hmmmm sitting there like a shmuck, waiting for the disk to do whatever
01:15 hmmmm so i've been thinking that there'll be instead of number_of_cores threads, there'll be number_of_cores + 1 threads
01:16 hmmmm it might be worthwhile to have a list of already existing blocks handy
01:16 hmmmm that way no disk access would be required to tell if you need to start generating or not
01:19 hmmmm if i understand correctly, JThread has some kind of mechanism to create worker threads
01:20 hmmmm i'm gonna have to try to set thread affinity if i want this to work the way i intended, which means OS specific stuff, which i'd rather just add to JThread
01:21 hmmmm i'm getting way too ahead of myself here
06:16 darkrose joined #minetest-dev
09:27 Calinou joined #minetest-dev
10:08 PilzAdam joined #minetest-dev
13:48 Calinou joined #minetest-dev
15:25 hmmmm joined #minetest-dev
15:34 doserj joined #minetest-dev
15:47 SpeedProg joined #minetest-dev
16:14 SpeedProg joined #minetest-dev
16:41 PilzAdam this patch exists for a long time and no problems appears while using, so i guess we can merge this upstream: https://github.com/celeron55/minetest/pull/286
16:43 PilzAdam it makes the digging animation look like you are actaullay digging
16:44 PilzAdam celeron55, what do you think?
16:59 hmmmm oh boy
16:59 hmmmm everything is built around the assumption that mapgen will never be an object
17:00 hmmmm so i think i may have a solution:  i make an emerge object and plop that into the gamedef or rather Server
17:01 hmmmm and that'll be able to access things such as water_level and the BiomeDefManager and what not that are needed by what otherwise would be static methods
17:01 hmmmm this has the potential to be elegant but i have to rip out even more machinery
17:03 hmmmm probably not too bad, this way the rest of the code gets an overhaul (although it stinks that i have to modify pretty much unrelated parts in order to get this working right)
17:07 hmmmm so perhaps i call this an EmergeDispatcher or EmergeManager or something... this is what you use to add blocks to the queue with - well, it'd be figuring out which mapgen thread to use based on some really simplistic scheduling (like maybe it gets added to the thread with the least number of blocks to process?)
17:09 hmmmm on that note, i think i'm going to go ahead with creating a std::map of all existing blocks on map load so i don't need to do any disk access at all to see if something needs generating or not
17:09 hmmmm so i'd have an EmergeDiskWorkerThread and multiple EmergeGenWorkerThread
17:10 hmmmm it's settled, i'll call it EmergeManager
17:11 hmmmm I think i'd like to split off all the emerge related code into a separate file, emerge.cpp
17:33 doserj joined #minetest-dev
17:52 doserj joined #minetest-dev
18:11 PilzAdam thexyz, what do you think about this? https://github.com/celeron55/minetest/pull/286
18:12 thexyz i've never tested that patch
18:13 PilzAdam you should, it looks very nice
18:13 thexyz ok
18:13 hmmmm all it does is change a couple constants around.  it doesn't really need to be tested
18:13 thexyz just to make sure it looks better
18:19 thexyz isn't it way too fast?
18:19 PilzAdam no, its actually slower than the current one
18:20 thexyz strange
18:21 thexyz how about that one? https://github.com/celeron55/minetest/pull/285
18:22 darkrose that seems awesome, wish I had 3D glasses
18:22 PilzAdam yea the idea is nice
18:24 PilzAdam thexyz, if you slow the animation down it may look strange with the cracks growing; because with the patch it grows ~ the same speed as you dig
18:24 doserj joined #minetest-dev
18:27 PilzAdam it also looks better when placing nodes
18:27 PilzAdam if you would slow it down the nodes would be placed faster than the animation
18:28 thexyz well, then ask someone else to test it
18:29 thexyz for me the current and the new one both look nice
18:29 PilzAdam darkrose, what do you mean about the digging animation?
18:31 darkrose what?
18:32 PilzAdam https://github.com/celeron55/minetest/pull/286
18:32 PilzAdam s/mean/think
18:32 darkrose ah
18:32 darkrose looks ok to me
18:32 PilzAdam so can i merge it?
18:32 thexyz still, i think that anaglyph patch should at least be capable of changing colors
18:33 darkrose PilzAdam: sure
18:33 darkrose https://github.com/celeron55/minetest/pull/284 <- is also good with me
18:35 PilzAdam i have talked a lot with RBA about that
18:35 PilzAdam about the next steps in formspec etc.
18:36 hmmmm eh...
18:36 hmmmm should be using istream to parse floats form a string, the alpha color should be 0,0,0
18:37 hmmmm or rather, console_color from the settings
18:39 thexyz stof()
18:40 thexyz from util/string.h
18:43 thexyz oh, it already uses that
18:45 hmmmm hrm, actually irrlicht documentation is vague on the point of the four colors that are the "corners of the rect" ?  since all four are 255,255,255,255, that's the same as the default, so really he doesn't need to use that version of the function
19:05 SpeedProg joined #minetest-dev
19:39 hmmmm grr..
19:39 hmmmm ServerMap is a big offender
19:40 hmmmm oh yeah, getBlockAsInteger needs to be fixed sometime but that'll break map file compatibility so it needs to be handled specially
19:41 PilzAdam better break some compatibility than keep bugs in the code
19:42 hmmmm it's a bug that nobody's seen before because nobody's gone out far enough in the map
19:42 hmmmm s/far out enough/high or deep enough/
19:42 hmmmm it absolutely needs to be fixed for the nether to work
19:42 PilzAdam does it cause any "visual" errors?
19:42 PilzAdam oh, okay
19:43 hmmmm (instead of being in a different dimension like minecraft, it's just a really low y point, like -4000 or whatever)
19:47 PilzAdam more like -10000
19:50 hmmmm huh?  no, bugs start happening around -4000
19:50 hmmmm ' return (sqlite3_int64)pos.Z*16777216 +
19:50 hmmmm (sqlite3_int64)pos.Y*4096 + (sqlite3_int64)pos.X; '
19:54 hmmmm ah man this is killing me... should i pass along an EmergeManager when creating ServerMap?
19:55 hmmmm it's incredible how many humungous changes i have to make because some abstraction was poorly designed early on
19:56 hmmmm i guess my real question ought to be this:
19:57 hmmmm is it a good idea to bind an EmergeManager (basically, set of mapgen objects and a biomedefmanager) to a specific ServerMap?
19:57 PilzAdam "Do not create large class hierarchies or use templates when not necessary. Procedural code in C is faster, more maintainable and more portable." from http://www.minetest.net/wiki/doku.php?id=contrib
19:58 PilzAdam maybe this helps to decide
19:58 hmmmm that's what he says but that's not what's possible
19:58 hmmmm i'm not exactly sure if this is a 'large class heirarchy' though
19:58 hmmmm so here's the simplified version of what i did:
19:59 hmmmm EmergeManager spawns a BiomeDefManager and then EmergeDiskWorkerThread and multiple EmergeGenWorkerThreads
20:00 hmmmm this EmergeManager object is to the associated with the Server which is a derived class of Gamedef
20:00 hmmmm but server-specific
20:00 hmmmm now, the ServerMap called static mapgen functions that are simply not possible to keep as static even though it'd be way easier
20:01 hmmmm specifically, initBlockMake which is in ServerMap for some reason, and findGroundLevel
20:02 hmmmm the comment for ServerMap says "this is the only map class that is able to generate map"
20:02 hmmmm so i am taking that as permission to make EmergeManager a member of ServerMap
20:06 hmmmm oh!  this is good, I don't need to change the constructor at all
20:07 hmmmm ServerMap already takes a GameDef
20:07 hmmmm but the downside is that if i don't want to cast this, i'd have to make the EmergeManager a part of IGameDef instead of Server
20:07 hmmmm i'm not really sure why ServerMap doesn't take a Server * anyway, since it's a *SERVER* map
22:17 SpeedProg joined #minetest-dev

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