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
102 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


Section 7 - Links, routes and other unsorted things

Sometimes you want some things placed relative to each other. CoW already supports this and you can position, for instance a chair in front of the table. Whenever you move the table around, the chair will follow. (This works of course only prior to generating the level, once this is done, the chair/table become static. Although the Dark Engine is flexible enough to make a chair magically follow a given table...)

Another, more exciting feature is the automatic patrol routes. This is accomplished by CoW generating a structure along with the world which contains so called TerrainPoints (short TP). These are simply points in 3D space, that can be refered to by path and name of the cell they belong too. Per default each center of a cell and thing you add becomes a TP.

Although this doesn't sound too useful yet, it proves to be a very exciting feature, because the TP database presents the containment-relationship of the cells. For instance, the kitchen is contained in the lower story, which is contained in Lord Bafford's manor, which is contained in the south part of the city, which in turn, and so on.

So, if you want an AI to patrol from the kitchen to the garden, then back inside to the sitting room, you need only to give CoW the names, and the TP database will provide you with the 3D coordinates to visit. From that you can generate a patrol route automatically.

In the Dark Engine, patrol routes are rather easy, and yet they are not easy. When you build your level in the editor to be used by the game engine, you have to make it build a pathfinding database. This database enables the AI to find its way on its own. You need only to place some markers, link them and the AI will happily traverse from marker to marker, avoiding pitfalls, climbing stairs and even opening doors. But placing markers is tedious, and linking them is complicated and error-prone. Adding/removing some patrol points or creating another identical patrol route is nearly impossible without tearing your hair out.

The automatic patrol route generator of CoW will generate all the proper markers and links from the TP database. So whenever your terrain changes - which will be a lot given the fact that CoW makes this so easy - the route will still be alright. Even switching the kitchen with the sitting room will not make it invalid. Rerouting an AI is also very easy.

Flooding a cell will automatically flood all children of the given level, so setting entire parts of your world under water is very easy.



More ideas


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