Building areas

This section discusses the area format used by Grendel, common practices when building, as well as various structures and constants used in areas.

Area format

Listed below is a sample area (actually a trimmed-down version of the roads.area file that is shipped with Grendel). Attentive readers will notice that the format of the area is quite similar to the format used in the SMAUG codebase.

A Grendel area file consists of several sections: #AREA, #ROOMS, #OBJECTS, #MOBILES and #RESETS. Of these, only the #AREA section is required.

Note

An integrated GUI area builder is currently in development, and a prototype can be found in the (highly experimental) Grendel Management Console.

Note

Since a switch to an XML area format is planned, this section is subject to change.

Example 2. An example area

#RANGES
100 199 100 199 100 199                                                         Hints for min/max rooms/mobiles/objects

#AREA
Central Ruia                                                                    Name of the area
Grimlord                                                                        Name of the owner/builder
A fresh wind blows through your hair.                                           Message to display when area resets
35                                                                              Number of gamerounds (roughly 75 secs) between resets
8 18 0                                                                          Temp. multiplier, avg. temperature, flags (see: Table 2, “Area flags”)

#ROOMS
#100                                                                            Number (vnum) of room
The Great Junction                                                              Name of room
The wind blows through your hair as you arrive at the great junction            Multiline room description
of roads, the central point in Ruia. Here, 3 roads come together.
To the south, the road to Southaven. To the north, the road to Gailen and
Castle Pakthan. To the east, you see the Warriors School.
~                                                                               Separator
0 0 500 3
D 101 3 0 0                                                                     An exit to room #101, direction (see: Table 4, “Directions”), flags (see: (Table 5, “Exit flags”)
E sign                                                                          Extra description "sign"
The sign says 'Southaven south'.                                                Multiline extra description
~                                                                               Separator
S                                                                               End of room #100
#101
Southaven Road
This road is one of the main roads leading through Ruia. It takes you
from the junction to Southaven or back. The road is paved well and
walking on this road is pleasant.
~
0 0 500 3
D 100 1 0 0
D 102 3 0 0
S
#102
Southaven Central Square
The beautiful fountain built on the square shows the welfare of the city.
Numerous little drops burst out of the fountain, falling down till they
hit the little pool of water. Many people come here to sit and eat or talk.
To the north, you see some shops. To the east, you see the bank. To the
west you see the town hall. To the south, you can continue to the docks.
~
0 0 500 2
D 101 1 0 0
S
#END

#MOBILES                                                                        Mobiles (NPC's) section
#100                                                                            Number (vnum) of NPC
Syra                                                                            Name
Syra is here                                                                    Short description
Syra, protectress of Southaven, patrols for danger                              Long description
800 1                                                                           Level, sex (see Table 1, “Sexes”)
15 521 0 0 0                                                                    Armour, flags (see Table 6, “NPC flags”), gold carried, height, weight
skill: Burning Hands                                                            NPC has skill "Burning Hands"
skill: Magic Missile
skill: Slashing Weapons
skill: Second Attack
> give.cod                                                                      Use GMC program "give.cod"
#END

#OBJECTS                                                                        Objects section
#100                                                                            Number (vnum) of object
a fountain                                                                      Name
a sparkling fountain                                                            Short description
a $B$7sparkling$A$3 $2brew$3 fountain has been placed here                      Long description (note the use of coloring!)
12 none none                                                                    Item type (see Table 3, “Item types and values”), bodyparts to wear object on (see the section called “Races”)
0 0 12 0                                                                        value[1..4] (see Table 3, “Item types and values”)
0 4097 0                                                                        Weight (in ounces), flags (see Table 8, “Object flags”), avg. cost 
#101
a robe
a stained robe
a robe, cluttered with dirty stains, lies here
1 body none
0 2 2 0
0 0 0
A "" 0 { apply_max_hp 20 }
#END

#RESETS
M 100 102 1
G 101 100 0
O 100 101 1
#END

$

Some notes on NPC's

Non-Player Characters (NPC's) are the artificially intelligent (sic) population, possibly even the core, of a mud. They are sometimes called "Mobiles", which, apart from the unfortunate name collision with certain wireless devices, wrongfully suggests that NPC's can't be forced to stay in one place.

NPC's can be quite a challenge for your players, so try to be careful when tinkering with the various values that define a NPC: balance is everything.

Installing a new area

Start a text editor (such as Notepad), and open the file areas\area.list. Add a line with the filename of your new area to the top of the file, save the file, and reboot (or copyover) the server.

Using ANSI color codes

Grendel supports the formatting and sending of ANSI (color) control codes. This can be very helpful, especially when constructing objects, where the intensity of the coloring usually determines the value and worth of the object.

Example 3. Using colors

$A$0black
$A$1blue
$A$2green
$A$3turquoise
$A$4red
$A$5purple
$A$6yellow
$A$7gray
$B$0dark gray
$B$1bright blue
$B$2bright green
$B$3bright turquoise
$B$4bright red
$B$5bright purple
$B$6bright yellow
$B$7white

Tables, constants and structures

Table 1. Sexes

DescriptionValue
Male0
Female1
Genderless (It)2

Table 2. Area flags

IdentifierDescriptionBitvectorValue
AREA_NORESETDo not reset areaBV001
AREA_NOPCNo players allowedBV012
AREA_PROTOPrototypeBV024

Table 3. Item types and values

IdentifierDescriptionValueUse of value[1]Use of value[2]Use of value[3]Use of value[4]
ITEM_WEAPONWeapon1conditionnumber of dicesize of dicetype of weapon (see: Table 9, “Weapon types”)
ITEM_ARMORArmor2conditiontype of armor (see: Table 10, “Armor types”)modifierunused
ITEM_FOODSomething edible3conditionpoisonedhours of valueunused
ITEM_DRINKContainer filled with some liquid4capacitycurrent quantityliquid type (see: Table 11, “Liquids”)poisoned
ITEM_LIGHTLight (i.e. torch)5hours of light remaining (0 = out)unusedunusedunused
ITEM_TRASHTrah6unusedunusedunusedunused
ITEM_MONEYGold coins7amountunusedunusedunused
ITEM_SPECIALSpecial item8unusedunusedunusedunused
ITEM_GEMMagical gem9mana type (unused)spell levelmana when chargedunused
ITEM_CONTAINERContains other objects10unusedunusedunusedunused
ITEM_CORPSECorpse of killed (N)PC11unusedunusedunusedunused
ITEM_FOUNTAINFountain12unusedunusedliquid type (see: Table 11, “Liquids”)unused
ITEM_BLOODBlood trail13direction of blood trail (see: Table 4, “Directions”)unusedunusedunused
ITEM_PORTALPortal14unusedunusedunusedunused
ITEM_KEYKey15unique key numberunusedunusedunused

Table 4. Directions

IdentifierDescriptionValue
DIR_NORTHNorth1
DIR_EASTEast2
DIR_SOUTHSouth3
DIR_WESTWest4
DIR_DOWNDown5
DIR_UPUp6
DIR_SOMEWHERESomewhere (i.e. for portals)7

Table 5. Exit flags

IdentifierDescriptionBitvectorValue
EX_ISDOORExit is a doorBV001
EX_CLOSEDClosedBV012
EX_LOCKEDLockedBV024
EX_PICKPROOFLockpick will failBV038
EX_SECRETHidden exitBV0416
EX_SWIMCharacter needs to swim to enterBV0532
EX_FLYCharacter needs to fly to enterBV0664
EX_CLIMBInclinationBV07128
EX_PORTALPortalBV08256
EX_NOBREAKCan't break doorBV09512
EX_NOMOBNPC's not allowedBV101024
EX_ENTERUse "enter" command to enterBV112048
EX_UNDERWATERUnder waterBV124096

Table 6. NPC flags

IdentifierDescriptionBitvectorValue
ACT_AGGRESSIVEAggressive (auto-attack) npcBV024
ACT_SENTINELDoes not wander (guard)BV038
ACT_SCAVENGERPicks up stray objectsBV0416
ACT_STAY_AREADoes not wander beyond area boundariesBV0532
ACT_HUNTINGActively hunts opponents when attackedBV0664
ACT_FASTHUNTFast hunterBV07128
ACT_MOBINVISInvisibleBV08256
ACT_TEACHERCan teach skills/spellsBV09512
ACT_BANKERBankerBV101024
ACT_SPIRITNon-magic weapons are ineffectiveBV112048
ACT_NOBASHImpossible to bashBV124096
ACT_SHOPKEEPShopkeeperBV138192
ACT_IMMORTALImmortalBV1416384
ACT_PROTOPrototypeBV312147483648

Table 7. Room flags

IdentifierDescriptionBitvectorValue
ROOM_DARKTotal darknessBV001
ROOM_DEATHDeathtrapBV012
ROOM_NOMOBMobiles not allowedBV024
ROOM_INDOORSIndoorsBV038
ROOM_GOODOnly good aligned players allowedBV0416
ROOM_EVILOnly evil aligned players allowedBV0532
ROOM_NOCASTUsing magic not allowedBV0664
ROOM_TUNNELTunnel (could cause problems for larger sized characters)BV07128
ROOM_PRIVATEMere mortals can not enterBV08256
ROOM_SAFEFighting not allowedBV09512
ROOM_SOLITARYOnly one character at a timeBV101024
ROOM_NORECALLRecall spell not allowedBV112048
ROOM_NODROPALLCommand "drop all" can not be used hereBV124096
ROOM_NOSUMMONSummon spell not allowedBV138192
ROOM_CLANSTOREClan storeBV1416384
ROOM_TELEPORTTeleportBV1532768
ROOM_NOFLOORNo floorBV1665536
ROOM_MANAROOMAccelerated mana replenishmentBV17131072
ROOM_NOTRADETrading not allowedBV18262144
ROOM_PROTOPrototypeBV312147483648

Table 8. Object flags

IdentifierDescriptionBitvectorValue
OBJ_NOPICKUPCan not be picked up (i.e. fountains)BV001
OBJ_GLOWObject glowsBV012
OBJ_HUMObject humsBV024
OBJ_ANTI_GOODCan only be worn by evil-aligned charactersBV038
OBJ_ANTI_EVILCan only be worn by good-aligned charactersBV0416
OBJ_LOYALStays with wearer (even when killed)BV0532
OBJ_NOREMOVECan not be removedBV0664
OBJ_NODROPCan not be droppedBV07128
OBJ_CLANOBJECTBelongs to a clanBV08256
OBJ_HIDDENHiddenBV09512
OBJ_POISONPoisonedBV101024
OBJ_MISSILEMissileBV112048
OBJ_NOSACCan not be sacrificedBV124096
OBJ_NODECAYDoes not decayBV138192
OBJ_PROTOPrototypeBV312147483648

Table 9. Weapon types

IdentifierDescriptionValue
FG_NONENo weapon0
FG_PUNCHPunch (fists of fury)1
FG_SLASHSlashing weapon (sword)2
FG_PIERCEPiercing weapon (knife)3
FG_CLEAVECleaving weapon (axe)4
FG_BLASTBlasting weapon (missile)5
FG_CRUSHConcussion weapon (morningstar)6
FG_BITEBite7
FG_CLAWClaw8
FG_WHIPWhip9
FG_STABAlias for FG_PIERCE10
FG_GAZEIf looks could kill...11
FG_BREATHFoul breath12
FG_STINGSting13

Table 10. Armor types

IdentifierDescriptionValue
ARMOR_HACHead armor1
ARMOR_BACBody armor2
ARMOR_AACArm armor3
ARMOR_LACLeg armor4

Table 11. Liquids

IdentifierDescriptionValue
LIQ_WATERPlain H2O1
LIQ_BEERBeer2
LIQ_ALEAle3
LIQ_WHISKEYScotch4
LIQ_VODKASchmirnoff5
LIQ_WINEWine6
LIQ_JUICEOJ7
LIQ_MILKMilk8
LIQ_TEATea, earl gray, hot9
LIQ_COFFEECoffee10
LIQ_COLACoca-Cola11
LIQ_SPECIALSpecial Brew12