After half an hour of DECORATE work and these minor changes the game worked perfectly with ZDoom but then I discovered an incompatibility between ZDoom's handling of carrying floors and Boom's (or Eternity's which CoD's engine is based on:
ZDoom averages the speed of scrolling floors so carried objects don't get accelerated on sector boundaries. The problem here is that this breaks CoD's carefully created conveyor belts which require Boom's original behavior.
So here's my entire CoD .diff patch. It adds a MAPINFO flag that restores Boom's original scrolling behavior (thus fixing CoD's conveyor belts) and a second flag that enables the two new sector specials (instant death - identical with Strife's and a healing sector.) in Doom-format maps. Of course the healing sector is also available for Hexen-format maps without need of that little hack.
It would be great if this could be added to ZDoom. After this all that is needed to run CoD is a 17kb WAD with 5 lumps.
Code: Select all
diff -urN .96fresh\src/g_level.cpp .96cod\src/g_level.cpp
--- .96fresh\src/g_level.cpp Fri Dec 24 21:43:15 2004
+++ .96cod\src/g_level.cpp Sun Jan 23 11:04:36 2005
@@ -224,6 +224,8 @@
"redirect",
"strictmonsteractivation",
"laxmonsteractivation",
+ "additive_scrollers",
+ "cod_level",
NULL
};
@@ -319,6 +321,8 @@
{ MITYPE_REDIRECT, lioffset(RedirectMap), 0 },
{ MITYPE_CLRFLAG, LEVEL_LAXMONSTERACTIVATION, LEVEL_LAXACTIVATIONMAPINFO },
{ MITYPE_SETFLAG, LEVEL_LAXMONSTERACTIVATION, LEVEL_LAXACTIVATIONMAPINFO },
+ { MITYPE_SETFLAG, LEVEL_ADDITIVE_SCROLLERS, 0 },
+ { MITYPE_SETFLAG, LEVEL_CAVERNS_OF_DARKNESS, 0 },
};
static const char *MapInfoClusterLevel[] =
diff -urN .96fresh\src/g_level.h .96cod\src/g_level.h
--- .96fresh\src/g_level.h Fri Dec 24 18:15:23 2004
+++ .96cod\src/g_level.h Sun Jan 23 11:01:50 2005
@@ -92,6 +92,9 @@
#define LEVEL_LAXMONSTERACTIVATION UCONST64(0x400000000) // Monsters can open doors depending on the door speed
#define LEVEL_LAXACTIVATIONMAPINFO UCONST64(0x800000000) // LEVEL_LAXMONSTERACTIVATION is not a default.
+#define LEVEL_ADDITIVE_SCROLLERS UCONST64(0x1000000000) // scrollers add their momentum instead of averaging it
+#define LEVEL_CAVERNS_OF_DARKNESS UCONST64(0x2000000000) // to translate the special sector types of CoD.
+
struct acsdefered_s;
class FBehavior;
diff -urN .96fresh\src/p_lnspec.h .96cod\src/p_lnspec.h
--- .96fresh\src/p_lnspec.h Thu Nov 04 10:22:47 2004
+++ .96cod\src/p_lnspec.h Sun Jan 23 13:54:55 2005
@@ -346,6 +346,9 @@
sDamage_SuperHellslime = 116,
Scroll_StrifeCurrent = 118,
+ // Caverns of Darkness healing sector
+ Sector_Heal = 196,
+
Light_OutdoorLightning = 197,
Light_IndoorLightning1 = 198,
Light_IndoorLightning2 = 199,
diff -urN .96fresh\src/p_mobj.cpp .96cod\src/p_mobj.cpp
--- .96fresh\src/p_mobj.cpp Sun Jan 23 10:51:28 2005
+++ .96cod\src/p_mobj.cpp Sun Jan 23 11:08:43 2005
@@ -2411,13 +2411,18 @@
if (scrolly) county++;
}
- if (countx > 1)
+ // Some Boom compatible levels don't like this
+ // But it is only important for non-player objects.
+ if (!(level.flags&LEVEL_ADDITIVE_SCROLLERS) && !player)
{
- cummx /= countx;
- }
- if (county > 1)
- {
- cummy /= county;
+ if (countx > 1)
+ {
+ cummx /= countx;
+ }
+ if (county > 1)
+ {
+ cummy /= county;
+ }
}
momx += cummx;
momy += cummy;
diff -urN .96fresh\src/p_spec.cpp .96cod\src/p_spec.cpp
--- .96fresh\src/p_spec.cpp Fri Dec 24 16:34:47 2004
+++ .96cod\src/p_spec.cpp Sun Jan 23 13:54:55 2005
@@ -913,6 +913,11 @@
{
switch (special)
{
+ case Sector_Heal:
+ // CoD's healing sector
+ if (!(level.time&0x1f)) P_GiveBody(player,1);
+ break;
+
case Damage_InstantDeath:
// Strife's instant death sector
P_DamageMobj (player->mo, NULL, NULL, 999, MOD_UNKNOWN);
diff -urN .96fresh\src/p_xlat.cpp .96cod\src/p_xlat.cpp
--- .96fresh\src/p_xlat.cpp Thu Nov 04 10:23:29 2004
+++ .96cod\src/p_xlat.cpp Sun Jan 23 11:11:43 2005
@@ -427,6 +427,12 @@
return high | (special + 100);
}
}
+ else if (level.flags&LEVEL_CAVERNS_OF_DARKNESS)
+ {
+ // CoD uses 18 as an instant death sector type and 19 for healing the player
+ if (special == 18) return high | Damage_InstantDeath;
+ if (special == 19) return high | Sector_Heal;
+ }
return high | (special + 64);
}
else if (special < 40)