Map generation algorithms

galok
Member
 
Posts: 16
Joined: Sun Aug 07, 2016 18:22

Map generation algorithms

by galok » Mon Aug 08, 2016 13:48

We all know about minecraft decompiled sources, so called "Mod Coder Pack". So I want to ask, is MineTest map generation algorithms (v5, v6, v7) are based on decompiled Minecraft map generation algorithms or they are done from scratch?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Map generation algorithms

by rubenwardy » Mon Aug 08, 2016 13:57

Done from scratch, I'm pretty sure
 

User avatar
lightonflux
Member
 
Posts: 384
Joined: Mon Nov 11, 2013 07:22
In-game: lof

Re: Map generation algorithms

by lightonflux » Mon Aug 08, 2016 19:46

No MC code is in MT. No MT code is derived from MC code.
 

galok
Member
 
Posts: 16
Joined: Sun Aug 07, 2016 18:22

Re: Map generation algorithms

by galok » Mon Aug 08, 2016 20:39

Okay, I get it about the code. Tell me then, is there any point to read MC code after MT code (map generation), just how different they are? besides MC lack of comments and variable names. I mean, the result look quite similiar.
 

User avatar
qwertymine3
Member
 
Posts: 194
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: Map generation algorithms

by qwertymine3 » Mon Aug 08, 2016 22:56

galok wrote:Okay, I get it about the code. Tell me then, is there any point to read MC code after MT code (map generation), just how different they are? besides MC lack of comments and variable names. I mean, the result look quite similiar.

The biome placement code is very different to Minetest, however you don't need to read the code for this, this page covers it very well (look for the "grown biomes" section) http://mc-server.xoft.cz/docs/Generator.html.
Avatar by :devnko-ennekappao:
 

galok
Member
 
Posts: 16
Joined: Sun Aug 07, 2016 18:22

Re: Map generation algorithms

by galok » Mon Aug 08, 2016 23:36

qwertymine3, thank you! This seems to be a very informative article. It's already answered a few questions for me.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Map generation algorithms

by paramat » Tue Aug 09, 2016 04:52

I can confirm no core mapgens are derived from MC.
 

galok
Member
 
Posts: 16
Joined: Sun Aug 07, 2016 18:22

Re: Map generation algorithms

by galok » Wed Aug 10, 2016 00:19

have one more question on this topic. the point of generation algorithm is to generate exactly the same blocks in exact same chunk by demand, this also mean that order in which chunks are generated should not affect blocks that generated in specific chunks. Please, correct me if I'm wrong on this one, but else, if I get it right, then tell me: is use of a global random does kinda mess up this system? I mean this code in mapgen_v6.cpp:960
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
      // Put trees in random places on part of division
      for (u32 i = 0; i < tree_count; i++) {
         s16 x = myrand_range(p2d_min.X, p2d_max.X); // this one
         s16 z = myrand_range(p2d_min.Y, p2d_max.Y); // this one too

Position of trees would be different every time they will be generated for this chunk, right? (Implied that full chunk will be re-generated)
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Map generation algorithms

by paramat » Wed Aug 10, 2016 10:09

Most mapgens use pseudorandom randoms so will be deterministic, but for minor things like leaf randomness the random may not be deterministic.
 

galok
Member
 
Posts: 16
Joined: Sun Aug 07, 2016 18:22

Re: Map generation algorithms

by galok » Wed Aug 10, 2016 11:29

paramat, is there a particular reason for that?
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Map generation algorithms

by paramat » Thu Aug 11, 2016 14:39

I'm not sure which are deterministic and which are not, but it's possible some are not because they are so trivial, such as the randomness of leaves on a tree. Also mgv6 may be less deterministic because it's older code, newer mapgens have higher quality standards (thanks to hmmmm).
 

galok
Member
 
Posts: 16
Joined: Sun Aug 07, 2016 18:22

Re: Map generation algorithms

by galok » Fri Aug 12, 2016 23:56

paramat, okay, thank you, I think I got it. But which of the mapgens is a newest one? Judging from github it's a mapgen_v5.cpp, which was added at Nov 9, 2014. But a whole countdown thing from v6 and v7 is a bit tricky to understand. So which one is it?
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: Map generation algorithms

by twoelk » Sat Aug 13, 2016 01:32

Legendary past

then

-v5 was made
-v6 was created and made default, v5 was dumped
-v7 was made and released before finished, v6 stayed default
-v5 was recreated from scratch and readded, v7 was made better, v6 optimised and stayed default
-valleys was created as lua mapgen and then rewritten and added to Mintest core as new mapgen, v6 was further optimized and stayed default
-more mapgens where added such as fractals (forgot when mathgen was dumped)
-mgflat was extended and is somewhat of a complete mapgen now

new-v5, default-v6, prereleased-v7, valleys and many others are all alive and kicking
most games run with v6, some recommend or even need v7, some subgames don't care, others use singlenode and apply their own on top

I may have missed some or mixed up some of the timeline but it should give a general idea
Last edited by twoelk on Sun Sep 25, 2016 16:51, edited 1 time in total.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Map generation algorithms

by paramat » Sat Aug 13, 2016 07:07

^ That.

Newest is mgflat.
 

galok
Member
 
Posts: 16
Joined: Sun Aug 07, 2016 18:22

Re: Map generation algorithms

by galok » Sat Aug 13, 2016 18:28

twoelk, thank you, you're most certainly brought order into this matter.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 24 guests

cron