25.12.2012 Views

Ultimate Game Design : Building game worlds

Ultimate Game Design : Building game worlds

Ultimate Game Design : Building game worlds

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Building</strong> <strong>Game</strong> Worlds<br />

138<br />

U L T I M A T E G A M E D E S I G N<br />

(www.ngweb.biz/software/djsedit.shtml), while others build custom script systems<br />

into a complete stand-alone tool. In the latter case, right-clicking an actor in a scene<br />

might bring up a series of “property” editing tabs that can be used to specify a number<br />

of details for selected actors. Some examples of these properties include<br />

� Actor’s patrol speed (How fast does the actor move in protecting a<br />

boundary?)<br />

� Actor’s patrol shape (Does the actor walk a box perimeter, a semicircle,<br />

or a custom shape?)<br />

� Actor’s hostility towards other actor types (Friend or foe? Attack or defend?)<br />

� Actor’s default offensive weapon choice (Laser fire? Space baton?)<br />

� Actor’s default defense (Use shield, roll into a ball, or self-destruct?)<br />

� Actor’s default wait-state (Tap foot, sit down, or rub eyes?)<br />

� Actor’s inventory specifics (Order of item use? Weapon priority?)<br />

� Actor’s response to attack (Fight till death, fight till damage = 80 percent,<br />

or fight till out of ammo?)<br />

� Actor’s specialized orders (Seek another actor, seek map position, seek level<br />

midpoint, seek ammo cache, return to camp, band together with closest similar<br />

actor, play cards/dice [or other humor element], summon help, cloak or hide,<br />

shadow or follow another actor, chase distraction, search for something until<br />

the search condition is met?)<br />

The properties listed here, as examples, as well as a vast number of other actor<br />

properties might be similarly editable in this fashion. You will often need tools programming<br />

support from a tools programmer to set up each of the properties you wish<br />

to edit, since ultimately your edits need to be reflected in the code when the <strong>game</strong> is<br />

recompiled or rebuilt.<br />

To provide you with a sample of what different scripting languages look like, this<br />

section translates a simple monster behavior script into JavaScript, Visual Basic,<br />

Python, and Perl. Throughout this chapter, I’ll show scripts in JavaScript most of the<br />

time, because it’s a well-supported scripting language with editors freely available,<br />

but Visual Basic and Python are also gaining in popularity.<br />

This script calls for the monster to attack the player if it sees the player, to pick up a<br />

weapon if it sees the weapon, and otherwise to simply patrol.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!