The Gaming Den Forum Index The Gaming Den
Welcome to the Gaming Den.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Google
 Search WWW   Search tgdmb.com 
DSMatticus Want Make Vidya Gaem
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    The Gaming Den Forum Index -> I Gave the Mouse a Cookie...
View previous topic :: View next topic  
Author Message
Leress
Prince


Joined: 07 Mar 2008
Posts: 2534

PostPosted: Sun Jan 10, 2016 9:10 pm    Post subject: Reply with quote Add User to Ignore List

http://notch.tumblr.com/post/3746989361/terrain-generation-part-1

http://www.gamedev.net/topic/657532-minecraft-terrain-generator/

http://www.engadget.com/2015/03/04/how-minecraft-worlds-are-made/
_________________
"Excuse me. You got your penis in my woman. Correct yourself."
Click here to see the hidden message (It might contain spoilers)


Last edited by Leress on Sun Jan 10, 2016 9:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
zeruslord
Knight-Baron


Joined: 07 Mar 2008
Posts: 573

PostPosted: Mon Jan 11, 2016 1:55 am    Post subject: Reply with quote Add User to Ignore List

The thing that needs to be true for a chunk is not that it can be generated without any information about other chunks, just that each stage of generation can be done with only information produced by earlier stages of other chunks. When you go to generate a chunk, you can produce the ground without looking at the full details of the ground of neighboring chunks. Then you look for the randomly generated special features in a specific order - probably biggest to smallest, with some discarding of incompatible features (if there's a castle, don't put a tree in it, that sort of thing), and some way of avoiding conflicts between features in the same tier without expanding the search area - one way to do this might be to check whether there are any in a certain bounding box (say, no castle with its northwest corner north of you or west of you that would overlap) and not place if there is one. Of course, now you are doing partial generation of a larger area (with more and more detail the closer it is to your chunk). Therefore, this needs to be repeatable - probably by having it be a function of the world seed plus the x-y coordinates. Also you might cache anything actually decided about neighboring chunks, but I'm not sure that's necessary.
Back to top
View user's profile Send private message
DSMatticus
Prince


Joined: 14 Apr 2011
Posts: 4938

PostPosted: Mon Jan 11, 2016 2:16 am    Post subject: Reply with quote Add User to Ignore List

Leress wrote:
http://notch.tumblr.com/post/3746989361/terrain-generation-part-1

http://www.gamedev.net/topic/657532-minecraft-terrain-generator/

http://www.engadget.com/2015/03/04/how-minecraft-worlds-are-made/

Those all touch on generating the landscape, but don't discuss generating (pseudo-)structures like trees and castles. It's a different problem - a block is just a point, and a point is guaranteed to occur in only one chunk. A castle is a 3d shape built out of blocks, and cannot be guaranteed to occur in only one chunk. Which introduces a new concern - coordinating world features across chunk boundaries. I know how games do the former, but have never really seen a gamedev blog about their approach to the latter.

Zeruslord wrote:
The thing that needs to be true for a chunk is not that it can be generated without any information about other chunks, just that each stage of generation can be done with only information produced by earlier stages of other chunks. When you go to generate a chunk, you can produce the ground without looking at the full details of the ground of neighboring chunks. Then you look for the randomly generated special features in a specific order - probably biggest to smallest, with some discarding of incompatible features (if there's a castle, don't put a tree in it, that sort of thing), and some way of avoiding conflicts between features in the same tier without expanding the search area - one way to do this might be to check whether there are any in a certain bounding box (say, no castle with its northwest corner north of you or west of you that would overlap) and not place if there is one. Of course, now you are doing partial generation of a larger area (with more and more detail the closer it is to your chunk). Therefore, this needs to be repeatable - probably by having it be a function of the world seed plus the x-y coordinates. Also you might cache anything actually decided about neighboring chunks, but I'm not sure that's necessary.

You're more or less describing what I've suggested - to place structures into the world with a series of initial passes over a larger area than the one you're actually creating and rendering for the player to see. Whether or not to do that in advance and cache it or to just do it over and over at runtime probably wouldn't make much of a difference, depending on how big an area you've decided to sketch - that sort of preliminary work would be an absolutely trivial amount of comp time relative to generating the terrain itself.
Back to top
View user's profile Send private message
tussock
Prince


Joined: 07 Nov 2009
Posts: 2533
Location: Here

PostPosted: Fri Jan 29, 2016 9:42 am    Post subject: Reply with quote Add User to Ignore List

Quote:
and cannot be guaranteed to occur in only one chunk

Just guarantee that they occur in the one chunk. So when randomly placing them, their bounding corners must be within the chunk, probably by a good few tiles so they don't inappropriately touch other similar features.

Trees meanwhile can edge right up to the neighbouring chunk, so you don't get natural corridors in your forests.

Angband used to generate levels in screen-size chunks, and the big special vaults just had code to make sure they could fit in their own chunk, as did all the smaller rooms, with corridors laid in last to ensure connectivity.
_________________
news://rec.games.frp.dnd
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The Gaming Den Forum Index -> I Gave the Mouse a Cookie... All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group