- Updated UDMF spec to 1.1.

- Added -noautoload option.
- Added default Raven automap colors set. Needs to be tested because I can't
  compare against the DOS version myself.
- Extened A_PlaySound and A_StopSound to be able to set all parameters of the
  internal sound code.



SVN r1544 (trunk)
This commit is contained in:
Christoph Oelckers 2009-04-14 09:06:03 +00:00
parent 81c4773b46
commit 9040710e62
9 changed files with 547 additions and 421 deletions

View file

@ -1,4 +1,11 @@
April 13, 2009 April 13, 2009 (Changes by Graf Zahl)
- Added -noautoload option.
- Added default Raven automap colors set. Needs to be tested because I can't
compare against the DOS version myself.
- Extened A_PlaySound and A_StopSound to be able to set all parameters of the
internal sound code.
April 13, 2009
- Changed gravity doubling so that it only happens when you run off a ledge. - Changed gravity doubling so that it only happens when you run off a ledge.
April 10, 2009 April 10, 2009

View file

@ -1,5 +1,5 @@
=============================================================================== ===============================================================================
Universal Doom Map Format Specification v1.0 - 05/28/08 Universal Doom Map Format Specification v1.1 - 03/29/09
Written by James "Quasar" Haley - haleyjd@hotmail.com Written by James "Quasar" Haley - haleyjd@hotmail.com
@ -13,7 +13,7 @@ SlayeR
SoM SoM
et al. et al.
Copyright (c) 2008 James Haley. Copyright (c) 2009 James Haley.
Permission is granted to copy, distribute and/or modify this document Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation; or any later version published by the Free Software Foundation;
@ -21,6 +21,34 @@ et al.
=============================================================================== ===============================================================================
=======================================
Preface
=======================================
The Universal Doom Map Format specification is a collaborative effort to
create and maintain a cross-port standardized textual representation for Doom
engine maps.
The basic UDMF standard contains a superset of the features of all commercial
Doom engine games, and provides facilities for seamless extension in source
ports, allowing in-editor access to custom map data which would otherwise be
squirreled away in external lumps.
=======================================
Changes in v1.1
=======================================
This is version 1.1 of the UDMF specification, superceding the previous version
1.0 with the following adjustments:
* Added Preface.
* Grammar for identifiers altered to forbid initial numerals.
* Made use of true/false keywords for boolean-type fields more explicit.
* Rule added for user-defined fields.
======================================= =======================================
I. Grammar / Syntax I. Grammar / Syntax
======================================= =======================================
@ -31,7 +59,7 @@ I. Grammar / Syntax
block := identifier '{' expr_list '}' block := identifier '{' expr_list '}'
expr_list := assignment_expr expr_list expr_list := assignment_expr expr_list
assignment_expr := identifier '=' value ';' | nil assignment_expr := identifier '=' value ';' | nil
identifier := [A-Za-z0-9_]+ identifier := [A-Za-z_]+[A-Za-z0-9_]*
value := integer | float | quoted_string | keyword value := integer | float | quoted_string | keyword
integer := [+-]?[1-9]+[0-9]* | 0[0-9]+ | 0x[0-9A-Fa-f]+ integer := [+-]?[1-9]+[0-9]* | 0[0-9]+ | 0x[0-9A-Fa-f]+
float := [+-]?[0-9]+'.'[0-9]*([eE][+-]?[0-9]+)? float := [+-]?[0-9]+'.'[0-9]*([eE][+-]?[0-9]+)?
@ -42,6 +70,9 @@ I. Grammar / Syntax
Global assignments and named/indexed global blocks are the only top-level Global assignments and named/indexed global blocks are the only top-level
entities supported. Whitespace is strictly ignored. entities supported. Whitespace is strictly ignored.
Keywords are currently restricted to the values true and false, which are
used as the values of all boolean fields.
Comments are supported as C-style single and multi-line comments: Comments are supported as C-style single and multi-line comments:
// single line comment // single line comment
@ -68,10 +99,16 @@ block-level assignments, and block headers. Compliant parsers should attempt
to preserve as much of such information as is possible by using a flexible to preserve as much of such information as is possible by using a flexible
mapping such as hashing. mapping such as hashing.
Identifiers and keywords are to be treated as case insensitive. For purposes of forward compatibility, user-defined fields are restricted to
beginning with the string "user_", but are otherwise normal identifiers.
Implementing editors should not restrict the entry of custom field names to
those beginning with "user_", however, in order to avoid problems with
out-of-date configurations.
Identifiers and keywords are to be treated as case-insensitive.
A field which specifies "boolean" semantics shall accept keyword value A field which specifies "boolean" semantics shall accept keyword value
"true" to mean that the field is asserted, and keyword value "false" to true to mean that the field is asserted, and keyword value false to
mean that the field is unasserted. Keyword values can only be defined in mean that the field is unasserted. Keyword values can only be defined in
this specification, and not by implementing ports. Use quoted strings this specification, and not by implementing ports. Use quoted strings
instead. instead.
@ -213,6 +250,8 @@ they signify is not necessarily required, such as for ports which do not
implement Hexen support - all fields unknown to a given port should be implement Hexen support - all fields unknown to a given port should be
ignored and not treated as an error). ignored and not treated as an error).
All boolean fields take the keyword values true and false.
linedef linedef
{ {
id = <integer>; // ID of line. Interpreted as tag or scripting id. id = <integer>; // ID of line. Interpreted as tag or scripting id.

View file

@ -104,6 +104,15 @@ static BYTE StrifePaletteVals[11*3] =
187, 59, 0, 219, 171, 0 187, 59, 0, 219, 171, 0
}; };
static AMColor RavenColors[11];
static BYTE RavenPaletteVals[11*3] =
{
0x6c,0x54,0x40, 255, 255, 255, 0x74,0x5c,0x48,
75, 50, 16, 88, 93, 86, 208, 176, 133,
103, 59, 31, 236, 236, 236, 0, 0, 0,
0, 0, 0, 0, 0, 0,
};
#define MAPBITS 12 #define MAPBITS 12
#define MapDiv SafeDivScale12 #define MapDiv SafeDivScale12
#define MapMul MulScale12 #define MapMul MulScale12
@ -683,6 +692,7 @@ static void AM_initColors (bool overlayed)
{ {
DoomColors[i].FromRGB(DoomPaletteVals[j], DoomPaletteVals[j+1], DoomPaletteVals[j+2]); DoomColors[i].FromRGB(DoomPaletteVals[j], DoomPaletteVals[j+1], DoomPaletteVals[j+2]);
StrifeColors[i].FromRGB(StrifePaletteVals[j], StrifePaletteVals[j+1], StrifePaletteVals[j+2]); StrifeColors[i].FromRGB(StrifePaletteVals[j], StrifePaletteVals[j+1], StrifePaletteVals[j+2]);
RavenColors[i].FromRGB(RavenPaletteVals[j], RavenPaletteVals[j+1], RavenPaletteVals[j+2]);
} }
} }
@ -784,6 +794,28 @@ static void AM_initColors (bool overlayed)
XHairColor = DoomColors[9]; XHairColor = DoomColors[9];
NotSeenColor = DoomColors[10]; NotSeenColor = DoomColors[10];
break; break;
case 3: // Raven
// Use colors corresponding to the original Raven's
Background = RavenColors[0];
YourColor = RavenColors[1];
AlmostBackground = DoomColors[2];
SecretSectorColor =
SecretWallColor =
WallColor = RavenColors[3];
TSWallColor = RavenColors[4];
FDWallColor = RavenColors[5];
LockedColor =
CDWallColor = RavenColors[6];
ThingColor =
ThingColor_Item =
ThingColor_Friend =
ThingColor_Monster = RavenColors[7];
GridColor = RavenColors[4];
XHairColor = RavenColors[9];
NotSeenColor = RavenColors[10];
break;
} }
lastpal = palette; lastpal = palette;
@ -1433,7 +1465,7 @@ void AM_drawWalls (bool allmap)
lines[i].special == ACS_LockedExecuteDoor || lines[i].special == ACS_LockedExecuteDoor ||
(lines[i].special == Generic_Door && lines[i].args[4] !=0 )) (lines[i].special == Generic_Door && lines[i].args[4] !=0 ))
{ {
if (am_colorset == 0) if (am_colorset == 0 || am_colorset == 3) // Raven games show door colors
{ {
int P_GetMapColorForLock(int lock); int P_GetMapColorForLock(int lock);
int lock; int lock;

View file

@ -1605,7 +1605,7 @@ void D_DoomMain (void)
GameConfig->DoGameSetup (GameNames[gameinfo.gametype]); GameConfig->DoGameSetup (GameNames[gameinfo.gametype]);
if (!(gameinfo.flags & GI_SHAREWARE)) if (!(gameinfo.flags & GI_SHAREWARE) && !Args->CheckParm("-noautoload"))
{ {
FString file; FString file;

View file

@ -569,7 +569,8 @@ EXTERN_CVAR (Bool, am_drawmapback)
static value_t MapColorTypes[] = { static value_t MapColorTypes[] = {
{ 0, "Custom" }, { 0, "Custom" },
{ 1, "Traditional Doom" }, { 1, "Traditional Doom" },
{ 2, "Traditional Strife" } { 2, "Traditional Strife" },
{ 3, "Traditional Raven" }
}; };
static value_t SecretTypes[] = { static value_t SecretTypes[] = {
@ -591,7 +592,7 @@ static value_t OverlayTypes[] = {
}; };
static menuitem_t AutomapItems[] = { static menuitem_t AutomapItems[] = {
{ discrete, "Map color set", {&am_colorset}, {3.0}, {0.0}, {0.0}, {MapColorTypes} }, { discrete, "Map color set", {&am_colorset}, {4.0}, {0.0}, {0.0}, {MapColorTypes} },
{ more, "Set custom colors", {NULL}, {0.0}, {0.0}, {0.0}, {(value_t*)StartMapColorsMenu} }, { more, "Set custom colors", {NULL}, {0.0}, {0.0}, {0.0}, {(value_t*)StartMapColorsMenu} },
{ redtext, " ", {NULL}, {0.0}, {0.0}, {0.0}, {NULL} }, { redtext, " ", {NULL}, {0.0}, {0.0}, {0.0}, {NULL} },
{ discrete, "Rotate automap", {&am_rotate}, {3.0}, {0.0}, {0.0}, {RotateTypes} }, { discrete, "Rotate automap", {&am_rotate}, {3.0}, {0.0}, {0.0}, {RotateTypes} },

View file

@ -238,19 +238,48 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BasicAttack)
//========================================================================== //==========================================================================
// //
// Custom sound functions. These use misc1 and misc2 in the state structure // Custom sound functions.
// This has been changed to use the parameter array instead of using the
// misc field directly so they can be used in weapon states
// //
//========================================================================== //==========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlaySound) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlaySound)
{ {
ACTION_PARAM_START(1); ACTION_PARAM_START(5);
ACTION_PARAM_SOUND(soundid, 0); ACTION_PARAM_SOUND(soundid, 0);
ACTION_PARAM_INT(channel, 1);
ACTION_PARAM_FLOAT(volume, 2);
ACTION_PARAM_BOOL(looping, 3);
ACTION_PARAM_FLOAT(attenuation, 4);
S_Sound (self, CHAN_BODY, soundid, 1, ATTN_NORM); if (!looping)
{
S_Sound (self, channel, soundid, volume, attenuation);
} }
else
{
if (!S_IsActorPlayingSomething (self, channel&7, soundid))
{
S_Sound (self, channel | CHAN_LOOP, soundid, volume, attenuation);
}
}
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StopSound)
{
ACTION_PARAM_START(1);
ACTION_PARAM_INT(slot, 0);
S_StopSound(self, slot);
}
//==========================================================================
//
// These come from a time when DECORATE constants did not exist yet and
// the sound interface was less flexible. As a result the parameters are
// not optimal and these functions have been deprecated in favor of extending
// A_PlaySound and A_StopSound.
//
//==========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlayWeaponSound) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlayWeaponSound)
{ {
@ -260,11 +289,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlayWeaponSound)
S_Sound (self, CHAN_WEAPON, soundid, 1, ATTN_NORM); S_Sound (self, CHAN_WEAPON, soundid, 1, ATTN_NORM);
} }
DEFINE_ACTION_FUNCTION(AActor, A_StopSound)
{
S_StopSound(self, CHAN_VOICE);
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlaySoundEx) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlaySoundEx)
{ {
ACTION_PARAM_START(4); ACTION_PARAM_START(4);

View file

@ -160,11 +160,11 @@ ACTOR Actor native //: Thinker
action native A_MeleeAttack(); action native A_MeleeAttack();
action native A_ComboAttack(); action native A_ComboAttack();
action native A_BulletAttack(); action native A_BulletAttack();
action native A_PlaySound(sound whattoplay); action native A_PlaySound(sound whattoplay, int slot = CHAN_BODY, float volume = 1.0, bool looping = false, float attenuation = ATTN_NORM);
action native A_PlayWeaponSound(sound whattoplay); action native A_PlayWeaponSound(sound whattoplay);
action native A_FLoopActiveSound(); action native A_FLoopActiveSound();
action native A_LoopActiveSound(); action native A_LoopActiveSound();
action native A_StopSound(); action native A_StopSound(int slot = CHAN_VOICE); // Bad default but that's what is originally was...
action native A_PlaySoundEx(sound whattoplay, coerce name slot, bool looping = false, int attenuation = 0); action native A_PlaySoundEx(sound whattoplay, coerce name slot, bool looping = false, int attenuation = 0);
action native A_StopSoundEx(coerce name slot); action native A_StopSoundEx(coerce name slot);
action native A_SeekerMissile(int threshold, int turnmax); action native A_SeekerMissile(int threshold, int turnmax);

View file

@ -44,5 +44,28 @@ const int MRF_UNDOBYDEATH = 512;
const int MRF_UNDOBYDEATHFORCED = 1024; const int MRF_UNDOBYDEATHFORCED = 1024;
const int MRF_UNDOBYDEATHSAVES = 2048; const int MRF_UNDOBYDEATHSAVES = 2048;
// constants for A_PlaySound
enum
{
CHAN_AUTO = 0,
CHAN_WEAPON = 1,
CHAN_VOICE = 2,
CHAN_ITEM = 3,
CHAN_BODY = 4,
// modifier flags
CHAN_LISTENERZ = 8,
CHAN_MAYBE_LOCAL = 16,
CHAN_UI = 32,
CHAN_NOPAUSE = 64
};
// sound attenuation values
const float ATTN_NONE = 0;
const float ATTN_NORM = 1;
const float ATTN_IDLE = 1.001;
const float ATTN_STATIC = 3;
// This is only here to provide one global variable for testing. // This is only here to provide one global variable for testing.
native int testglobalvar; native int testglobalvar;

View file

@ -1,5 +1,5 @@
#include "actors/actor.txt"
#include "actors/constants.txt" #include "actors/constants.txt"
#include "actors/actor.txt"
#include "actors/shared/inventory.txt" #include "actors/shared/inventory.txt"
#include "actors/shared/player.txt" #include "actors/shared/player.txt"