Wednesday, 14 December 2011

UDK vs CryEngine 3 SDK: Creating a new level

Today, I'll look at how to create a level. Fairly straightforward, but what's interesting here is knowing what makes a level and what are the options available.

Why should I care?
Because, depending on the type of game the engine/level editor has been built for, some assumptions are made about the components of a level. And if we ever want to make something different, those assumptions may get in the way. We must know them to be able to circumvent them (if needed).

When you open the Unreal Editor, you get this:

A default scene with a floor, a box, a player start (spawn point), a sky light, a skydome and a Lightmass Importance volume (for lightmap baking). Basically, stuff you're likely to want when you create a level (except the box, probably). However, none of this is mandatory and you can get rid of all of it if you like.

Note that this is a new unsaved level that gets created from a template. When you click the "create new level" button, you're presented with the following window:

You've got the choice of several basic templates, which are basically the same thing with a different skydome and different lighting settings. It possible to create your own templates as well. As the name suggest, a blank map is empty. Or maybe not exactly.

Every single level in Unreal contains two objects: the WorldInfo and a default PhysicsVolume.

The WorldInfo is an object that, well, stores information about the world.

There a few noteworthy things to see here:

  • Many rendering options are set on a per-level basis.
  • A sub-object called MapInfo stores additional, game-related data.
  • The vertical limitations to the level are so that objects below a certain altitude will die (well those who can die), and object above a certain limit won't be able to go further up.
  • The game mode played in this map can override the default for the game (that's Unreal Tournament legacy stuff).
The default physics volume is a low-priority one that is supposed to dictate the global physics behaviour of the map. It can be deleted.

When you save your map, it creates one .udk file. As long as the file is in the Content folder of your game, it will be picked up by the Content Browser

In CryEngine 3 SDK
When you open the Sandbox editor, you get this:

In other words, nothing. If you want to do anything, you have to open an existing level or create a new one. So, to test stuff out, you'll have to have a test level set up as you can't just open the editor and mess around with it. This is serious business here!

When I create a new level, we're presented with the following window:

Err, terrain? What if I don't want one? Oh well, let's just click OK:

And water now? A very pretty looking water though. So yes, as the vast majority of Crysis's levels happened outside and on an island, the level editor assumes that you'll need a terrain, an ocean and a sky. That sounds perfect, but a bit annoying if I wanted to make a game set in space. As far as I'm aware, you can't get rid of neither the terrain nor the ocean. Tweaking the Time of Day settings should allow you to get the background and ambient lighting settings you need but that's one fiddling we could have avoided.

When you created the level, the editor automatically created a number of files in the Levels folder of the game data folder, the most important one being the .cry file, which is the main level file.

Well, even though this isn't a competition, I'd say that Unreal wins this round hands down. Having a level ready on editor start-up enables very quick functionality/idea tests, tough none of the mandatory elements imply a specific type of level. On the other hand, having things like rendering settings adjustable per-level is a  potential threat to consistency across the game. There's nothing notably good about the Sandbox Editor on that topic, except if you intend to do outdoorsy levels.

Next article will be about the tools available for whiteboxing.