Friday, February 11, 2022

Blast from the college past - old games

I don't consider myself a 'gamer' but have played various computer games over the years.  One fond memory is playing 'umoria' in college on an i286 Tandy 3000. It is funny to compare a game like this with today's modern games - this game has no fancy graphics/sound.  It is a text based game using the 'curses' library to draw the screens and control movement, etc. My kids would find this about as interesting as a rotary phone but back in college it provided some 'down time' from the normal course work.

I ran across source distributions for 'umoria' and another similar game named 'rogue'.  For fun, I wanted to see if I could even get them to compile and run - code bases that originated in the 80's tend to have some compatibility issues with modern C/C++ compilers & libraries unless someone maintained them.

I found 'umoria' here.  And 'rogue' was from here.

I had a bit more trouble getting rogue to run.   I don't know if the added include was needed - I was trying to sort out an error related to curses/ncurses. Eventually, I ran across a blog item mentioning a define for NCURSES_INTERNALS and a search of the header files returned it as well - so after ensuring it was defined as shown below - rogue compiled and ran.

The final 'configure' line I ended up with was:

CFLAGS='-DNCURSES_INTERNALS' CPPFLAGS='-DNCURSES_INTERNALS'   ./configure --build=x86 --with-ncurses

I also added a include after the #include<curses.h> in mdport.c.

#include<term.h>

I didn't confirm this was actually needed but just in case.

A quick screen shot of it..


For umoria, simply changing directory to the top of the git source tree and running the following almost worked.

cmake .

make

"Unfortunately", the compiler settings are more strict now and it complained about an array out of bounds issue during the build.

I didn't fully analyze the issue but took a guess that it was an 'off by 1' type error in the game_save.cpp file and made the following change which then allowed it to compile and run.

-                if (tile >= &dg.floor[MAX_HEIGHT][0]) {

+                if (tile >= &dg.floor[MAX_HEIGHT-1][0]) {


Here is a screen shot from umoria.


Thanks for reading..

Hope your day is blessed!

Scott







No comments:

Post a Comment