testing ore generation - make em glow

scottvee
Member
 
Posts: 18
Joined: Thu Jan 12, 2017 07:59
In-game: scottvee

testing ore generation - make em glow

by scottvee » Sat Jan 14, 2017 06:51

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. ;-)
 

User avatar
burli
Member
 
Posts: 1605
Joined: Fri Apr 10, 2015 13:18
 

scottvee
Member
 
Posts: 18
Joined: Thu Jan 12, 2017 07:59
In-game: scottvee

Re: testing ore generation - make em glow

by scottvee » Sat Jan 14, 2017 07:42

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.
 

User avatar
burli
Member
 
Posts: 1605
Joined: Fri Apr 10, 2015 13:18

Re: testing ore generation - make em glow

by burli » Sat Jan 14, 2017 07:53

Just replace your ore with glass for a test. You will see what I mean
 

User avatar
burli
Member
 
Posts: 1605
Joined: Fri Apr 10, 2015 13:18

Re: testing ore generation - make em glow

by burli » Sat Jan 14, 2017 08:19

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
 

scottvee
Member
 
Posts: 18
Joined: Thu Jan 12, 2017 07:59
In-game: scottvee

Re: testing ore generation - make em glow

by scottvee » Sat Jan 14, 2017 20:13

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.
 

User avatar
paramat
Developer
 
Posts: 3132
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: testing ore generation - make em glow

by paramat » Sat Jan 14, 2017 21:14

The ideal node to use is default:meselamp because it is 'glasslike' and glows, try it and see.
 

scottvee
Member
 
Posts: 18
Joined: Thu Jan 12, 2017 07:59
In-game: scottvee

Re: testing ore generation - make em glow

by scottvee » Sun Jan 15, 2017 05:34

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. ;-)
 


Return to Modding Discussion



Who is online

Users browsing this forum: GamingAssociation39 and 1 guest