Heretic II Troubleshooting & Tweaking Document

INTRODUCTION

With a project as complex as Heretic II and such a big variety of Amiga systems out there, a certain probability remains that people will have trouble getting it to run correctly. This guide is intended to help those people and give additional information on how to tweak the performance of the game in general.

This guide is divided into two parts. Part one is a general troubleshooting guide that I assembled mostly from feedback I got regarding the Demo. Part two contains tips on how to tweak the performance and frame rate of the game.

PART ONE: TROUBLESHOOTING FAQ

"I am using Picasso96 V2.x and am getting a flickering display almost constantly during the game. What should I do?"

There seems to be a problem with V39 multibuffering. From a shell, enter the following: setenv HereticII/oldstyle 1

If this does the trick, make the setting permanent by entering: COPY ENV:HereticII/oldstyle ENVARC:HereticII

"During the game, Corvus seems to frequently hang on some edges. For example, walking into the water in the tutorial level is impossible, since Corvus snaps back from the edge. I have to jump to get him into the water."

This happens at low frame rates. The only thing you can do is get the frame rate higher. Refer to part two of this guide.

"I sometimes get a 'Recursive Shutdown' message during the game, for example when climbing down the rope in the first level."

"I do get into trouble with my 64 Megs of memory. "

The rope in the Silverspring Dock level is the end of the level. The game needs a bit more memory during level changes, so memory shortages might occur at this time. With a system with "only" 64 Megs, you will have to make sure that as much memory is possible is free. There are a few things you can do:

"I had a low-on-memory-crash when I finished a level, but before the new level loaded. Do I now need to fight against the end boss of the last level again ?"

You do not need to. When you enter the savegames again, you will see a savegame called ENTER , you can simply load this savegame, and once you loaded this, save again and you are fine in the new level. If you get such big memory problems, you should have a look at the above mentioned hints to save memory, though, we recommend.

"The lever in the water cave in Kell Caves does not open the door like it should be. And after Corvus tried to move the lever the first time, he just ignores it from nowon, and I now cannot open this door." This seems to be a bug in the original game, not in the port. It does not happen for all players, some people do not have this problem. If you are one of the people having this problem, do like described in the following to be able to open the door:

"I try to use the 400x300 or 512x384 resolutions, but I always get a 640x480 screen with the game in the upper left corner."

Use your graphics software's mode building utility to make a 400x300 or 512x384 screen mode. If you don't have one of these modes, the BestModeID() OS function will always pick the larger one, in this case 640x480. Refer to your graphics driver software's manuals for a description on how to create Screenmodes.

"I try to use the software renderer at 640x480, but when I switch on double buffering I get a "can't open screen" error message."

You may not have enough free graphics memory to open such a screen. Since Heretic II uses a 16 bit display in software rendering too, you will need at least 1,228,880 bytes of free video ram to open a double-buffered display. If you have a large workbench screen, this might not fit. Furthermore, some programs allocate bitmaps in video ram, which might also make it difficult to fit a double-buffered screen into video ram. Try to quit everything and reduce the workbench size to a minimum before you start Heretic II.

"I have difficulties running the game on AGA."

Make sure that the PAL monitor driver is in your DEVS:Monitors directory (and it should be started too, which is automatic if you haven't modified your startup-sequence). Also set the variable HereticII-Demo/ham to 1 (the GUI in the full version does this automatically).

"I get unexplainable crashes after just a few seconds of running Heretic II."

Make sure you set your RAM speed to 70ns. There seems to be severe problems with some RAM chips and large applications when the speed is set to 60ns. This is not a bug in Heretic II, but rather an inconsistency between RAM chips, or a loose interpretation of manufacturers about what "60ns" really means.

"I don't have a sound card, does using AHI give me any advantage?"

No. It will make things slower, but not better. AHI is for soundcard owners and should be avoided if you don't have one.

"I set the 'Same Map' deathmatch flag to 'N', but I always end up in the same deathmatch map even after the fraglimit or timelimit have been hit."

When you start a deathmatch from the menu, the "sv_maplist" variable will not be set. For map cycling to work, you will have to set this to a list of maps that should be cycled. For example, if you want to cycle through the dmandoria and dmcloud deathmatch levels, enter the following from the console before starting the deathmatch:

set sv_maplist "dmandoria,dmcloud"

Maps are specified without the ".bsp" prefix, separated by comma.

"The videos come out all mangled, I get dots and frame skips. What can I do?"

"I do get a white or yellow bar at the bottom of the screen while playing videos."

These questions are related. The Smacker video codec works best with a screen mode of 320x200x8. You will have to define such a screenmode to get rid of the colored bar.

To get a smoother playback, try to raise the buffers of your CD-Rom drive. The way this is done depends on the file system you use, but most likely there is an entry in your icon or there is a prefs program for it.

Furthermore, you should optimize your AHI unit 0 for speed. Most notably, select an 8 bit non-panning mode (no "++" in the name) with only two channels, and a mix frequency of 22KHz.

Also note that a CD-Rom driver with at least 4x will be required, the more the better.

Especially people using IDE-Drives still could not get a decent speed out of Smacker sometimes. You might wish to install the Smacker Movies on the Harddrive, if this is the case for you. In the Heretic II Directory there is a subdirectory base/video. If you copy the Video files from cd0:base/video to there, they will be played from the harddrive. In this case remember to give some addbuffers to your harddrive.

More modern filesystems like SFS or PFS might also improve the replay-speed of Smacker Movies.

It should be noted that the combination between IDE Bus and 25 MHz 040 on 68k side is a problematic one for Smacker...

PART TWO: PERFORMANCE TWEAKING

General

Do not use AHI if you don't have a soundcard. AHI will introduce an noticable overhead because of its generic mixing routines. In short, it will make things considerably slower, even more if you have slow 68k CPU like a 040/25.

Heretic II uses a console variable ami_soundcache for specifing the size of the sound effects cache. Although you won't notice any speedup during a timerefresh command, the general performance will improve if you set this to something higher than its default settings - provided you have the memory. See below for more information on that topic.

Software Rendering

If you are using the software renderer, you should select a resolution that is adequate for your system. The 603e 160 will not be able to cope with a 640x480 display, it is recommended that you use 320x240 for that. For the 240MHz 603e or the low-end 604 systems, you might want to try a 400x300 resolution. Finally, high-end 604 systems (200 MHz or faster) can use 512x384 or even 640x480, although most users will find the latter one too slow. Much lagging is caused by the caching if the caches are set too low. The default setting is selected for 64 MB systems, if you have more memory you can raise this setting. For 100 MB systems, you can safely set both the ami_imagecache and the ami_soundcache variable to 5000000, although the ami_soundcache variable need not be set much higher.

Hardware Rendering

Most problems with slow hardware rendering performance have proven themselves to be either caused by overheating, or incorrect installation of Warp3D. If your system gets very hot, you should try to add a cooler to it. Especially in an un-towerized A1200, heat can be a severe problem.

Incorrect installation of Warp3D may have severe impacts on performance. First of all you should try the Warp3D demos to see if they run and at what frame rate. For example, the "Engine" demo should show more than just a few lines of text and two red gouraud-shaded polygons. If you don't get this, refer to the "Problems.txt" file in the Warp3D archive. It has a detailed listing of version numbers of different libraries required for Warp3D to operate properly.

On the Heretic II side, there are a few console variables that can be used to tweak performance too. If you install the game in "Expert" mode, then the installation script will offer you the possibility to do this in a bit more "interactive" way. We'll go into a few details here but be warned that some of this might potentially lead to instability.

The first thing you should do if you think Heretic II is too slow, is to reduce the "Effects Detail" in the video config menu. The special FX employed by the Heretic II engine are quite heavy, especially since they use a lot of overdrawing. Also, the issues about the ami_soundcache variable mentioned above applies to the hardware renderer as well.

The following console variables have an impact on Heretic II's performance:

This will usually be set to "2" to indicate double buffering. You may set this to "3" if you have a graphics card with at least 8 megabytes. You will also want to set gl_sync to 0 in this case. gl_sync will enable (if set to "1") or disable (if set to "0") vertical synchronisation. When this is enabled (i.e. set to "1"), then after rendering the frame the game will wait until the vertical blanking face and switch display there.

With two buffers, the game usually shows one buffer and draws to the second. When the second buffer is full, it must wait until the first buffer is no longer visible, otherwise you would see the update of the next frame.

With three buffers, the game can show buffer 1, draw into buffer 2 and when this one is filled, continue drawing into buffer 3. When the vertical blank occurs, the buffers are switched, meaning the former buffer 2 will now be the visible buffer, buffer 3 will still be drawn into and buffer 1 is now free when buffer 3 is full.

With double buffering, the maximum frame rate is closely coupled with the refresh rate of your monitor. For example, if your monitor does 100 Hz, meaning 100 frames per second, then this will be the maximum that Heretic II could do. Furthermore, when Heretic II does take slightly more than 1/100 of a second to render a frame, frame rate will drop to 50 fps since the game will wait the next frame for the vertical sync.

Triple buffering will allow the game to operate at full speed, since it will not have to wait for the buffer switch. In the above example, this means that if it takes slightly more than the 1/100 of a second to render the frame, it will still immediately start rendering the next one.

gl_texturecache

Since some of the levels in Heretic II use a lot of textures, and a lot of *large* textures, it is next to impossible to fit those into a physical memory of less than 128 MB. To prevent this, the Amiga version uses a cache where textures are loaded into and replaced if a new texture must be loaded and memory is full. This works reasonably well but might cause frequent disk accesses. The gl_texturecache variable specifies how much memory should be used. The default value is selected to suit a 64 megabytes system, there is however no need to restrict yourself to using 64 megabytes if you have considerably more than that. As a rule of thumb, you should set this variable to the size of your main memory minus 70 MB. For example, if you have 80 MB, you can set gl_texturecache to 10 MB. There is no need to set it to anything higher than approx. 25 megabytes.

gl_forcedepth

This specifies the minimum depth that Heretic II should use. Although it will not affect speed, display quality will be improved if you set it to 16. Heretic II will not work in 24 bit mode.

A few words about the Permedia 2 chip

The Permedia 2 based cards were advertised as offering "workstation class graphics performance". While it is true that those chips have been frequently used in expensive GL accelerators, most of the times these where used in conjunction with GLint/Oxygen chips that are not available on the Permedia-2-based Amiga cards. The Permedia 2 is, by all means, an outdated chip. Its performance is below the class of even a Voodoo I, plus it is missing a few crucial blending features that make it necessary to emulate certain features (as seen, for example, with the fires in Heretic II). The fill rate of the P2 is far below what even a low-end 3D card on the Wintel market will deliver. For example, when I start the second tutorial map in 320x240 fullscreen, a "timerefresh" delivers 72 FPS, while it delivers 102 FPS when I resize the screen to the smallest possible size. Although it might be arguable if 72 vs 102 FPS really makes that much difference, this is on a screen with very few pixels to start with, and in 640x480 the difference becomes much more obvious.

Bottom line is that at higher resolutions, the graphics card will slow down the CPU. Heretic 2 would be able to go faster (remember the 102 FPS) if there was a more decent graphics chip. This observation is further confirmed by our assessment that a 200 Mhz Cyberstorm PPC is roughly equivalent in performance to an AMD K6-2 @400 Mhz.

For a very interesting speed comparison: Ravensoft has this document on their web page: Timings

The comparisons have been done with a Pentium II 400, which is by all means a much more powerful machine than a 200 Mhz PPC, with a few PCI- and AGP-based graphics cards. Not only was the Permedia 2 the slowest card in the lot, it was actually slower in 320x240 than software rendering! Furthermore, the Amiga version on a Permedia 2 is even faster than that. This clearly illustrates the need for updated hardware on the Amiga (Despite the fact that on a 200 MHz Amiga with Permedia 2 it runs much faster than on a 400 MHz PC with Permedia 2 in 3D Hardware Rendering).

Hyperion Entertainment Software