0 votes

Hello
How is procedural generation
Is the entire map being generated at the start of the scene?
Or partially generated when the player is walking?

in Engine by (46 points)

1 Answer

0 votes
Best answer

That depends on your use case.

if you want to create a little RPG world, say a dungeon or something similar, that could easily be done in one go when the game starts up.

For huge, "endless" procedural worlds like Minecraft, you'll usually generate the specific parts of the world around the player (also called chunks) on the fly and unload these when the player is far enough away, for memory and performance reasons.

by (78 points)
selected by

Exactly what I want is the second point
Are there ideas about generating the map piece by piece

A basic setup would be to have some kind of world manager that holds a list of chunks and their positions. A chunk could be e.g. a scene that you instantiate.
(You can use OpenSimplexNoise to get seamless terrain height.) From your post history, I see that you are already doing that, which is great.
Now you'd need to expand this concept to chunks. Each chunk should be able to generate itself. You can check the player position to see if he's getting close enough to a new chunk "grid" and generate new chunks acordingly. There are also open source projects doing that, I didn't check these extensively though, so your mileage may vary. By the way, search engines are powerful tools, use them! ;)

Thank you
I know about these sources
But I didn't check it well
Because of the confusion that occurs when reading a code that I did not write with my hand

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.