Sign in to follow this  
TheRealDeal

Procedurally generated worlds

Recommended Posts

TheRealDeal    126
Hey guys,

I've been curious about this for awhile now but unable to answer it. I'm playing around with the idea of procedurally generated world and wondering if its possible to do them through game engines. I always have assumed that engines require an actual map/level file in a supported format, but is it possible to instead have them generate world on the fly similar to minecraft?

Thanks,
Justin

Share this post


Link to post
Share on other sites
nem123    122
Think about what you're saying for a minute, and maybe you'll come up with the answer yourself :)

Hint: Yeah, it can be done, prime examples are Diablo 1 & 2, but those are nowhere near the only two that uses procedural levels/world.

Share this post


Link to post
Share on other sites
TheRealDeal    126
Hmm...what throws me off is that I get the impression the engine loads the world once and then thats that, it knows everything about the level, the lighting on the map, where objects are placed.

I suppose maybe thats just how those particular games are designed? What would make sense to me is just having the engine build the next area based on the seed/parameters and basically just run a check on each game step to see if it needs to generate another piece of the world.

Logically it all makes sense to me there...I'm just stuck on the notion of how engines always have predefined maps from the start instead of having to build areas out of the blue during the games runtime.

One random stab in the dark here, but maybe that loading in the first place is just gathering the world data from the file (generate the world and save to a file, then load that in my case?) and then during the game steps the engine IS gathering each new area, it just grabs it from a predefined file created in some editor instead of from a file that was just created a function or two before?

Share this post


Link to post
Share on other sites
FableFox    699
yes, you can procedurally generate game world using engines, but that said engine must be modular enough to support that, and you might have a lot of coding ahead of you.

your question is very open, IMHO. did you code that game engine yourself?


This will help your open question.

http://en.wikipedia.org/wiki/Procedural_generation

Share this post


Link to post
Share on other sites
KulSeran    3267
Think about what you are asking for a min. What is this "engine" you are talking about?
Engines are those magical black boxes that gameplay and artists use to make game. But not everyone uses the same engine, and each engine comes with its own tool chain. Some engines are more "fully featured" for rapid FPS development for instance. Others are more suited to 2d tile or 2d platformer games. Asking "can you do this with engines?" is an obvious "yes", but that still doesn't say much. You'll have to drill down to the point of understanding what answers you really want are. Whats the actual question? Where are you stuck? What have you tried? Where have you looked?

Quote:

Hmm...what throws me off is that I get the impression the engine loads the world once and then thats that, it knows everything about the level, the lighting on the map, where objects are placed.

I suppose maybe thats just how those particular games are designed?

Yes, they are often designed that way. It's a simplicity thing. It is easier to pack everything into a blob and just load up everything in one go. Even when you do that, you could still be doing it procedurally. You just build up a level at a time. You could also go with modifying a game with streaming technology. Instead of loading the next area from the disk, you generate it.

It is also easier to direct the player experience when you have a pre-defined level. You know where the player will be, and how hard each encounter will be. Look at most FPS games. You just run down a linear path to the end. Every encounter is scripted, and every camera shot planned. Then look at something like Diablo 2. Diablo 2 used pre-defined tiles with lots of rules for how to place them. This resulted in random dungeons, yet each time you'd end up with something similar to what you had before. This is good for tuning the game. Then you can look at something like Minecraft or DwarfFortress. They just make entierly random zones. Your experience isn't directed, and is different every time you play because stuff may or may not be in the zone, and defiantly isn't in the same place. That goes against a game's ability to tell the same story to everyone. That isn't always a bad thing, but for many AAA titles it is.



Also, check out:
Inifnity (developed by Ysaneya here on gamedev).

Share this post


Link to post
Share on other sites
PrestoChung    334
Quote:
Original post by KulSeranThen you can look at something like Minecraft or DwarfFortress. They just make entierly random zones. Your experience isn't directed, and is different every time you play because stuff may or may not be in the zone, and defiantly isn't in the same place. That goes against a game's ability to tell the same story to everyone. That isn't always a bad thing, but for many AAA titles it is.


In the case of DwarFortress the user can provide a seed and be able to generate at least the same world. I don't know down to what local details might be random, but it could be just the common case of a game having random spawns, something not usually referred to as an example of procedural generation. Other games have persistent procedural worlds (Daggerfall, Noctis).

Share this post


Link to post
Share on other sites
TheRealDeal    126
In reply to you, KulSeran, I guess I'm just caught up with the notion that an engine is some all knowing entity that doesn't like to function without its preset knowledge, the level in this case.

To boil down to a very specific reason for asking this, what I'm looking for is an engine, library, what have you, that would relatively easily put me on a path towards displaying a large world that is generated around you as you move (this is where the minecraft part comes into play, although I'd like for view distance to be further then the loaded world so you don't see it happening).

I'm slowly developing a game that would have a completely randomly generated world, but I've never fiddled with a game engine besides dinking around with modding the Source engine once.

I'm not convinced that I need to go out and find an engine to do this sort of thing, but I'd rather know beforehand if engines are capable of this. Hopefully that's a bit more helpful...I apologize for this being a bit of an open and unspecific bit of questions.

Justin

Share this post


Link to post
Share on other sites
jyk    2094
This isn't really saying anything new, but in short, it depends on the engine. I can think of some engines with which creating a completely procedural environment would be relatively straightforward, and others where it'd be basically impossible. So, it really just comes down to choosing an appropriate engine (assuming you want to use an engine).

Also, generating content procedurally will of course have implications for what sort of techniques can be used. For example, lightmapping and real-time, procedurally generated content probably won't go together very well (real-time dynamic lighting effects such as vertex or per-pixel lighting would probably work better in this particular context, I think).

Share this post


Link to post
Share on other sites
TheRealDeal    126
Which engines are those?

The two things I'm interested in with this project are the ability to generate the world on the fly and also the lighting. I'd like to explore using more extreme contrast or saturation levels, heavy shadows, sun rays, clouds, maybe HDR or simulated HDR effects but if that knocks an engine out of the possibilities list that wouldn't be the end of the world.

Share this post


Link to post
Share on other sites
jyk    2094
Quote:
Original post by TheRealDeal
Which engines are those?
If that's in reference to my post, then an example of an engine that would lend itself to real-time generation of procedural content would be Unity, and an example of an engine that wouldn't would be the Q3 engine. (Q3 obviously isn't that current technology-wise, but it's a good example of the more rigid type of framework that you alluded to in your earlier posts.)

Share this post


Link to post
Share on other sites
TheRealDeal    126
Sorry yes, that was in reply to your post jyk. But funny thing, I had just been doing a fair amount of reading on Unity earlier this evening after seeing a few impressive games in progress through it.

Something I'm struggling with though is the editor. All the tutorials, examples, and videos are focused on using the integrated visual editor to modify your world right then and there. It shows you how to add this and that but all through the visual editor. This is where my meager understanding of engines is coming into play, but taking a shot, can I basically just download the engine, use Visual Studio for my programming needs, and then compile and run what I have without ever touching the visual editor?

For my needs I don't see the visual editor being all that critical.

Thanks for putting up with the questions guys!

Share this post


Link to post
Share on other sites
jyk    2094
Quote:
Something I'm struggling with though is the editor. All the tutorials, examples, and videos are focused on using the integrated visual editor to modify your world right then and there. It shows you how to add this and that but all through the visual editor.
Tutorials and introductory materials tend to focus on the editor because for many people that's the easiest and most intuitive way to interact with the engine (initially, at least). However, pretty much everything that can be done using the editor can also be done through scripting (and in fact advanced users will generally spend much more time coding than they will using the editor).
Quote:
This is where my meager understanding of engines is coming into play, but taking a shot, can I basically just download the engine, use Visual Studio for my programming needs, and then compile and run what I have without ever touching the visual editor?
Not really. There are licenses that include source code access, but that's probably not what you'd be looking at as a new user, and in any case that probably wouldn't be the best way to accomplish whatever it is you want to accomplish, IMO.

There's no need to avoid the editor in Unity. Even if most of the work is done in code, the editor allows you to organize and manipulate assets, diagnose and debug, playtest, tweak parameters, etc. No matter how code-oriented the project is, the editor still provides the basic interface through which you manage and organize your project. So no, you can't really avoid using the editor (in the general case), nor would you want to.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this