Open ghost opened 6 years ago
Heh, haven't even really published this mod yet and already an issue is filed. :)
I'm planning to have the mod create its own special "log" text file that contains the locations of intersections as a sort of map for the server administrator, but for the time being you can get that stuff in the regular output by uncommenting the minetest.debug call in init.lua inside the "context:carve_intersection" loop. The "points" that it's being fed are the coordinates of the intersections, with an additional "val" property that is used to pseudorandomly generate the intersection's name.
I'm also thinking of adding a hook to allow a server administrator to force an intersection to be generated at a particular location, if you want to have some predefined hubs to allow new players to get into the deep roads right away. Not in yet, obviously, but I can prioritize that if you think it'd be handy for your purposes.
I haven't done any serious work to tweak the density of the deep roads yet, so not surprised they're hard to find, during testing I've just stuck to an existing roadway and followed it wherever it went to find more. Before I release this mod I'll be needing to come up with a variety of presets for whatever playstyle people want - you could have rare, sparse intersections with kilometers between them or you could have a dense mesh of spaghetti lacing the underground, or anything in between that. Could even crank up the randomness and have some areas be dense and others be sparse. It will eventually be possible to have multiple separate deep road networks with different tunnel types and characteristics (eg, a dense mesh of narrow, shallow walking tunnels mixed with a sparse mesh of long-range rail tunnels that go deeper).
There are a few settings you can try tweaking to boost the density of the deep roads in the meantime. Try reducing the grid scale xz setting from 500 to 200, that should squish everything closer together. Don't set the grid scale below about 100 or so, and try to keep the y scale of the grid scale smaller than the xz scale, or you might wind up with tunnels getting cut off - I haven't stress-tested that part of the mapgen algorithm yet to determine what is safe. Map chunks are generated in 80-node cubes by default and the grid scale needs to be larger than that to ensure that it will always be able to reliably find neighbors that deep roads in this map chunk could be connected to. I'll expose some more parameters shortly.
Hey there, I've uncommented that debug call and eventually I've been able to find a large room with a mese lamp and a wooden sign; this is quite interesting for my game!
Shortly:
To sum up, I'm very interested in this mod 'cause I think it could be a dwarf-fortress/moria-like "biome" for those dwarves that I'd like to add to my game.
On the issues side, (yeah I know, I can be a royal pain ;) ) I think that there's some glitch in that debug call, for it keeps printing the same [s]coords[/s] location name over and over: https://gist.github.com/H4mlet/cfc387d29442ae337705e3478c7e3d6d which basically is a room, no tunnels found yet.
Weird. I'll do some debugging tonight and see if I can replicate that, but I'm seeing lots of tunnels locally so it may not be happening on my machine. deep_roads is still in a very raw rapidly-changing state so hopefully it'll just "go away" as I clean up the general mess (my programming mantra: first make it work, then make it good).
One reason the log may be filled with multiple instances of the intersection being generated is that mapgen needs to know about "nearby" intersections even if they're not actually in the area being generated, so every map chunk near the intersection will calculate its existence independently. I plan to add some caching to make it more efficient but just locating the intersections is a cheap operation so that's a long-term optimization.
I put together a change last night before bed that perhaps illustrates how configurable I'm wanting to eventually make this mod. Deep road networks are now defined by a single definition table that's provided as a parameter to a "register network" function that can be used for many separate networks on different (or overlapping) layers. One of the configuration hooks I was thinking of adding is a place where you can insert your own name-generation function. It'd be good to have some default functions included with the mod, though; I want Deep Roads to be usable "out of the box" as well as providing a toolkit for other modders to use. So I'll definitely take you up on that offer.
The existing "splice two random words together" approach has produced some fun names too, though, so I'll probably keep that available too. Not sure if anything will top the time I found the intersections "Vomittown" and "Pukebury" right next to each other. :) They can be a bit hard to say sometimes but they're usually easy to remember.
Hey, haven't been able to check the latest changes - I'm improving my old mods :6 - but managed to clean up the random string function; I suggest you to try it on a "on rightclick" test-node, I've thoroughly checked it but you never know! Here it is: random string function
I've added your name generator as an optional predefine. There's now a "name_generator" property on the network_def table that takes a function with a single parameter, a floating point value from 0-1 that acts as the seed for generating a name and returns a string. The two test tunnel networks currently defined in init.lua each uses a different name generator, the shallow pedestrian network uses yours and the deeper rail tunnels use the two-random-word one. I'll give the default predefined generators better names later.
It seems that using a seed reduces the number of combinations, I've tried the modified function with a "on right click" test node which sends in chat the generated random string; instead of generating always new ones, it sticks to a couple or four. Maybe using os.clock() as random seed would be a better choice?
I'll take a look at whether the seed isn't being used to generate entropy correctly, but it is necessary that the name function be able to deterministically generate a name from its input parameter. The mapgen function is run independently in each chunk that generates, so it uses a seed based in the location of the intersection to ensure that it "randomly" generates the same name each time it generates that particular intersection.
Ah! Got it, nevermind then.
Minetest 0.4.16, player:set_physics_override({speed = 5}), full view range, wireframe... I've been looking for a tunnel (between -10 and -2300) for about 30mins with no luck, even teleporting where the console notified the action-emerges.
Is there a way to receive a sort of notice ("debug mode") telling you where a tunnel is being placed? Something like "deep road placed @" would be enough. :)