ZDoom has various features for useful level designers not found in the
original Doom or Doom 2. Enclosed in the zip file is a demo.wad which
uses these features. It is not meant to be anything worth playing, but
is instead intended solely to illustrate some of these new features. To
see it, just start ZDoom with the "-file demo.wad" parameter and start
a new game.

I've also included a zdoom.wcf file to use with WadAuthor that supports
the new things in ZDoom. If you want to use it, you should edit it to
point to wherever you have ZDoom installed.


Contents
-----------------------------------------
1. The demo.wad
2. Textures
3. Sprites
4. DeHackEd Support
5. Music
6. The SNDINFO Lump (and Ambient Sounds)
7. The MAPINFO Lump
8. Stealth Monsters
9. Limits Removed


1. The demo.wad
===============
In MAP01, you start with two switches in front of you. The one on the
left is a regular exit and will take you to MAP46; the one on the right
is a secret exit and will take you to MAP29. Note that in ZDoom, the
only difference between a normal exit and a secret exit is the map they
take the player to, which can be set on a map-by-map basis. If you look
at the automap, you'll also notice that the map is named "ZDoom Demo
Start Map" and not "Entryway" (without using a DeHackEd patch!). Also,
between the two pillars is an ambient sound. This is the sound of a
cyberdemon's hoof that plays once every second at 70% of maximum
volume. If you move around, you should be able to hear it moving
between the left and right speakers. This would be useful for such
things as running rivers or crackling fires.

MAP46 uses a simple fog effect which is the same as that used in Hexen.
The fog need not be gray, but that's generally what looks best. Exiting
the map with the teleporter at the end of the map will return you to
MAP01.

MAP29 illustrates ZDoom's ability to properly tile wall textures that
aren't 128 pixels tall without the "tutti-frutti" effect. This only
works for textures that are 1, 2, 4, 8, 16, 32, 64, or 128 pixels tall.
This map also includes two world ambient sounds: a cyberdemon's hoof
stomping and the end-bosses scream which both get played at random
intervals. This is essentially what Heretic and Hexen used for their
ambient sounds.

All of the maps also use custom skies and background music. For MAP01,
the song is a very small MOD called "Happy Ending?". MAP46 uses another
small MOD called "Camels from Space". MAP29 doesn't use any new music;
it just plays the intermission music.


2. Textures
===========
In ZDoom, textures can now be up to 255 pixels tall and will properly
repeat if they are 1, 2, 4, 8, 16, 32, 64, or 128 pixels tall. Making
other height textures repeat properly would have slowed things down
too much, so they still exhibit the "tutti-frutti" if they are
repeated.


3. Sprites
==========
Sprites can now be up to 255 pixels tall, and can be contained in
PWADs (provided that they are between S_START and S_END or SS_START
and SS_END tags). In conjunction with a DeHackEd patch, this can be
used to create map things that are much taller than before.


4. DeHackEd Support
===================
ZDoom has complete support for DeHackEd patches except for a few text
string replacements. When ZDoom starts, it will look for a lump in
any of the loaded wad files named "DEHACKED". If it finds one, it
treats it as a DeHackEd patch and automatically loads it. (An
alternative patch can also be specified from the command line with the
-deh parameter.)

ZDoom also offers some new flags for things:

	Add to bits	Name in DeHackEd	Purpose
	-----------	----------------	-------
	268435456	28 [ ] Unused		Stealth Monster
	536870912	29 [ ] Unused		25% Translucency
	1073741824	30 [ ] Unused		50% Translucency

To create a thing that is 75% translucent, turn on both 25% and 50%
translucency.


5. Music
========
The original Doom could only play music in a format called MUS. ZDoom
can also play these, but it also supports playing MIDI and MOD files
and will automatically recognize them. The specific types of MODs that
ZDoom supports are the same types supported by the MIDAS Digital Audio
System (since ZDoom uses MIDAS for sound):

	- 4-channel Protracker modules plus 1-32-channel variants (.MOD)
	- 1-32 -channel Scream Tracker 3 modules (.S3M)
	- 2-32 -channel FastTracker 2 modules (.XM)
	- 1-64 -channel Impulse Tracker modules (.IT)

Currently, it does not support 2.14 format .ITs, so if you want to use
one of them, you will need to convert it with Impulse Tracker.

Large collections of MODs can be found at
ftp.cdrom.com/pub/demos/music/ and ftp.wustl.edu/pub/aminet/mods/.


6. The SNDINFO Lump (and Ambient Sounds)
========================================
ZDoom has support for special lump called "SNDINFO". This is similar to
the SNDINFO lump used by Hexen (which was in fact the inspiration for
this). Currently, ZDoom only uses SNDINFO for defining ambient sounds,
but I plan to extend its functionality to serve as a general means of
sound replacement as Hexen does.

As an example, here is the SNDINFO lump in demo.wad:

	AmbientSound1		dshoof
	BossHurting		dsbospn


	$AMBIENT 1 AmbientSound1 POINT PERIODIC 1.0 0.7
	$AMBIENT 2 BossHurting RANDOM 2.0 5.0 1.0
	$AMBIENT 3 AmbientSound1 RANDOM 1.0 3.0 0.5


A SNDINFO lump is a normal text file stored inside a wad file. It can
contain two types of entries: logical sound mappings and commands.
Comments are also possible by beginning them with '//'. Everything after
the comment marker until the end of the line will be ignored by ZDoom.
(If you have used Hexen's SNDINFO lump, note that comments do *not*
begin with ';'.) I haven't included any comments in the SNDINFO lump,
but you can see an example of them in demo.wad's MAPINFO lump (see
below).

Logical sound mappings are fairly simple. They are just a logical sound
name followed by the name of the actual sound to play. For example, the
demo.wad contains the following logical sound mapping:

	AmbientSound1		dshoof

In this case, "AmbientSound1" is the sound's logical name, and "dshoof"
is the name of the actual sound to play whenever ZDoom wants to play
the sound "AmbientSound1". (dshoof is in the DOOM I and II IWAD and is
the sound of a Cyber Demon stomping around)

Logical sound names must not start with a dollar sign ($), and if they
contain spaces, must be enclosed in quotes ("). Logical sound names are
also case-sensitive, so "AmbientSound1" is not the same as
"ambientsound1".

Commands all begin with a dollar sign ($). Currently, only one is
defined: $AMBIENT.

$AMBIENT
--------
Ambient is used to define an ambient sound and attach it to a map
thing. There are two different types of ambient sounds available: point
and world. Point sounds are attached to specific map things and will
only be heard by the player when he is near the map thing. World sounds
can be heard no matter where on the level a player is. Using either
type of ambient sound in your levels requires that you define them with
the $ambient command in the SNDINFO lump and also that you include a
corresponding thing on all maps that you want to use them. In the case
of point sounds, the thing is used as the exact location for the sound.
For world sounds, the presence of a thing indicates that that sound
should be played on that level. (Thus you can define several world
sounds and only have a few of them play on any given level.)

Both Heretic and Hexen use world sounds, while point sounds are new to
ZDoom.

The $ambient command has six parts. These are:

1. The command itself ($ambient).
2. The ambient sound it defines (1-64). ZDoom supports up to 64 ambient
   sounds, and this number is used to indicate which of those 64 this
   command is describing. To use this ambient sound in a map, add 8000
   to this number, and use that as the type of the thing in your level
   editor. (Refer to your level editor's documentation if you don't now
   how to use things that aren't in the original Doom.) For instance,
   if this number is 1, then use a map thing of 8001 anywhere you want
   this sound to be used.
3. The sound's logical name. This must have already been defined with a
   logical sound mapping (see above). By using the same logical name
   with different ambient sounds, it is possible to use the same sound
   with different parameters. (See demo.wad for an example of this.)
4. The sound's type. This can be either "point" or "surround". "Point"
   indicates that this should be a point sound, while "surround"
   indicates that this is a world sound that should be played on the
   surround channel. The type can also be omitted entirely which
   indicates that this is a normal world sound.
5. How frequently the sound is played. This can be "continuous",
   "periodic", or "random".
   
   Continuous means that the sound should be continously played (not
   recommended for world sounds, but possible anyway).
   
   Periodic indicates that the sound should be played at a specific
   interval and is followed by the number of seconds that should elapse
   between repeats of the sound.

   Random indicates that the sound will repeat at a random interval. It
   is followed by two numbers indicating the minimum number of seconds
   that must elapse before the sound is played again and the maximum
   number of seconds that may pass before the sound is again played (in
   that order).
6. The sound's relative volume (0.0-1.0). 0.0 means that the sound is
   silent and never played. 1.0 means full volume. For point sounds,
   this is the volume that the sound will be played at when the player
   is standing right next to the corresponding thing. The further away
   the player is, the quieter the sound becomes. For world sounds, this
   is the volume that the sound will be played at no matter where the
   player is standing.

That may be confusing, so I will describe each of the $ambient
definitions in demo.wad, and hopefully that will make things easier to
understand:

	$AMBIENT 1 AmbientSound1 POINT PERIODIC 1.0 0.7

This line defines ambient sound 1. It uses the logical sound
AmbientSound1 which was earlier defined as being the Cyber Demon's
hoof stomping sound. The logical name is followed by the word "point",
so ZDoom knows that this is a point sound, and it will play it at any
thing of type 8001 on the map. Following this is "PERIODIC 1.0" which
indicates that this sound will be played at a rate of once per second.
Finally, the 0.7 at the end of the line indicates that this sound is
played at 70% of maximum volume.

	$AMBIENT 2 BossHurting RANDOM 2.0 5.0 1.0

This line defines ambient sound 2. It uses the logical sound
BossHurting which was earlier defined as being the sound of the big
boss's brain being struck by a rocket. Because the sound's type is
ommitted, it is treated as a normal world sound and will be played on
any maps that contain a map thing of type 8002. Next is
"RANDOM 2.0 5.0". This indicates that the sound will be played at a
random interval with no fewer than two seconds and no more than five
seconds passing between plays of the sound. The 1.0 at the end of the
line indicates that this sound is played at full volume.

	$AMBIENT 3 AmbientSound1 RANDOM 1.0 3.0 0.5

This line defines ambient sound 3. Like ambient sound 1, it also uses
the logical sound AmbientSound1. This time, though, the sound's type is
omitted, so we know a normal world sound is being defined rather than
a point sound as was the case with ambient sound 1. It will be used on
any maps containing a map thing of type 8003. (You can also use map
thing 8001 on the same map without any problems.) The "RANDOM 1.0 3.0"
indicates that the sound is played at a random interval between one and
three seconds, and the 0.5 at the end of the line indicates that the
sound is only played at half of maximum volume.


The MAPINFO Lump
================
ZDoom supports a special MAPINFO lump that can be used to define
special characteristics for the different maps. (Like SNDINFO, this was
also influenced by Hexen.) The MAPINFO for demo.wad is included below
(formatted for the width of this document):

	map MAP01 "ZDoom Demo Start Map"
	cluster 1
	music happyend
	sky1 SKY3 1.3
	par 10
	next MAP46
	secretnext MAP29

	map MAP46 "ZDoom Fog Example"
	cluster 2
	music camelsfr
	sky1 SKY2 0.0
	par 2400
	fade gray75	// gray75 is defined in the X11R6RGB lump
	next MAP01

	map MAP29 "Not-so-secret secret"
	cluster 1
	music d_dm2int	// Intermission music.
			// Just to show that it can be done
	sky1 SKY1 0.0
	next MAP01

	clusterdef 1
	// Leave this blank so that it doesn't do anything special
	// during the transition from another cluster to this one.
	// (i.e. when going from MAP46 to MAP01.)
	//
	// If we don't include a clusterdef 1, the cluster 1 defined in
	// the ZDoom executable will be used, which is for Episode 1 of
	// DOOM I. Not desirable, especially since this WAD is meant
	// for DOOM II.

	clusterdef 2
	music d_stalks
	flat flat5_6
	// Note that the entertext and exittext messages must be
	// enclosed in quotes. Unfortunately, that means you can't
	// use any quotes in your messages. Sorry.
	entertext
	"The next map is an example of using
	a gray fade to simulate fog. If you do
	this in any real levels, you should
	probably use a sky texture that doesn't
	stand out so much.

	Note that this map is actually MAP46
	and not MAP02!"
	exittext
	"now back to MAP01...

	Sorry, but you can't use this trick to
	create Hexen-style hubs (yet), since ZDoom
	restores the level to its original state
	with all monsters and items in place."

This lump contains two types of entries: map definitions and cluster
definitions which are indicated by the keywords "map" and "clusterdef"
respectively. Everything following one of these keywords up until the
next "map" or "clusterdef" is considered to be part of the definition
for a specific map or cluster.

A map definition begins with the word "map":

map <maplump> <nice name>
	Substitute the name of the map in the wad for <maplump>, and
	the map's nice name (shown in the automap) for <nice name>. If
	<nice name> contains spaces, it must be enclosed in quotation
	marks ("). <maplump> can be *any* lump in the wad, but since
	most editing utilities will only recognizes maps of the for
	MAP?? or E?M?, you should probably stick to those if you want
	to be able to edit the levels easily.

After the map line, the following properties are all valid (not all are
used by demo.wad):

next <maplump>
	<maplump> is the name of the map to move to when the normal
	exit is used. This should be the name of the map in the wad
	and not the map's nice name.

secretnext <maplump>
	<maplump> is the name of the map to move to when the secret
	exit is used. This should be the name of the map in the wad
	and not the map's nice name.

	Nextmap and secretmap also accept the special EndGame? names
	that indicate that ZDoom should end the game instead of
	continuing to another level. These are:
		EndGameC: The cast finale for Doom II.
		EndGame1: Displays the picture used after episode 1.
		EndGame2: Displays the picture used after episode 2.
		EndGame3: The bunny scroller after episode 3.
		EndGame4: Displays the picture used after episode 4.
	Note that using these will not display any text. To do that,
	use an "exittext" for this level's cluster. (See clusterdef
	below.)

cluster <number>
	<number> is the cluster that this map belongs to. See the
	clusterdef description below for more details.

sky1 <texture> <scrollspeed>
	<texture> is the name of the texture to use for the sky.
	<scrollspeed> is the rate at which the sky moves left or
	right (useful for clouds on windy maps). To keep the sky
	from moving, use a value of 0.0; to move it left, use a
	positive value; and to move it right, use a negative value.
	This is the number of steps that the sky moves each game tick.
	(There are 35 ticks in one second.)

fade <color>
	<color> is the color that things fade to the further away or
	"darker" they are. Normally, this is black, so that things
	seem darker as they get further away. To simulate fog (ala
	Hexen), set this to a gray instead. Other colors are also
	supported, but may not necessarily look very good.

	<color> can be either the name of a color (such as red or
	cyan) or a color descriptor of the form "RR GG BB". For
	example, to set the fade to red, both of the following
	will work:
		fade red
		fade "ff 00 00"

	To find a good fade within the game, you can use the testfade
	console command, which takes the same format as the fade
	property.

titlepatch <patch>
	This is the name of a graphic to display on the intermission
	screen for this level (such as CWILV00). It should contain the
	name of the level. If this is omitted, the intermission screen
	won't display the name of the level when you move to it or
	complete it.

par <partime>
	Partime is the number of seconds shown as the level's par in
	the intermission screen.

music <musiclump>
	<musiclump> is the name of the song to play while the player
	is playing the level.

nointermission
	This indicates that when the current level is finished, ZDoom
	should continue immediately to the next level without showing
	the intermission screen.

nosoundclipping
	This indicates that sounds should not be clipped on the current
	level no matter how far away they are.

allowmonstertelefrags
	This indicates that monsters can telefrag each other or the
	player on the current level. Normally, monsters will never
	telefrag anything.

map07special
	This level wants the special feature of Doom II MAP07. In this
	case, when every mancubus on the level dies, any sectors tagged
	666 will have their floors lower to the next lowest floor, and
	when every arachnotron on the level is dead, any sectors tagged
	667 will have their floors raised by the height of their lower
	textures.

baronspecial
	After every Baron of Hell on this level has died, a special
	action will be triggered.

cyberdemonspecial
	After every Cyber Demon on this level has died, a special
	action will be triggered.

spidermastermindspecial
	After every Spider Mastermind on this level has died, a special
	action will be triggered.

	The above three specials should also be used with one of the
	following three special actions:

specialaction_exitlevel
	Exits the level after all of the specified monsters has died.

specialaction_opendoor
	After all of the specified monsters have died, opens any doors
	tagged 666 with blazing speed.

specialaction_lowerfloor
	After all of the specified monsters have died, lowers the
	floors of all sectors tagged 666 to the next lowest floor.

sky2 and doublesky are also defined but are not yet supported.

A cluster definition begins with the word "clusterdef". For purposes of
ZDoom, clusters are used to displays messages when moving between maps.

clusterdef <cluster>
	<Cluster> is the cluster that this clusterdef defines. A cluster
	of 0 is used internally to mean "no cluster" and should be
	avoided.

After clusterdef, the following properties are valid:

entertext <message>
	<message> is a message to be displayed when the player has just
	finished a level in another cluster.

exittext <message>
	<message> is a message to be displayed when the player has just
	finished a level in a different cluster from the next one. If
	the next level's cluster has an entertext defined, then it will
	be shown instead of this cluster's exittext.

music <musiclump>
	This is the music to play while either the entertext or
	exittext of this cluster is displayed. For Doom I, this is
	normally D_VICTOR, and for Doom II, this is normally D_READ_M.

flat <flatlump>
	This is the name of the flat to use as a background while this
	cluster's entertext or exittext is displayed.


8. Stealth Monsters
===================
ZDoom contains the stealth monster code developed by Andy Baker before
he took over development of DOSDoom. (The next version of DOSDoom
should also support these.)

Stealth monsters act just like their normal counterparts with one very
important difference: They're not always visible. They start out
visible, but once they see the player, they become invisible, only to
be seen when they are attacking, hurt, or dead.

To use them in your own maps, refer to your editor's documentation for
using things that weren't in the original Doom. Following is a table of
stealth monsters and their types:

	Type	Monster
	----	---------------------
	4050	Stealth Arachnotron
	4051	Stealth Archvile
	4052	Stealth Baron of Hell
	4053	Stealth Cacodemon
	4054	Stealth Chaingunner
	4055	Stealth Demon
	4056	Stealth Hell Knight
	4057	Stealth Imp
	4058	Stealth Mancubus
	4059	Stealth Revenant
	4060	Stealth Shotgunner
	4061	Stealth Pistol Guy


9. Limits Removed
=================
ZDoom has removed the following limits from the original Doom:

	MAXVISSPRITES
	MAXVISPLANES
	MAXDRAWSEGS
	MAXSEGS
	MAX_ADJOINING_SECTORS (used in finding the next highest floor)
	MAXPLATS
	MAX_DEATHMATCH_STARTS
	MAXCEILINGS
	MAXSPECIALCROSS

There are still several other limits in ZDoom that I intend to deal
with in a future version.
