Page 1 of 1

testing ore generation - make em glow

PostPosted: Sat Jan 14, 2017 06:51
by scottvee
I just thought of a very handy way to test the ore generation in a modpack I'm coding. I thought I should share, because it's really easy to do ...

Make the ore you're testing a light source. light_source=6 or 9. Now check it out ...

Go into Freemove mode, teleport down to the depth where you're testing your oregen code.

Here's what you'll see:
Image

You can see my test ores (the reddish lit-up areas) are fairly uncommon blobs of 6-8 blocks, as planned. They even contain ores, rarer ores with a slightly brighter glow. Good luck testing that in the dark...

Now this one:
Image

Just hovering so many blocks away, I can see that the same ore below -2000y spawns in bigger, less common clumps, exactly as planned.

This is VERY helpful for tweaking config files that might be tweaking ore generation. I create a new world, run my mod, it creates its config file in the world folder. Quit the game, edit the config file, then teleport down into solid rock in god mode and see if things light up the way I expected them to. An immediate visual view of the ore distribution has saved me endless hours of flying through dark caves looking, and gives a real spatial feel.

When I'm happy with the result, I will turn off the light_source property. Back to the pitch blackness with all the ores where I want them.

Thought I would share. ;-)

Re: testing ore generation - make em glow

PostPosted: Sat Jan 14, 2017 07:30
by burli
Make them glass. Works much better

Re: testing ore generation - make em glow

PostPosted: Sat Jan 14, 2017 07:42
by scottvee
ok, well I don't see how making something invisible would make it easier to see. In this case I could use two different light levels to see the ores spawning inside my custom stone blocks.

Re: testing ore generation - make em glow

PostPosted: Sat Jan 14, 2017 07:53
by burli
Just replace your ore with glass for a test. You will see what I mean

Re: testing ore generation - make em glow

PostPosted: Sat Jan 14, 2017 08:19
by burli
And another trick: go to the worlds folder and open your world. Edit the world.mt file. Replace backend = sqlite3 with backend = dummy. then you don't need to create new worlds again and again

Re: testing ore generation - make em glow

PostPosted: Sat Jan 14, 2017 20:13
by scottvee
Really interesting to hear some of these ideas. Almost 30 years of programming here but minetest is a whole new environment. At lunch now, will test later.

Re: testing ore generation - make em glow

PostPosted: Sat Jan 14, 2017 21:14
by paramat
The ideal node to use is default:meselamp because it is 'glasslike' and glows, try it and see.

Re: testing ore generation - make em glow

PostPosted: Sun Jan 15, 2017 05:34
by scottvee
Hi. I'm happy to test anything, mythbust anything. Here is the same oregen with one ore swapped with glass and one swapped with meselamps.

Image

The yellow areas are the meselamps, and the black zones are glass. The upside of this is that you can see these glassy blocks even inside solid rock. Simple lighting only shows in open cave areas.

My initial test of using different light levels to show ores spawning inside my veins of stone was good for that specific test ... but I was always wondering what was going on between the caves, for which glass and meselamps were really handy, and do show the full distribution, not just the cross-sections inside caves. I could swap and comment a lot of code to get my rare ores to spawn inside the thing I replaced their stone layers with, for more detailed testing. Could plan that way for a future mod, if needed.

That was a fun exercise. Hi, Paramat. ;-)