Witchaven and Witchaven II - Bugs and idiosyncracies

The Witchaven games are notoriously buggy. Here you can find some troubleshooting tips and a catalog of observed bugs, with their causes if known. I have tried my best to document the game's behavior accurately, but be aware that in some cases I may have misinterpreted the game's source code, or strange bugs in the behavior may manifest that I haven't caught yet.

Troubleshooting

The biggest problems you are likely to run into are clock speed issues. EGwhaven should patch all of these out, and work well on DOSBox, although 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 Linux DOSBox than under 32-bit Windows DOSBox.

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.

Feel free to contact me if you discover further information. It would be especially interesting to test the game on varying old systems to see what clock speed (if any) begins to consistently manifest some of the latent bugs.

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.

BugWhich game?DescriptionEGwhaven fix?
Jumping/falling speed is dependent on machine speedBothKnown cause: dophysics in WHINP.C handles player's vertical movement, but fails to adjust it to the game speed.Yes
Projectile autoaim is misguidedBothKnown cause: animateobjs in WHANI.C handles missile's vertical movement, but fails to adjust it to the game speed.Yes
Cinematics don't play correctly2SMK playback stutters and goes in slow motion under DOSBox. Possibly related to audio as turning sound off makes the video play smoothly.No

Code omission

Bugs that occur simply because there's no code in place to make something happen or prevent it from happening.

BugWhich game?DescriptionEGwhaven fix?
Ice Razor can freeze Cirae-Argoth and break the game2Cirae-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 properly2If 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
"SHOCKED" does nothing2Instead of level draining, the Willow Wisp in Witchaven II causes a status called "SHOCKED". There is, however, no code in place to make this do anything.Yes
Off hand is not shaded on HUD weapon2?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 one2Known cause: Exceptions simply weren't coded in.Yes
Onyx Ring has no effect (besides small XP gain)BothKnown 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.Yes
Enchanted weapon humming sound doesn't go away when weapon is put away2Code 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 animation2?Occurs if the player is using a scare spell and closes to melee range, then backs off.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.

BugWhich game?DescriptionEGwhaven fix?
Skeleton animates incorrectly2Known cause: transformactors in WHOBJ.C (which handles angle rotations of sprites) contains the wrong frame count for the skeleton actor.Yes
Giryon Knight's phantom spawning is faulty2Giryon 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 loss2Known 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 upwards2Shots 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
Some treasure chest contents never occurBothRandom 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).
Yes
Non-enchanted pike axes make enchanted weapon auras disappear2Known 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
Shields are (practically) indestructible2Known 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-152Known 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.

BugDescription
Bumping certain walls kills Grondoval instantlySeems to happen more frequently with some walls than others.
This can at the very least also happen in Duke 3D, cf. Duke Dead Quick (video) and this information on Duke Nukem 3D glitches. Try not to jam yourself into strange spaces like wall recesses, as these are prime death zones.

Level design error

Bugs that occur due to map data, rather than the executable code.

BugDescriptionPatch?
Pull chain on WH1 Level 5 doesn't workThe 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
Can stand on wall decorations in WH2 Level 1Known 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
No exit indicator sprite on WH2 Level 13Cosmetic map issue; the map is still completable, but the exit pentagram isn't displayed on the exit pad.No
Black key door does not work on WH2 Level 13The tag for the door to open was erroneously given to an overlapped sector instead of the correct one.No

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

BugWhich game?Native machine?Description
Non-fireball trap projectiles do not hit Grondoval1YesFor 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, and I am fairly certain some non-fire traps in WH1 do hit the player, too.
Reloaded saved game exhibits bizarre behavior2?YesI'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. Possibly related to 32-bit values being saved into 16-bit slots in the save format?
Monster can climb to ledges it should not2??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 air2?YesObserved 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?
Clansman with sword is unusually hard to hit2YesAn elusive quirk, after building a test map I cannot think of anything in the map setup that would cause this, nor do I see anything obvious in the clansman's code. Yet, it seems to happen sometimes, somehow. When it does, it seems as if his hitbox is displaced upwards (so you must aim at his face to hit him)
Sound effect gets stuck on loopBoth?YesThe stuck sound stops if the menu is opened, but on resuming play, another sound will start looping instead.
Reloading a saved game will halt the sound loop. Passing to another level also works.
Frozen imp animates incorrectly2NoElusive bug; occurred in 64-bit 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.
Grondoval's head gets stuck in the ceiling1?No?See this video. I have not reproduced the glitch on either of my systems, yet.

"It's a feature"

Odd behaviors that probably should not be considered bugs.

BehaviorDescription
Fire resistance protects against projectiles that are not fireFire 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.
Monsters killing each other grants XP to playerProbably intentional. XP grant is done upon death of the monster, regardless of cause.

Miscellany

Other bugs and oddities.

BugWhich game?DescriptionEGwhaven fix?
Player not hit by thrown halberds2?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 wallBothPossibly 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 gameBothSeems 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.
No?
Weapons take damage even if attack missesBothNeeds more research, in Witchaven 2 run on DOS mode, damage only seems to occur if the missed hit strikes a wall. Damage when hitting air may be a glitch.
In WH1, missed strikes to air seem as if they can cause damage even on native.
No
Throwing a pike crashes the game1Possibly 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?
Automap is off center in 640x480 mode1Fixed in Witchaven II.N/A
Flight does not properly respect floor levelsBothIf using the fly down button over a floor, eye level can drop very low.No
Blue Midian swordsmen are deleted from the mapBothThe save game system 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.Yes
Exit pentagram is not correctly translucent2Known cause: The map setup code in Witchaven II removes the translucency flag from pentagrams.Yes
Outro sequence crashes with "no more radbuff pointers"2Only had this happen once so far. Related to free memory perhaps?No?
Always run oddity2In 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.No
Can't remap strafing keys2Some 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 game2?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 9xBothIf 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 HP2?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 DOSBox1?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?