• Advertisement
Sign in to follow this  

how to make a game with randomly genarating map

This topic is 1862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
If you don't give us any details of your project, we can't do better than Google. Speaking of which, have you tried Google? What did you think of the information you found? How is it lacking? Perhaps you can put together a much better question after you have done some research.

Share this post


Link to post
Share on other sites
What kind of game are you talking about? Randomly generating a solar system for a space game is going to be different from generating a forest for a hunting game, a city for a commercial game or a tile based continent for a large RPG.

Share this post


Link to post
Share on other sites
Your question isn't very detailed, but if you wan't to create random "anything", you would use a random function for whatever language. The documentation for the language you are using should tell you what function to use. (look for stuff that says "rand" or "Math::Random") Really it's more about experimenting and figuring out how to randomly "grow" your environments by creating objects in random locations and having other objects generate from them randomly.

Share this post


Link to post
Share on other sites
If you want to be lazy, and if you're using a language like C or C++, you could use rand() or an equivalent if you really wanted, but that's not a particularly robust way to do it. One possible way I've found is to use pseudo-random number generation and just iterate through a fixed-size array that way, but you may or may not need that kind of implementation depending on your uses. Good part about that kind of thing is that it's blazing fast, and it's virtually random as far as the user cares since you're not revealing the deterministic logic to them directly. Edited by darkhaven3

Share this post


Link to post
Share on other sites
Perlin noise is often very useful for generating levels, although there isn't enough detail of the problem to know whether it's applicable to you. Regardless, it's worth learning about if you're doing randomised procedural generation of pretty much anything.

Share this post


Link to post
Share on other sites

If you want to be lazy, and if you're using a language like C or C++, you could use rand() or an equivalent if you really wanted, but that's not a particularly robust way to do it. One possible way I've found is to use pseudo-random number generation and just iterate through a fixed-size array that way, but you may or may not need that kind of implementation depending on your uses. Good part about that kind of thing is that it's blazing fast, and it's virtually random as far as the user cares since you're not revealing the deterministic logic to them directly.


FWIW, rand() is a pseudo-random number generator. When used with the same seed, it will generate the same random numbers over and over. However, in saying that, I still don't think your post makes any sense at all and doesn't cover how to create a random world at all.

Share this post


Link to post
Share on other sites
... And thus, a misconception I've had for years about what rand() is doing was today blasted out of my mind. Wow.

Share this post


Link to post
Share on other sites
Closing. I think we've set a new record with seven sequential requests for more information, but nothing added.

@coletastic, feel free to start another thread with a more detailed question.

Share this post


Link to post
Share on other sites

This topic is 1862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement