Entities are the second major component of Quake MAP files. An entity is basically a bit like a thing, but they also function as triggers and as pathmarkers. Adding entities will affect your build time, because solid entities (monsters, weapons, armor, ammo, health) have to be lit, so that's one more item for LIGHT to deal with. A map with 30 lights can shoot to 200 entities for Light.exe to process once you put in monsters, armor, weapons, and ammo.
There are two types of entities, a general entity statement and an attached entity statement. The general statement does not attach to a brush and includes things like armor, weapons, ammo, monsters, and lights. Attached entities are things like doors, teleporters, and triggers.
In BSP, you add entities with a dedicated Entities window:
Select the entity you want from the pull down menu at the top. Right below it is a brief description of what that entity is. Make sure to scroll down in that window, because it will have more info than is immediately visible. Complex entities with multiple spawnflags will list all of the keys and the values that can be entered. See more below in the section on Spawnflags.
Be careful not to let the entity get stuck in a brush. If it's stuck in the brush, chances are the item will fall out of the map or you'll get an error in QBSP.
Right below the Entity description are the Not In Spawnflags, listed as a bunch of checkboxes. As the above picture shows, the Not in Easy, Not in Normal, etc. flags are there on the far right.
Below the spawnflags check boxes is a window that provides information on the Entity, not the least of which is the X/Y/Z position of the entity. This will be a huge help when you're dealing with items that fell out.
Attached entity brushes can have an "origin" tag. It can be used to offset where they appear in the level.
For the rest of the document, when I give you frameworks for a structure, the individual entries can be in any order, and lots are optional. I try to mark if an entry is optional, although this has not yet been rigorously tested.
In a "" block, your choices for that block are delimited by commas.
I believe that anything with an origin tag can have an optional 'spawnflags' tag. This is not confirmed, however. Tags can be combined by addition or bitwise or (really the same thing).
The spawnflags will vary from one entity to another. For health items, the direction is not used. In BSP, the default for health items is normal, ie. 25 HP. Checking "rotten" makes it 15 HP (and if you scroll down in the info box you'll see it), and "megahealth" makes it 100 HP. The four checkboxes, as I said, are to make the health item not available on a certain skill level.
A trick: Add two health items in the same area. For the 25 HP one, select "!Hard." For the second health item, select "Rotten" and "!Easy" and "!Normal." This way, Easy and Normal gives the player a 25 HP health. Hard gives them only 15 HP.
To place an entity, you have to make your entity by selecting it from the pulldown menu and clicking on "Make Entity." After that you can drag it around to place it as you like, and adjust the spawnflags as you see fit. Click on the Plus sign (+) to add or edit spawnflags. You'll be prompted to input a "Key" and "Value" in their appropriate entry windows. If you need to know an entity's spawnflags, just click on the question mark (?) on the Entities window.
Yahn provides pretty good online help for entities. In the top right corner is a Question Mark. If you click on it after making an entity, it will bring up all of the spawnflags that apply to that particular entity, and some basic information on the flag.
You can determine which way the player faces on startup, deathmatch start, teleport destination, which way the monsters face, and which direction nail traps fire. On the middle-left of the window is the direction setting. BSP sets the direction that player starts, teleport locations, and monsters will face using 360 degrees of rotation to determine which way the entity faces. The direction is based on an overhead x/y view and a 360 degree circle. 0 degrees is east/right, 90 degrees is north (or up on your screen), 180 is west (left) and 270 is south. Obviously you do this in perspective to your map setup.
These directions are also used for doors. Again, you use the 360 degrees for movement, plus a direction of -1 to go up and -2 to go down. Make it appropriate for the door and walls. There are also directions for northeast, northwest, southeast and southwest. For doors, click on "Up" and "Dn" to make the door go up or down.
If a door is in a north wall, make the door open by going west (180), east (0), or up or down. If you make it go south (270), well, that's lame. If it goes north, so it appears to be backing away from the player, make sure to give them enough room to get in and around it.
The direction settings affect almost any entity, except rotating items like armor, weapons, and keys. Using this, you can affect the following:
* Which direction the player faces on startup. * Which direction the play faces after teleporting. * Which direction monsters face. * The direction doors open. * The direction spike/laser traps shoot.
Platforms are not affected by this, because you use the target and targetname to dictate the direction of a path_corner entity. (more on that later)
With BSP, you place an entity by selecting the entity you want from a pulldown menu and clicking on "Make Entity." Most entities require minimal editing. That is, you can some times just place the entity and leave it be. For some entities, like a door or gate, you need a "target" and "targetname" to tie the two together. For example, you tie a func_button (a button) or any one of several trigger_ entities (triggers) to a func_door (door, gate) to open a door or gate. This will be discussed in later chapters.
For health items, the direction is not important. In BSP, the default for health items is normal, ie. 25 HP. Checking "rotten" makes it 15 HP (and if you scroll down in the info box you'll see it), and "megahealth" makes it 100 HP. The four checkboxes, as I said, are to make the health item not available on a certain skill level.
A trick: Add two health items in the same area. For the 25 HP one, select "!Hard." For the second health item, select "Rotten" and "!Easy" and "!Normal." This way, Easy and Normal gives the player a 25 HP health. Hard gives them only 15 HP.
Most entities are stand-alone. That is, things like direction or spawnflags are all you need. For some entities, like a door or gate, you might need a "target" and "targetname" to tie the two together. For example, you tie a func_button (a button) or any one of several trigger_ entities (triggers) to a func_door (door, gate) to open a door or gate. This will be discussed in later chapters.
The entities define the monsters, things, but also the positions in space where something must happen. So they are the Quake equivalent of both the THINGS and the LINEDEF types from DOOM.
The entity definitions are made up of a series of specific details that define what each is, where it starts, when it appears etc. Each specific is followed by a modifier that arguments it. All definitions have the classname specific that identifies that entity. The classname specifics relate intimately with the code lump and are the names of functions written in Quake C.
I have chosen the terms ``specific'' and ``arg'' for the two different parts of each detail of the definition. These terms may or may not suit but, they will have to do until we learn what id calls them.
-------------------------------------------------------------------------------- "classname" "name" // Type of entity to be defined (mandatory) "origin" "X Y Z" // Coordinates of where it starts in space. "angle" "#" // Direction it faces or moves (sometimes in degrees) "light" "#" // Used with the light classname. "target" "t#" // Matches a targetname. "targetname" "t#" // Like a linedef tag. "killtarget" "#" // Removes target when triggered? "spawnflags" "#" // Used to flag/describe an entity that is not default. "style" "#" // Used to flag/describe an entity that is not default. "message" "string" // Message displayed when triggered (\n for linebreaks) "mangle" "X Y Z" // Point where the intermission camera looks at
Note: The term model refers to a combination of a brush and an entity. One or more brushes are bound to an entity, which controls the behavior of the brushes. All brushes are contained within models.
The model numbers in the compiled BSP (*x) comes from the order in which the models are stored in the models structure. These numbers are originally derived from the order of the models in the source MAP file.
The worldspawn model is a bounding box that defines the extents of the whole world.
The models are defined by a bounding box of the max and min(x,y,z). Therefore they are always parallel to the horizontal planes. This bounding box is simply used for speeding up collision detection and will not affect the movement of the models themselves.
It dawned on me that these haven't been well defined in this page. So let's run them down, so when I make references to them further on in the page you aren't left wondering what it is in the first place.
air_bubbles : Rising bubbles ambient_drip : Dripping sound ambient_drone : Engine/machinery sound ambient_comp_hum : Computer background sounds ambient_flouro_buzz : Flourescent buzzing sound ambient_light_buzz : Buzzing sound from light ambient_suck_wind : Wind sound ambient_swamp1 : Frogs croaking ambient_swamp2 : Slightly different sounding frogs croaking ambient_thunder : Thunder sound event_lightning : Lightning (Used to kill Cthon, shareware boss) func_door : Door func_door_secret : A door that is triggered to open func_wall : A moving wall? func_button : A button func_train : A platform (moves along a "train") func_plat : A lift/elevator func_dm_only : A teleporter that only appears in deathmatch func_illusionary : Creates brush that appears solid, but isn't. info_null : Used as a placeholder (removes itself) info_notnull : Used as a placeholder (does not remove itself) info_intermission : Cameras positioning for intermission (?) info_player_start : Main player starting point (only one allowed) info_player_deathmatch : A deathmatch start (more than one allowed) info_player_coop : A coop player start (more than one allowed) info_player_start2 : Return point from episode info_teleport_destination : Gives coords for a teleport destination using a targetname All item_ tags may have a target tag. It triggers the event when the item is picked up. item_cells : Ammo for the Thunderbolt item_rockets : Ammo for Rocket/Grenade Launcher item_shells : Ammo for both Shotgun and SuperShotgun item_spikes : Ammo for Perforator and Super Perforator item_weapon : Generic weapon class item_health : Medkit item_artifact_envirosuit : Environmental Protection Suit item_artifact_super_damage : Quad Damage item_artifact_invulnerability : Pentagram of Protection item_artifact_invisibility : Ring of Shadows (Invisibility) item_armorInv : Red armor item_armor2 : Yellow armor item_armor1 : Green armor item_key1 : Silver Key item_key2 : Gold Key item_sigil : Sigil (a rune) light : A projected light. No visible lightsource. light_torch_small_walltorch : Small wall torch (gives off light) light_flame_large_yellow : Large yellow fire (gives off light) light_flame_small_yellow : Small yellow fire (gives off light) light_flame_small_white : Small white fire (gives off light) light_fluoro : Fluorescent light? (Gives off light, humming sound?) light_fluorospark : Fluorescent light? (Gives off light, makes sparking sound) light_globe : Light that appears as a globe sprite monster_army : Grunt monster_dog : Attack dog monster_ogre : Ogre monster_ogre_marksman : Ogre (no different than monster_ogre) monster_knight : Knight monster_zombie : Zombie monster_wizard : Scragg (Wizard) monster_demon1 : Fiend (Demon) monster_shambler : Shambler monster_boss : Cthon (Boss of Shareware Quake) monster_enforcer : Enforcer monster_hell_knight : Hell Knight monster_shalrath : Shalrath monster_tarbaby : Slime monster_fish : Fish monster_oldone : Shubb-Niggurath (requires a misc_teleportrain and a info_intermission) misc_fireball : Small fireball (gives off light, harms player) misc_explobox : Large Nuclear Container misc_explobox2 : Small Nuclear Container misc_teleporttrain : Spiked ball needed to telefrag monster_oldone path_corner : Used to define path of func_train platforms trap_spikeshooter : Shoots spikes (nails) trap_shooter : Fires nails without needing to be triggered. trigger_teleport : Teleport (all trigger_ tags are triggered by walkover) trigger_changelevel : Changes to another level trigger_setskill : Changes skill level trigger_counter : Triggers action after it has been triggered count times. trigger_once : Triggers action only once trigger_multiple : Triggers action (can be retriggered) trigger_onlyregistered : Triggers only if game is registered (registered == 1) trigger_secret : Triggers action and awards secret credit. trigger_monsterjump : Causes triggering monster to jump in a direction trigger_relay : Allows delayed/multiple actions from one trigger trigger_push : Pushes a player in a direction (like a windtunnel) trigger_hurt : Hurts whatever touches the trigger weapon_supershotgun : Super Shotgun weapon_nailgun : Nailgun weapon_supernailgun : Super Nailgun weapon_grenadelauncher : Grenade Launcher weapon_rocketlauncher : Rocket Launcher weapon_lightning : Lightning Gun
The use of these entities will be discussed in other chapters.
Portions Copyright ©1996-97 Niklata and Thomas Winzig.