Ultima Underworld Stygian Abyss on RPi 2

12 minute read Published

Transport yourself back to 1992 with one of the best RPGs ever made.

I installed DOSBox on my Raspberry Pi today so I could play one of my favorite childhood games: Ultima Underworld - The Stygian Abyss. You can learn more about this game on Abandonia. If you like what you see, follow this guide to set it up on your RPi and be instantly transported back in time with this 1992 retro classic.

Requirements

  • Raspberry Pi with Raspbian or similar installed
  • Connected to a monitor, mouse, keyboard and speakers
  • With network connectivity

Experience

So far I’ve been able to get a pretty clean game intro video sequence. Actual gameplay is a bit choppy still, which should improve on the Raspberry Pi 2 with its quad-core 900MHz processor.

Update 17 Jul 2015: The game runs great on the RPi 2 Model B running DOSBox from RetroPie with EmulationStation. Unlike RPi 1 Model B+ there’s no chop in the audio, and the video is smooth like butter. You may or may not want to set the Memory Split setting under Raspberry Pi Advanced Options to 512.

Getting started

To play first you’ll need to install DOSBox on your Pi. To do so open a terminal emulator and use apt-get to install.

sudo apt-get update && sudo apt-get install dosbox

Once complete, test it out by executing startx in the terminal and then running the DOSBox Emulator from Menu > Games in the GUI. If it opens and you see a dos prompt your in business.

Note: Attempting to run dosbox from the console before starting the GUI may cause your Pi to freeze. If it does, disconnect and reconnect the power and complete the above step before continuing.

Get the game

Abandonia didn’t have a downloadable copy of Ultima Underworld 1 so I did a quick Google search and found a working copy of the game on an abandonware site called My Abandonware. Here’s the game download link. Go ahead and pull down a copy using the stock browser that came with your Pi’s GUI interface. Then unarchive it to the “dosprogs” directory created earlier.

Set a directory

You’ll want a place to store your DOS programs. DOSBox defaults to a directory called “dosprogs”, so let’s use that. Go ahead and create the folder to house your program archive.

mkdir ~/dosprogs # change to meet your needs

The result will be a folder called “dosprogs” in the home directory of the current user. If you’re logged in as Pi the folder will land under /home/pi. This is where you’ll store your programs.

Overclock the device

The days of hardware turbo buttons are long gone. But that doesn’t mean you can’t get a little extra oomph out of your Pi micro computer anyway. Log-off the current GUI session and enable Turbo mode from the Overclocking section after running sudo RPi-config from the terminal. You will be prompted to restart your machine if the settings took.

Configure DOSBox

Once overclocked to Turbo mode (1000mhz on a RPi 1 Model B) you’re ready tweak the DOSBox configuration. It takes a little time to get right, expecially if you’re not used to it, so just be patient. The result will improve your gaming experience and is time well spent.

Upon installation of DOSBox my config was located at /home/pi/.dosbox/dosbox-0.74.conf. I went ahead and made a back-up copy of the file before I started tweaking.

After looking over Raspberry Pi: Retro Gaming Mania Part 2 and using the DOSBox config as reference I landed on a specific configuration (see below) that worked well for me.

DOSBox Configuration
Expand to view configuration
  1# This is the configurationfile for DOSBox 0.74. (Please use the latest version of DOSBox)
  2# Lines starting with a # are commentlines and are ignored by DOSBox.
  3# They are used to (briefly) document the effect of each option.
  4
  5# Created by Josh Habdas on 5 Jul 2015
  6# Using a ProArt monitor with RasPi 1 Model B
  7# Optimised for in-game experience at Medium detail
  8
  9[sdl]
 10#       fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back)
 11#       fulldouble: Use double buffering in fullscreen. It can reduce screen flickering, but it can also result in a slow $
 12#   fullresolution: What resolution to use for fullscreen: original or fixed size (e.g. 1024x768).
 13#                     Using your monitor's native resolution with aspect=true might give the best results.
 14#                     If you end up with small window on a large screen, try an output different from surface.
 15# windowresolution: Scale the window to this size IF the output device supports hardware scaling.
 16#                     (output=surface does not!)
 17#           output: What video system to use for output.
 18#                   Possible values: surface, overlay, opengl, openglnb.
 19#         autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock)
 20#      sensitivity: Mouse sensitivity.
 21#      waitonerror: Wait before closing the console if dosbox has an error.
 22#         priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized.
 23#                     pause is only valid for the second entry.
 24#                   Possible values: lowest, lower, normal, higher, highest, pause.
 25#       mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the defaul value.
 26#     usescancodes: Avoid usage of symkeys, might not work on all operating systems.
 27
 28fullscreen=true
 29fulldouble=true
 30fullresolution=1280x1024
 31windowresolution=1280x1024
 32output=overlay
 33autolock=true
 34sensitivity=100
 35waitonerror=true
 36priority=higher,normal
 37mapperfile=mapper-0.74.map
 38usescancodes=true
 39
 40[dosbox]
 41# language: Select another language file.
 42#  machine: The type of machine tries to emulate.
 43#           Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, v$
 44# captures: Directory where things like wave, midi, screenshot get captured.
 45#  memsize: Amount of memory DOSBox has in megabytes.
 46#             This value is best left at its default to avoid problems with some games,
 47#             though few games might require a higher value.
 48#             There is generally no speed advantage when raising this value.
 49
 50language=
 51machine=evga
 52captures=capture
 53memsize=16
 54
 55[render]
 56# frameskip: How many frames DOSBox skips before drawing one.
 57#    aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!.
 58#    scaler: Scaler used to enlarge/enhance low resolution modes.
 59#              If 'forced' is appended, then the scaler will be used even if the result might not be desired.
 60#            Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai,$
 61
 62frameskip=3
 63aspect=true
 64scaler=none
 65
 66[cpu]
 67#      core: CPU Core used in emulation. auto will switch to dynamic if available and appropriate.
 68#            Possible values: auto, normal, simple.
 69#   cputype: CPU Type used in emulation. auto is the fastest choice.
 70#            Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch.
 71#    cycles: Amount of instructions DOSBox tries to emulate each millisecond.
 72#            Setting this value too high results in sound dropouts and lags.
 73#            Cycles can be set in 3 ways:
 74#              'auto'          tries to guess what a game needs.
 75#                              It usually works, but can fail for certain games.
 76#              'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails.
 77#                              (Example: fixed 4000).
 78#              'max'           will allocate as much cycles as your computer is able to handle.
 79#
 80#            Possible values: auto, fixed, max.
 81#   cycleup: Amount of cycles to decrease/increase with keycombo.(CTRL-F11/CTRL-F12)
 82# cycledown: Setting it lower than 100 will be a percentage.
 83
 84core=auto
 85cputype=auto
 86cycles=1633 # OC and push this as far as you can without making the audio choppy
 87cycleup=10
 88cycledown=20
 89
 90[mixer]
 91#   nosound: Enable silent mode, sound is still emulated though.
 92#      rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality.
 93#            Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
 94# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged.
 95#            Possible values: 1024, 2048, 4096, 8192, 512, 256.
 96# prebuffer: How many milliseconds of data to keep on top of the blocksize.
 97
 98nosound=false
 99rate=44100
100blocksize=1024
101prebuffer=20
102
103[midi]
104#     mpu401: Type of MPU-401 to emulate.
105#             Possible values: intelligent, uart, none.
106# mididevice: Device that will receive the MIDI data from MPU-401.
107#             Possible values: default, win32, alsa, oss, coreaudio, coremidi, none.
108# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use.
109#               See the README/Manual for more details.
110
111#mpu401=intelligent
112#mididevice=default
113#midiconfig=
114
115[sblaster]
116#  sbtype: Type of Soundblaster to emulate. gb is Gameblaster.
117#          Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none.
118#  sbbase: The IO address of the soundblaster.
119#          Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300.
120#     irq: The IRQ number of the soundblaster.
121#          Possible values: 7, 5, 3, 9, 10, 11, 12.
122#     dma: The DMA number of the soundblaster.
123#          Possible values: 1, 5, 0, 3, 6, 7.
124#    hdma: The High DMA number of the soundblaster.
125#          Possible values: 1, 5, 0, 3, 6, 7.
126# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer.
127# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, e$
128#          Possible values: auto, cms, opl2, dualopl2, opl3, none.
129#  oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well).
130#          Possible values: default, compat, fast.
131# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly).
132#          Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000.
133
134#sbtype=sb16
135#sbbase=220
136#irq=7
137#dma=1
138#hdma=5
139#sbmixer=true
140#oplmode=auto
141#oplemu=default
142#oplrate=44100
143
144[gus]
145#      gus: Enable the Gravis Ultrasound emulation.
146#  gusrate: Sample rate of Ultrasound emulation.
147#           Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
148#  gusbase: The IO base address of the Gravis Ultrasound.
149#           Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300.
150#   gusirq: The IRQ number of the Gravis Ultrasound.
151#           Possible values: 5, 3, 7, 9, 10, 11, 12.
152#   gusdma: The DMA channel of the Gravis Ultrasound.
153#           Possible values: 3, 0, 1, 5, 6, 7.
154# ultradir: Path to Ultrasound directory. In this directory
155#           there should be a MIDI directory that contains
156#           the patch files for GUS playback. Patch sets used
157#           with Timidity should work fine.
158
159gus=false
160gusrate=44100
161gusbase=240
162gusirq=5
163gusdma=3
164ultradir=C:\ULTRASND
165
166[speaker]
167# pcspeaker: Enable PC-Speaker emulation.
168#    pcrate: Sample rate of the PC-Speaker sound generation.
169#            Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
170#     tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'.
171#            Possible values: auto, on, off.
172# tandyrate: Sample rate of the Tandy 3-Voice generation.
173#            Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
174#    disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible).
175
176pcspeaker=false
177pcrate=44100
178tandy=auto
179tandyrate=44100
180disney=
181
182[joystick]
183# joysticktype: Type of joystick to emulate: auto (default), none,
184#               2axis (supports two joysticks),
185#               4axis (supports one joystick, first joystick used),
186#               4axis_2 (supports one joystick, second joystick used),
187#               fcs (Thrustmaster), ch (CH Flightstick).
188#               none disables joystick emulation.
189#               auto chooses emulation depending on real joystick(s).
190#               (Remember to reset dosbox's mapperfile if you saved it earlier)
191#               Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none.
192#        timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away).
193#     autofire: continuously fires as long as you keep the button pressed.
194#       swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks.
195#   buttonwrap: enable button wrapping at the number of emulated buttons.
196
197joysticktype=auto
198timed=true
199autofire=false
200swap34=false
201buttonwrap=false
202
203[serial]
204# serial1: set type of device connected to com port.
205#          Can be disabled, dummy, modem, nullmodem, directserial.
206#          Additional parameters must be in the same line in the form of
207#          parameter:value. Parameter for all types is irq (optional).
208#          for directserial: realport (required), rxdelay (optional).
209#                           (realport:COM1 realport:ttyS0).
210#          for modem: listenport (optional).
211#          for nullmodem: server, rxdelay, txdelay, telnet, usedtr,
212#                         transparent, port, inhsocket (all optional).
213#          Example: serial1=modem listenport:5000
214#          Possible values: dummy, disabled, modem, nullmodem, directserial.
215# serial2: see serial1
216#          Possible values: dummy, disabled, modem, nullmodem, directserial.
217# serial3: see serial1
218#          Possible values: dummy, disabled, modem, nullmodem, directserial.
219# serial4: see serial1
220#          Possible values: dummy, disabled, modem, nullmodem, directserial.
221
222serial1=dummy
223serial2=dummy
224serial3=disabled
225serial4=disabled
226
227[dos]
228#            xms: Enable XMS support.
229#            ems: Enable EMS support.
230#            umb: Enable UMB support.
231# keyboardlayout: Language code of the keyboard layout (or none).
232
233xms=true
234ems=true
235umb=true
236keyboardlayout=auto
237
238[ipx]
239# ipx: Enable ipx over UDP/IP emulation.
240
241ipx=false
242
243[autoexec]
244# Lines in this section will be run at startup.
245# You can put your MOUNT lines here.
246mount c /home/pi/dosprogs/ultima-underworld-the-stygian-abyss
247C:
248UW.EXE

The config is designed to go fullscreen on start and maximize display real estate, as well as balance the amount of processing needs with video framerate and UI responsiveness without lagging the audio.

Note: If you get stuck in full screen press Alt+Enter to toggle out.

If copying from my config, be sure to modify your monitor resolution (near the top) and [autoexec] instructions (near the bottom) to set the correct folder containing the game downloaded earlier. Here’s a resolution cheet sheet to get you started. Refer back to the Download section above for the mount point if necessary.

Here’s an example [autoexec] for the game you can drop into your config:

mount c /home/pi/dosprogs/ultima-underworld-the-stygian-abyss
C:
UW.EXE

Enable audio playback

If you’re using HDMI for video out from the Pi you may need to adjust your speaker settings to achieve audio. Run sudo raspi-config from a terminal emulator and adjust the setting for audio from under Advanced settings. Then ensure you select SoundBlaster or SoundBlaster Pro from the INSTALL.EXE included with the game before running the main executable.

Customizing experience

To arrive at the best setup for your config, once you have the video settings set the way you like them and the audio enabled, use the performance shortcuts to fine-tune the experience:

  • Ctrl+F7 decreases frameskip
  • Ctrl+F8 increases frameskip
  • Ctrl+F11 decreases cycle speed
  • Ctrl+F12 increases cycle speed

The value of each of the settings can be seen while DOSBox is in windowed mode. If launched from terminal within X the settings will be output back to the terminal window as they’re updated.

Once you find the settings which work best for you, set them in the configuration file. See the Special Keys on the DOSBox Wiki for additional keyboard shortcuts, including Ctrl+F9 which is useful for quitting a game if it freezes during game play.

That’s a wrap

In the article we learned how to set-up the Raspberry Pi to play Ultima Underworld - The Stygian Abyss, one of my favorite games as a kid. And probably one of the best games ever made.

As you look into the Orb you know it leads to Britannia…