Skip to content

Commit

Permalink
- added A_Explode compatibility options.
Browse files Browse the repository at this point in the history
There are two options here - one only disables the vertical thrust and the other goes back fully to the original non-z-aware code.
Both options are settable through MAPINFO.
For the compatibility presets, the normal ones only disable the vertical thrust, the strict ones force use of the old code entirely.
  • Loading branch information
coelckers committed Mar 24, 2019
1 parent d9ac337 commit dc67355
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 22 deletions.
32 changes: 18 additions & 14 deletions src/d_main.cpp
Expand Up @@ -563,22 +563,23 @@ CUSTOM_CVAR(Int, compatmode, 0, CVAR_ARCHIVE|CVAR_NOINITCALL)
break;

case 1: // Doom2.exe compatible with a few relaxed settings
v = COMPATF_SHORTTEX|COMPATF_STAIRINDEX|COMPATF_USEBLOCKING|COMPATF_NODOORLIGHT|COMPATF_SPRITESORT|
COMPATF_TRACE|COMPATF_MISSILECLIP|COMPATF_SOUNDTARGET|COMPATF_DEHHEALTH|COMPATF_CROSSDROPOFF|
COMPATF_LIGHT|COMPATF_MASKEDMIDTEX;
w= COMPATF2_FLOORMOVE;
v = COMPATF_SHORTTEX | COMPATF_STAIRINDEX | COMPATF_USEBLOCKING | COMPATF_NODOORLIGHT | COMPATF_SPRITESORT |
COMPATF_TRACE | COMPATF_MISSILECLIP | COMPATF_SOUNDTARGET | COMPATF_DEHHEALTH | COMPATF_CROSSDROPOFF |
COMPATF_LIGHT | COMPATF_MASKEDMIDTEX;
w = COMPATF2_FLOORMOVE | COMPATF2_EXPLODE1;
break;

case 2: // same as 1 but stricter (NO_PASSMOBJ and INVISIBILITY are also set)
v = COMPATF_SHORTTEX|COMPATF_STAIRINDEX|COMPATF_USEBLOCKING|COMPATF_NODOORLIGHT|COMPATF_SPRITESORT|
COMPATF_TRACE|COMPATF_MISSILECLIP|COMPATF_SOUNDTARGET|COMPATF_NO_PASSMOBJ|COMPATF_LIMITPAIN|
COMPATF_DEHHEALTH|COMPATF_INVISIBILITY|COMPATF_CROSSDROPOFF|COMPATF_CORPSEGIBS|COMPATF_HITSCAN|
COMPATF_WALLRUN|COMPATF_NOTOSSDROPS|COMPATF_LIGHT|COMPATF_MASKEDMIDTEX;
w = COMPATF2_BADANGLES|COMPATF2_FLOORMOVE|COMPATF2_POINTONLINE;
v = COMPATF_SHORTTEX | COMPATF_STAIRINDEX | COMPATF_USEBLOCKING | COMPATF_NODOORLIGHT | COMPATF_SPRITESORT |
COMPATF_TRACE | COMPATF_MISSILECLIP | COMPATF_SOUNDTARGET | COMPATF_NO_PASSMOBJ | COMPATF_LIMITPAIN |
COMPATF_DEHHEALTH | COMPATF_INVISIBILITY | COMPATF_CROSSDROPOFF | COMPATF_CORPSEGIBS | COMPATF_HITSCAN |
COMPATF_WALLRUN | COMPATF_NOTOSSDROPS | COMPATF_LIGHT | COMPATF_MASKEDMIDTEX;
w = COMPATF2_BADANGLES | COMPATF2_FLOORMOVE | COMPATF2_POINTONLINE | COMPATF2_EXPLODE2;
break;

case 3: // Boom compat mode
v = COMPATF_TRACE|COMPATF_SOUNDTARGET|COMPATF_BOOMSCROLL|COMPATF_MISSILECLIP|COMPATF_MASKEDMIDTEX;
w = COMPATF2_EXPLODE1;
break;

case 4: // Old ZDoom compat mode
Expand All @@ -587,14 +588,15 @@ CUSTOM_CVAR(Int, compatmode, 0, CVAR_ARCHIVE|CVAR_NOINITCALL)
break;

case 5: // MBF compat mode
v = COMPATF_TRACE|COMPATF_SOUNDTARGET|COMPATF_BOOMSCROLL|COMPATF_MISSILECLIP|COMPATF_MUSHROOM|
COMPATF_MBFMONSTERMOVE|COMPATF_NOBLOCKFRIENDS|COMPATF_MASKEDMIDTEX;
v = COMPATF_TRACE | COMPATF_SOUNDTARGET | COMPATF_BOOMSCROLL | COMPATF_MISSILECLIP | COMPATF_MUSHROOM |
COMPATF_MBFMONSTERMOVE | COMPATF_NOBLOCKFRIENDS | COMPATF_MASKEDMIDTEX;
w = COMPATF2_EXPLODE1;
break;

case 6: // Boom with some added settings to reenable some 'broken' behavior
v = COMPATF_TRACE|COMPATF_SOUNDTARGET|COMPATF_BOOMSCROLL|COMPATF_MISSILECLIP|COMPATF_NO_PASSMOBJ|
COMPATF_INVISIBILITY|COMPATF_CORPSEGIBS|COMPATF_HITSCAN|COMPATF_WALLRUN|COMPATF_NOTOSSDROPS|COMPATF_MASKEDMIDTEX;
w = COMPATF2_POINTONLINE;
v = COMPATF_TRACE | COMPATF_SOUNDTARGET | COMPATF_BOOMSCROLL | COMPATF_MISSILECLIP | COMPATF_NO_PASSMOBJ |
COMPATF_INVISIBILITY | COMPATF_CORPSEGIBS | COMPATF_HITSCAN | COMPATF_WALLRUN | COMPATF_NOTOSSDROPS | COMPATF_MASKEDMIDTEX;
w = COMPATF2_POINTONLINE | COMPATF2_EXPLODE2;
break;

}
Expand Down Expand Up @@ -642,6 +644,8 @@ CVAR (Flag, compat_multiexit, compatflags2, COMPATF2_MULTIEXIT);
CVAR (Flag, compat_teleport, compatflags2, COMPATF2_TELEPORT);
CVAR (Flag, compat_pushwindow, compatflags2, COMPATF2_PUSHWINDOW);
CVAR (Flag, compat_checkswitchrange, compatflags2, COMPATF2_CHECKSWITCHRANGE);
CVAR (Flag, compat_explode1, compatflags2, COMPATF2_EXPLODE1);
CVAR (Flag, compat_explode2, compatflags2, COMPATF2_EXPLODE2);

CVAR(Bool, vid_activeinbackground, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)

Expand Down
2 changes: 2 additions & 0 deletions src/doomdef.h
Expand Up @@ -329,6 +329,8 @@ enum : unsigned int
COMPATF2_TELEPORT = 1 << 5, // Don't let indirect teleports trigger sector actions
COMPATF2_PUSHWINDOW = 1 << 6, // Disable the window check in CheckForPushSpecial()
COMPATF2_CHECKSWITCHRANGE = 1 << 7, // Enable buggy CheckSwitchRange behavior
COMPATF2_EXPLODE1 = 1 << 8, // No vertical explosion thrust
COMPATF2_EXPLODE2 = 1 << 9 // Use original explosion code throughout.
};

// Emulate old bugs for select maps. These are not exposed by a cvar
Expand Down
2 changes: 2 additions & 0 deletions src/gamedata/g_mapinfo.cpp
Expand Up @@ -1642,6 +1642,8 @@ MapFlagHandlers[] =
{ "compat_teleport", MITYPE_COMPATFLAG, 0, COMPATF2_TELEPORT },
{ "compat_pushwindow", MITYPE_COMPATFLAG, 0, COMPATF2_PUSHWINDOW },
{ "compat_checkswitchrange", MITYPE_COMPATFLAG, 0, COMPATF2_CHECKSWITCHRANGE },
{ "compat_explode1", MITYPE_COMPATFLAG, 0, COMPATF2_EXPLODE1 },
{ "compat_explode2", MITYPE_COMPATFLAG, 0, COMPATF2_EXPLODE2 },
{ "cd_start_track", MITYPE_EATNEXT, 0, 0 },
{ "cd_end1_track", MITYPE_EATNEXT, 0, 0 },
{ "cd_end2_track", MITYPE_EATNEXT, 0, 0 },
Expand Down
2 changes: 2 additions & 0 deletions src/maploader/compatibility.cpp
Expand Up @@ -165,6 +165,8 @@ static FCompatOption Options[] =
{ "teleport", COMPATF2_TELEPORT, SLOT_COMPAT2 },
{ "disablepushwindowcheck", COMPATF2_PUSHWINDOW, SLOT_COMPAT2 },
{ "checkswitchrange", COMPATF2_CHECKSWITCHRANGE, SLOT_COMPAT2 },
{ "explode1", COMPATF2_EXPLODE1, SLOT_COMPAT2 },
{ "explode2", COMPATF2_EXPLODE2, SLOT_COMPAT2 },
{ NULL, 0, 0 }
};

Expand Down
8 changes: 6 additions & 2 deletions src/p_map.cpp
Expand Up @@ -5889,7 +5889,8 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom
// them far too "active." BossBrains also use the old code
// because some user levels require they have a height of 16,
// which can make them near impossible to hit with the new code.
if (((flags & RADF_NODAMAGE) || !((bombspot->flags5 | thing->flags5) & MF5_OLDRADIUSDMG)) && !(flags & RADF_OLDRADIUSDAMAGE))
if ((flags & RADF_NODAMAGE) || (!((bombspot->flags5 | thing->flags5) & MF5_OLDRADIUSDMG) &&
!(flags & RADF_OLDRADIUSDAMAGE) && !(thing->Level->i_compatflags2 & COMPATF2_EXPLODE2)))
{
double points = GetRadiusDamage(false, bombspot, thing, bombdamage, bombdistance, fulldamagedistance, bombsource == thing);
double check = int(points) * bombdamage;
Expand Down Expand Up @@ -5939,7 +5940,10 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom
}
thing->Thrust(bombspot->AngleTo(thing), thrust);
if (!(flags & RADF_NODAMAGE) || (flags & RADF_THRUSTZ))
thing->Vel.Z += vz; // this really doesn't work well
{
if (!(thing->Level->i_compatflags2 & COMPATF2_EXPLODE1) || (flags & RADF_THRUSTZ))
thing->Vel.Z += vz; // this really doesn't work well
}
}
}
}
Expand Down
29 changes: 23 additions & 6 deletions wadsrc/static/language.csv
Expand Up @@ -1543,7 +1543,9 @@ appuyez sur une touche.",,"Non puoi caricare una partita durante una net quest!

Premi un tasto.","impossivel carregar, porque
esta em partida online!
aperte uma tecla.",,
aperte uma tecla.","Невозможно загрузить сохранение в сетевой игре!

Нажмите любую клавишу.",
"Quicksave over your quest named

'%s'?
Expand All @@ -1560,7 +1562,11 @@ Appuyez sur Y ou N.",,"Sovrascrivere il salvataggio

'%s'?

Premi Y oppure N.",,,
Premi Y oppure N.",,"Перезаписать быстрое сохранение

«%s»?

Нажмите Y или N.",
"You can't quickload during a netquest!

Press a key.",QLOADNET,chex,,,"Du kannst während eines Netzwerkspiels nicht schnellladen.
Expand All @@ -1572,7 +1578,9 @@ vous êtes en ligne!

appuyez sur une touche.",,"Non puoi fare un quickload durante una netquest!

Premi un tasto.",,,
Premi un tasto.",,"Невозможно загрузить быстрое сохранение в сетевой игре!

Нажмите любую клавишу.",
"Do you want to quickload the quest named

'%s'?
Expand All @@ -1589,7 +1597,11 @@ Appuyez sur Y ou N.",,"Vuoi fare un quickload della quest

'%s'?

Premi Y oppure N.",,,
Premi Y oppure N.",,"""Желите брзо учитавање за игру под именом

„%s“?

Притисните Y или N.""",
"You can't start a new quest
while in a network quest.

Expand All @@ -1606,7 +1618,10 @@ durante una network quest.
Premi un tasto.","impossivel iniciar um novo jogo
enquanto se esta online.

aperte uma tecla.",,
aperte uma tecla.","You can't start a new game
while in a network game.

Press a key.",
"Careful, this will be tough.
Do you wish to continue?

Expand Down Expand Up @@ -2751,4 +2766,6 @@ High Dynamic Range,VKMNU_HDR,,,,,Alto Rango Dinámico,,,,,,,
Warning: The Vulkan renderer is highly experimental!,VK_WARNING,,,,Achtung: Der Vulkan Renderer ist noch sehr experimentell!,Advertencia: ¡El renderizado por Vulkan es altamente experimental!,,Attention: Le moteur de rendu Vulkan est très expérimental!,,Attenzione: il motore grafico Vulkan è altamente sperimentale!,,,
These options will require a restart to take effect.,VK_RESTART,,,,Diese Option erfordert einen Neustart!,Estas opciones requieren reiniciar para tener efecto.,,Ces options nécessitent un redémarrage.,,Queste opzioni richiedono il riavvio per avere effetto.,,,
Select Vulkan Device,VKMNU_DEVICESELECT,,This is not yet implemented - but it is planned,,Vulkan Gerät auswählen,Seleccionar Dispositivo Vulkan,,Sélectionner périphérique Vulkan,,Seleziona il Dispositivo Vulkan,,,
Press any key or click anywhere in the window to quit.,TXT_QUITENDOOM,,,,Drücke eine Taste oder klicke mit der Maus ins Fenster zum Beenden.,Presiona una tecla o haz click en cualquier lugar de la ventana para salir.,Presiona una tecla o da click en cualquier lugar de la ventana para salir.,Appuyez sur une touche ou cliquez pour quitter.,,,,,
Press any key or click anywhere in the window to quit.,TXT_QUITENDOOM,,,,Drücke eine Taste oder klicke mit der Maus ins Fenster zum Beenden.,Presiona una tecla o haz click en cualquier lugar de la ventana para salir.,Presiona una tecla o da click en cualquier lugar de la ventana para salir.,Appuyez sur une touche ou cliquez pour quitter.,,,,,
No vertical thrust from explosions,CMPTMNU_EXPLODE1,,,,Keine vertikale Bewegung durch Explosionen,,,,,,,,
Use original Doom explosion behavior,CMPTMNU_EXPLODE2,,,Use original Doom explosion behaviour,Benutze Original Doom Explosionsverhalten,,,,,,,,
2 changes: 2 additions & 0 deletions wadsrc/static/menudef.txt
Expand Up @@ -1659,6 +1659,8 @@ OptionMenu "CompatPhysicsMenu" protected
Option "$CMPTMNU_TRACE", "compat_TRACE", "YesNo"
Option "$CMPTMNU_HITSCAN", "compat_HITSCAN", "YesNo"
Option "$CMPTMNU_MISSILECLIP", "compat_MISSILECLIP", "YesNo"
Option "$CMPTMNU_EXPLODE1", "compat_explode1", "YesNo"
Option "$CMPTMNU_EXPLODE2", "compat_explode2", "YesNo"
Class "CompatibilityMenu"
}

Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/zscript/actors/attacks.zs
Expand Up @@ -596,6 +596,7 @@ extend class Actor
int pflags = 0;
if (flags & XF_HURTSOURCE) pflags |= RADF_HURTSOURCE;
if (flags & XF_NOTMISSILE) pflags |= RADF_SOURCEISSPOT;
if (flags & XF_THRUSTZ) pflags |= RADF_THRUSTZ;

int count = RadiusAttack (target, damage, distance, damagetype, pflags, fulldamagedistance);
if (!(flags & XF_NOSPLASH)) CheckSplash(distance);
Expand Down
4 changes: 4 additions & 0 deletions wadsrc/static/zscript/constants.zs
Expand Up @@ -258,6 +258,8 @@ enum EExplodeFlags
XF_NOTMISSILE = 4,
XF_EXPLICITDAMAGETYPE = 8,
XF_NOSPLASH = 16,
XF_THRUSTZ = 32,

};

// Flags for A_RadiusThrust
Expand Down Expand Up @@ -1338,4 +1340,6 @@ enum ECompatFlags
COMPATF2_TELEPORT = 1 << 5, // Don't let indirect teleports trigger sector actions
COMPATF2_PUSHWINDOW = 1 << 6, // Disable the window check in CheckForPushSpecial()
COMPATF2_CHECKSWITCHRANGE = 1 << 7, // Enable buggy CheckSwitchRange behavior
COMPATF2_EXPLODE1 = 1 << 8, // No vertical explosion thrust
COMPATF2_EXPLODE2 = 1 << 9 // Use original explosion code throughout.
};

0 comments on commit dc67355

Please sign in to comment.