Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
100 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

Creating Virtual Worlds


Foreword - How it was, how it shouldn't be, how it should be...

Normally you are paid as a more or less talented individual to implement the level idea into a working game world. That applies wether you build a single player level, a multiplayer one, a strategy map, or a massive multiplayer online world. You then normaly would build the level out of single vertices, polygons, or brushes like cubes/wedges etc. After laying the general layout, you add lights, objects, add story elements and puzzles, connect buttons, etc.

At some point your lead designer approaches you (imagination of this approach is left up to the reader :-) and asks you to make a few changes. Add one more room, don't use that texture, no, this object is too big, we need fewer polygons. You practically redo your level a couple of times. Given a hard timeframe, probably buggy tools, lame programmers that won't implement your cool ideas into the scripting language but eat pizza instead - all that lets you grow gray hair. So we want to do it a bit different this time...

Instead of bothering with single brushes, or objects or polygons, we will only work with Cells.

Basically it goes like this:

Our world consists of a cube cell, which is split up into child cells. This is done recursively until we no longer want to split, and then the cell is generated as a room (or left empty).

Each cell has properties to describe its appearance, size, name etc. The parameters that describe the cell's room are inherited by all its child cells, where they can be overwritten.

Also each cell has Things that can be placed in it. Things can also be inherited by child cells, to make it easier to place a thing in each of the subcells.

But let's start simple and make a world that consists of only a single room:



A single room


Contents
  Introduction
  What you need
  How it was...
  A single room
  Two rooms
  Three rooms over the edge
  Another brick in the wall
  Doorways to Heaven
  Redefine the world
  Links, routes, etc.
  More ideas
  Afterword

  Printable version
  Discuss this article