Witchaven AND EGWH
10-25-2020
Release 1 © RTCM
ETTiNGRiNDER
INTRODUCTION
EGwhaven (EGWH) PROJECT |
BUGS AND OVERSIGHTS
This section contains more info that I gathered about the games Witchaven and Witchaven II from Capstone Software.
In a nutshell, these games used an FPS-style engine, but focused
on melee combat with a variety of medieval weapons. They were built
upon Ken Silverman's BUILD engine, and have the basic features
thereof, including bridges that can be walked over/under and
overlapping sectors; these were limited and not entirely true 3D,
but closer to it than what Doom was capable of. However, some of the
more advanced effects seen in later BUILD games like Duke Nukem 3D
are absent. They did, however, contain some neat features such as
traps firing from the walls, an inventory system for potions and
spells, and experience points.
These games are often compared to Raven Software's Heretic and
Hexen, but aside from being first person action games with dark
fantasy themes, and occasional cross-pollination of ideas, the
similarities are IMO not so great. Comparatively, Witchaven and
Witchaven II have a more gritty, digitized-photo-based visual style,
and more emphasis on melee combat. Gameplay focuses somewhat more on
navigating hazardous environments laden with traps as opposed to
Heretic's Doomish formula or Hexen's observational puzzles.
Witchaven and Witchaven II also include an experience leveling
system, which would not appear in the Heretic/Hexen series until
Hexen II.
These games are notorious for their many bugs. Thanks to Les
Bird's source code release, I've been able to try my hand at fixing
some of them with the EGwhaven project.
Thanks to former Capstone employee Les Bird, the source code to
Witchaven & Witchaven II has been made available to fans, making it
possible for new bugfixes and enhancements to be done. EGwhaven is
my own attempt at doing so with the Witchaven II source. Thanks to
help from Adam Biser I have been able to begin work on patching up
the source to the original Witchaven as well. At this point,
EGwhaven should be fairly stable and by default mostly
vanilla-correct in places where it is feasible to do so, but be
aware that there are a few hardcoded behavior changes and there is
always the possibility of lingering bugs or new ones that were
inadvertently added.
Notes and caveats: this project may be a "port" in the "Doom
port" sense that's sometimes used to mean an altered rebuild of the
source code, but it is not a "port" in the true sense of being
ported to another system; it's currently still a DOS program to be
run under DOSBox (or perhaps on a DOS machine, if you have one.) If
you want a port running under Windows you may want to check out
BuildGDX
EGwhaven features:
- Many fixes to bugs and oversights in the vanilla release.
- A GAME parameter, inspired by Quake, that allows you to
place your custom data in a subfolder for loading as a mod. This
includes .MAP files, STUFF.DAT and most other data files (a few
have issues). Separate save game sets are kept for each GAME
folder.
- A WARP parameter to instantly start the game on the desired
level number.
- RULES.CFG which allows certain fixes to be enabled/disabled
per GAME and also allows a few other game behaviors to be
tweaked.
- MAPNAMES.CFG which allows the map titles in Witchaven II's
intermission screen to be adjusted for custom GAMEs.
This is not a GPL or Open Source project as the unofficial status
of Les Bird's source release does not allow for this, but if you
want to adjust it or use it for something yourself, go ahead as far
as I am concerned.
A discussion board for EGwhaven and Witchaven in general can be
found on the RTCM forum.
You may also be interested in my map data patches for Witchaven,
available in the Witchaven patches and tools section.
NB: EGwhaven is no longer maintained. Several known bugs
remain unsolved so use this modification at your own risk. It is
highly recommended that you set your music card to "Sound Blaster"
if using DOSBox as other options are more error prone.
There was a report that someone had a problem running EGWH2 with
the included version of DOS4GW. This doesn't appear to be common but
if you encounter trouble, try this alternate version,
dos4gw_1.95.zip which was reported to work.
Troubleshooting
The biggest problems you are likely to run into are clock
speed issues. EGwhaven attempts to patch these out, although
the fix is not quite perfect yet and I do not guarantee
exact correctness for time-sensitive functions. Playing on a
native machine rather than emulation will usually net you
better results for the vanilla EXEs; the closer to the
system the game was developed for, the better.
Adjusting for speed issues in DOSBox:
Adjust cycles lower with a "cycles = ###" command on the
DOSBox prompt or in your configuration file. You will have
to experiment with values to get it right. Although I
previously recommended using the Witchaven II intro
cinematic as a gauge, a good cycles value for it may make
the rest of the game too choppy.
You may experience other issues under DOSBox that are not
fixable with the cycles parameter. I had more quirks under
64-bit GNU/Linux DOSBox than under 32-bit Windows DOSBox
(however, this is based on old tests and may be due to a
faulty DOSBox build of some sort).
Adjusting for speed issues in real DOS:
Slowdown utilities could help if actions like jumping are
still too fast; I find that on a 333mhz machine, they're
mostly ok. Bear in mind that you do not want to slow the
computer down anywhere near as much as you would for the
1980s DOS games that such utilities are usually used for. As
with DOSBox cycles, you may have to experiment a bit to find
the right balance of smoothness and good behavior.
Either way you run the game, you might also get some
beneficial slowdown from switching the game to 640x480
resolution, though it may become a bit choppy as well.
If you cannot remap keys:
Bear in mind that the setup program isn't clever enough to
unbind a key from one action when you assign it to another,
so if it appears that remapping the keys isn't working, make
sure the key is assigned to only one function.
If you get an erroneous "center stick press button"
message on screen:
This message normally appears if you have set up the game to
use a joystick and you are being asked to calibrate it. If
this is not the case, it may be that you have patched the
game incorrectly, either with a poorly-made "no CD" patch or
with two official patches that are not meant to be applied
simultaneously. A clean reinstall may help.
Full install to hard drive:
Witchaven II can be run completely from hard drive by
copying the SMK files from the CD to the game folder and
running the game with the LOCAL parameter.
Bug catalogue
This is a project to seek out the bugs in Witchaven and
Witchaven II, and find out whether they are bugs that
manifested at the time of release or if they are latent bugs
resulting from machine or emulator incompatibility.
There is currently a significant bias towards information
based on the Witchaven II code base, as I have not (yet) dug
too deeply into the internal differences between the first
game and the sequel. It is possible that more functions than
are currently documented were broken during the transition
of the code to Witchaven II's form.
Clock speed sensitivity
These are bugs that occur because the game is not
correctly adjusting to varying system speeds. The faster the
system that the game is run on is, the worse these errors
become. For workarounds, see the troubleshooting section
above.
Bug |
Which game? |
Description |
EGwhaven fix? |
Jumping/falling speed
is dependent on machine speed |
Both |
Known cause: dophysics in WHINP.C handles
player's vertical movement, but fails to adjust it
to the game speed. |
Yes |
Slippery movement |
Both |
Player's deceleration after moving was clock
speed dependant. |
Yes |
Projectile autoaim is
misguided |
Both |
Known cause: animateobjs in WHANI.C handles
missile's vertical movement, but fails to adjust it
to the game speed.
Crashes when throwing pike axes in Witchaven I might
be related? |
Yes |
Sprite doors rotate too
far |
1 |
Witchaven I used some sprite-based rotating
doors which could over-rotate into a wall due to
clock speed issues. The same problem may exist in
Witchaven II but the maps there did not use any
sprite doors. |
Yes |
Cinematics don't play
correctly |
2 |
SMK playback stutters and goes in slow motion
under DOSBox. Possibly related to audio as turning
sound off makes the video play smoothly. |
Improved |
Code omission
Bugs that occur simply because there's no code in place
to make something happen or prevent it from happening.
Bug |
Which game? |
Description |
EGwhaven fix? |
Ice Razor can freeze
Cirae-Argoth and break the game |
2 |
Cirae-Argoth is immune to freeze scrolls, but if
you use the enchanted two-handed sword on her, she
may still be frozen and shattered, which renders the
game unwinnable due to her critical drop item not
appearing. |
Yes |
Ciraean Sentinel
doesn't thaw out properly |
2 |
If you freeze a Ciraean Sentinel with the freeze
spell and then leave him enough time to thaw out, he
doesn't become active again, and cannot die.
Known cause: no case was coded for this enemy in the
FROZEN state of WHANI.C. |
Yes |
Breaking frozen enemies
fails to increase kill count |
2 |
When enemies are frozen and shattered, they are
not counted as kills for the end of level kill
score. |
Yes |
"SHOCKED" does nothing |
2 |
Instead of level draining, the Willow Wisp in
Witchaven II produces a message which says
"SHOCKED". There is, however, no code in place to
make this do anything. In Witchaven I, the shocktime
variable appears to have served as a means to
prevent rapid-fire level draining, so this may be a
case of WH2 being rushed out with debug code in
place rather than something finalized. |
Yes |
Off hand is not shaded
on HUD weapon |
2 |
When dual wielding (and probably when punching)
the player's left hand is not shaded like the right
hand, most noticeable when using a scare spell.
Known cause: not all of the calls to sprite drawing
functions in WHPLR.C were passing the "dashade"
variable. |
Yes |
Lose enchanted weapon
by picking up regular one |
2 |
Known cause: Exceptions simply weren't coded in. |
Yes |
Dagger can't be
collected |
1 |
In WH1, the ordinary dagger sprite could not be
collected, making treasure chests the only way to
replace broken daggers in the standard maps.
The enchanted dagger sprite was recognized in the
code instead, rather than the standard sprite. WH2
recognizes both and treats them differently, but
still does not include the enchanted dagger sprite
in maps. |
Yes |
Onyx Ring has no effect
(besides small XP gain) |
Both |
Known cause: processobjs in WHOBJ.C sets the
player's treasure[7] variable, but there is no code
to check this variable and make it do something. |
Option |
Enchanted weapon
humming sound doesn't go away when weapon is put
away |
2 |
Code was not shutting off enchanted droning for
weapons that weren't meant to have it, also the
enchantment code originally marked fists and broad
sword as enchanted even though it probably
shouldn't. |
Yes |
Enemy sticks in attack
animation |
Both |
Occurs if the player is using a scare spell and
closes to melee range, then backs off. |
Yes |
Clansman with sword is
unusually hard to hit |
2 |
During a particular frame of his sword
animation, the Argothonian Clansman is unhittable by
any attack.
Known cause: Sprite picnum was sometimes set to
KURTREADY+1 but checks against that animation in
attack code were only made against the first
KURTREADY frame. |
Yes |
Non-fireball trap
projectiles do not hit Grondoval |
Both? |
For example, see the many traps in Level 5,
which never seem to hit even though they fire at the
correct vertical level. The traps are able to hit
monsters.
This appears to happen because the projectile was
expecting a return value from damageactor() (WHOBJ.C)
that it did not get. |
Yes |
Sound effect gets stuck
on loop |
Both? |
The stuck sound stops if the menu is opened, but
on resuming play, another sound will start looping
instead.
Adding code to clean up the loop count setting on
sound effects fixes this. |
Yes |
Faulty logic
Bugs that occur because variables are being set or
evaluated incorrectly.
A particular subset of issues occurs due to the (mis)use
of krand()&x calls. The krand()&x construction typically
works correctly on its own, but the & operator (bitwise AND)
was sometimes used in an if() statement in a way that was
invalid due to the programmers overlooking a particular
quirk of C's order of operations.
Bug |
Which game? |
Description |
EGwhaven fix? |
Skeleton animates
incorrectly |
2 |
Known cause: transformactors in WHOBJ.C (which
handles angle rotations of sprites) contains the
wrong frame count for the skeleton actor. |
Yes |
Imp gets stuck in
attack animation |
2 |
The imp sometimes gets stuck in its attack
animation even when the player backs out of melee
range.
Known cause: a partially commented out if block
originally meant to make a sound effect ended up
placing the animation change statement under the if
condition instead. |
Yes |
Giryon Knight's phantom
spawning is faulty |
2 |
Giryon Knights, if set with a particular
property, are apparently meant to spawn a ghost, but
the functions for doing so are faulty resulting in
several ghosts appearing and other undesirable side
effects.
Known cause: faulty SHADE and EVILSPIRIT behavior in
WHANI.C animateobjs. |
Yes |
Glass Skull does not
trigger level up, can result in XP loss |
2 |
Known cause: Witchaven II uses different XP
point per level values than the original, but the
values in WHOBJ.C processobjs were not updated to
match. |
Yes |
Trap shots are
displaced upwards |
2 |
Shots from various wall traps are launched from
a spot well above the hole in the wall. Probably due
to the graphic being made much larger in Witchaven
II and the code not adjusted properly for scaling it
down. |
Yes |
On higher skill levels,
health potions and Ankhs count double, can sometimes
exceed normal max health |
2 |
Witchaven II added a check that halved or
doubled most alterations to the player's HP value on
certain skill levels, seemingly with the intent of
making enemies stronger on higher skill levels.
However, it was being applied to increases of health
as well with strange results. |
Yes |
Some treasure chest
contents never occur |
Both |
Random armor in a treasure chest will always be
a Hero Time helmet (should be a random choice of
helmet, leather, chain, or plate).
When choosing between XP bonus / poison trap, always
chooses XP bonus.
Known cause: Some of the random rolls in WHOBJ.C
processobjs are coded incorrectly (incorrect
placement of & operator in if() condition). |
Option |
Non-enchanted pike axes
make enchanted weapon auras disappear |
2 |
Known cause: faulty checks in WHPLR.C caused the
regular weapon animations to be selected if the
player's weapon[7] equaled 2 (non-enchanted pike axe
with throwing ammo), even if the pike axe was not
the currently wielded weapon. |
Yes |
Extreme running speed
when mouselooking |
1 |
Mouse code in Witchaven I contained a limitation
on player's forward/backward velocity when in mouse
movement mode. Switching to mouse look mode bypassed
this limit. |
Yes |
Incorrect weapon
enchantment on hardest skill |
2 |
Known cause: when choosing how many charges to
give to an enchanted weapon, difficulty levels were
treated as starting at 0 when they properly start at
1. This meant that at the hardest skill level,
enchantment charge would be left equal to the
weapon's remaining durability points, often much
more than the charge should have been. |
Yes |
Shields are
(practically) indestructible |
2 |
Known cause: the amount of damage being done to
the shield was expressed as a negative number, and
then subtracted from the shield points, resulting in
shield points increasing whenever the shield should
have been damaged.
Shields could theoretically still be destroyed by
overflow of the shield durability value, but it
would require an immense number of accumulated hits,
beyond what would reasonably occur in play. |
Yes |
Jukebox shuffle doesn't
pick tracks 11-15 |
2 |
Known cause: randomizer was instructed to give a
range from 0-9 instead of the correct 0-14. |
Yes |
BUILD Engine
Bugs that are present in the BUILD engine itself, rather
than Witchaven in particular. EGwhaven does not fix
any of these bugs currently, and is unlikely to ever. Sorry!
Bug |
Description |
Bumping certain walls
kills Grondoval instantly |
Seems to happen more frequently with some walls
than others.
This can at the very least also happen in Duke 3D.
Try not to jam yourself into strange spaces like
decorative wall recesses, as these are prime death
zones. |
Collision with unusual
slopes causes memory corruption |
Witchaven II, level 13 contains some stalactites
created by giving triangular sectors an extreme
ceiling slope to create the pointed geometry.
Bumping against these stalactites, when they are low
enough to the floor, can cause Grondoval to clip
into them and this may subsequently corrupt the
game's memory, resulting in erroneous slopes all
over the place and other errors.
While these structures are unusual, by building a
test map for Duke Nukem 3D and messing around in it
I was also able to induce that game to crash under
similar circumstances, so I am categorizing this
issue as a BUILD bug.
Once the problem has occurred, consider your
Witchaven II session destroyed even if play
continues. The game's memory has been corrupted and
it is likely to crash afterwards; even reloading
from a previous save does not appear to clean things
up if you haven't exited the game first. Exit the
game completely, then restart and load a save from
before the error occured. As with the wall death
issue, the best way to mitigate this currently is to
avoid walking up against the stalactite structures,
where possible. |
Level design error
Bugs that occur due to map data, rather than the
executable code.
I've made several map patches which you can download to fix
some of these issues.
Bug |
Description |
Patch? |
Pull chain on WH1 Level
5 doesn't work |
The pull chain that opens the brass key area was
not given any tags to link it to the sector it's
meant to operate on. |
Yes |
Cannot collect bow in
WH1 Level 13 |
The bow near the start of WH1 Level 13 is tagged
with the "blocking" sprite property which prevents
the player from being able to collect it. |
Yes |
Can stand on wall
decorations in WH2 Level 1 |
Known to exist in this level, but possibly
others as well. Some sprites such as blood splatters
set to be wall decorations are flagged as blocking
and therefore treated as solid objects.
|
No |
Nonsensical sprite
graphic in WH2 Level 5 |
A sprite erroneously set to use a sky graphic
exists on this level, near the glass skull. |
Yes |
No exit indicator
sprite on WH2 Level 13 |
Cosmetic map issue; the map is still completable,
but the exit pentagram isn't displayed on the exit
pad. |
Yes |
Black key door does not
work on WH2 Level 13 |
The tag for the door to open was erroneously
given to an overlapped sector instead of the correct
one. |
Yes |
Bizarre and elusive
Bugs that have been baffling and which I have as yet been
unable to track down conclusively. Some may be emulator or
system specific bugs, or only triggerable under exceptional
circumstances. If you think you have further information on
any of these, please let me know.
Bug |
Which game? |
Native machine? |
Description |
Reloaded saved game
exhibits bizarre behavior |
2? |
Yes |
I've seen the game run too fast in one save and
had Grondoval simply die upon reload in another;
these happened on native machine but I haven't seen
it in DOSBox.
Perhaps some form of overflow or other corruption
taking place in DOS. I suspect at this point that it
may have been a result of vanilla Witchaven 2 /
EGwhaven savegame incompatibility that has since
been repaired. |
Monster can climb to
ledges it should not |
2? |
? |
Observed several times on WH2 level 1, where a
Lava Fiend can end up stuck in the eye socket of the
big skull entrance.
Something about the WH2L1 architecture must be
conducive to this happening. MAY be a glitch related
to sloped floors, but there is no conclusive
evidence yet. |
Enemy walking on air |
2? |
Yes |
Observed twice, on Witchaven 2 running in DOS
mode, level 5, with a clansman over the big stairs
at the beginning. Perhaps related to this level's
architecture in some way? |
Frozen imp animates
incorrectly |
2 |
No |
Elusive bug; occurred in 64-bit GNU/Linux DOSBox.
I'm inclined to write this off as a DOSBox/system
glitch as I've never seen it happen on any other
system setup, DOSBox or otherwise.
It may be possible that it's related to the enemy
sticking in its attack animation due to a scare
spell bug though, I have to investigate this. |
Grondoval's head gets
stuck in the ceiling |
1? |
No? |
Recently reproduced a similar issue on WH1 level
6, climbing the stairs from the lava cracks room, in
an EGwhaven dev build. Still need more research, but
seems potentially recoverable by crouching around
for a while to force the character back to the
floor. |
Pull chain disappeared
from save game |
1? |
No? |
Bug reported by Gennaro; a pull chain on WH1
Level 12 disappeared in the data for a saved game.
Cause is currently unknown but does not appear to be
related to faulty map data. If you can reproduce
similar errors, please provide info if possible. |
"It's a feature"
Odd behaviors that probably should not be considered
bugs.
Behavior |
Description |
Fire resistance
protects against projectiles that are not fire |
Fire resistance potions resist all projectiles
except for the Grey Witch's flesh attack and the
Skeletal Witch's or Ciraean Sentinel's magic spell.
A few Witchaven II maps have deathtraps that are
designed around this being the case, so it can't be
"fixed" without ruining those maps.
Optionally configurable in EGwhaven. |
Monsters killing each
other grants XP to player |
Probably intentional. XP grant is done upon
death of the monster, regardless of cause. |
Miscellany
Other bugs and oddities.
Bug |
Which game? |
Description |
EGwhaven fix? |
Player not hit by
thrown halberds |
2? |
Halberds thrown by the Midian warriors were
collected or ignored rather than hitting for damage,
seemingly because being a collectible item
interfered with their operating as a damaging
projectile. |
Yes |
Monsters can enter the
wall |
Both |
Possibly related to the death wall bug above.
Skeletons are particularly susceptible but other
creatures occasionally do this as well: it has been
observed once on Witchaven 2, with Lava Fiend, level
13, on a spiral staircase; again on Witchaven 1,
with Goblin, level 23, ledge near beginning. If the
monster fully penetrates the wall it is removed from
play. |
No |
Ornate horn erroneously
given in saved game |
Both |
Seems to happen more frequently later in a
playthrough rather than in early saves.
My latest research suggests that this is may be due
to the fact that the vampiretime variable is
probably treated in game as a 32-bit variable, but
gets saved and loaded as only a 16-bit one.
EGwhaven now makes an effort to clean up this
variable when saving/loading, so the bug should be
gone there. |
Yes |
Weapons take damage
even if attack misses |
Both |
Needs more research, it may be an intentional
thing where swinging weapons in the air only damages
them further if they're already damaged. |
No |
Throwing a pike crashes
the game |
1 |
Possibly clock speed related as it does not seem
to happen on a native machine. Seems to be fixed in
Witchaven II.
May be specifically triggered when aiming at a
monster as opposed to throwing pikes with no monster
in sight. |
Yes? |
Sprite attributes not
preserved in saved games |
2? |
When reloading a saved game, sprites are
re-initialized as if loading the map fresh, which
has undesirable results such as restoring enemy HP
and ammo to maximum.
Known cause: game did not differentiate between
loading a savegame map and loading a map normally. |
Yes |
Freeze spell
exploitable for excess XP |
Both? |
Enemies give XP upon being frozen with a freeze
spell, however, it is possible for them to thaw out
and be frozen again to farm multiple XP bonuses this
way.
EGwhaven moves the grant of XP to frozen enemies
being smashed, rather than immediately when frozen. |
Yes |
Automap is off center
in 640x480 mode |
1 |
Fixed in Witchaven II. |
N/A |
Automap does not show
red lines |
2 |
Something seems to have changed between WH1's
initial release and the release of WH2 that has
caused Capstone's map display code to break,
resulting in the red two-sided lines no longer
displaying on map even though they are originally
did. |
Flight does not
properly respect floor levels |
Both |
If using the fly down button over a floor, eye
level can drop very low. |
No |
Blue Midian swordsmen
are deleted from the map |
2 |
The save game system in WH2 uses a hack where a
blue-caped Midian swordsman sprite is placed on
Grondoval's position, and all of them are removed
when loading maps to prevent attacks from this
phantom enemy.
WH1 uses a Palette #1 Fred instead, which is more of
a non-issue since Fred is unused in the official
maps and setting his palette to 1 does nothing
beneficial even if he were to be placed in a custom
map. |
Yes |
Exit pentagram is not
correctly translucent |
2 |
Known cause: The map setup code in Witchaven II
removes the translucency flag from pentagrams. |
Yes |
Outro sequence crashes
with "no more radbuff pointers" |
2 |
Only had this happen once so far. Related to
free memory perhaps? |
No? |
Always run oddity |
2 |
In Witchaven II, always run mode is on by
default and the run key doesn't switch to walk mode,
creating the illusion that the run key does nothing.
If always run is turned off, it works normally. |
Yes |
Can't remap strafing
keys |
2 |
Some versions of Witchaven II may be unable to
remap the strafe left and strafe right keys, but
also see troubleshooting notes. |
Yes |
Sound and music volume
reset to zero when starting game |
2? |
Needs investigation. If intro cinematic has
sound, but not the title screen, check the in-game
sound settings.
Possibly due to incorrect sound setup. |
No |
Setup program crashes
in Windows 9x |
Both |
If running through Windows 9x, drop to pure DOS
mode to set up. The game can run in Windows 9x mode
once set up, although plain DOS mode is recommended. |
No |
Health potion causes
health loss when near maximum HP |
2? |
Bug that was reported but I have not confirmed
yet. May be related to using a hacked version of the
game. |
Yes? |
RAP-10 audio crashes
game in DOSBox |
1? |
Bug that was reported but I have not confirmed
yet. Reported to occur in the first level of WH1
where the lowering wall reveals a mino drake; only
with EGwhaven?. |
No? |
|