Ressurrecting HoverTank-3D in 2024

Hello everyone!

I was stumbling through my old DOS archive collected from many, many years of computing, when I found a directory called 'HOVER'. Looking into it, and tossing its START.BAT into Dosbox Staging, I found that I still had my copy of 1991's Hovertank-3D by Softdisk Publishing. THE Prototypical First Person Shooter from the Bad Boys of Id before Id was a thought in their minds.

It runs in Dosbox Staging just fine. That said though, with all of Ids other prototypical games of the era open sourced, I got curious as to Hovertank's status, and if I could get it to run natively on modern systems.

Turns out it was open sourced by the current rights holder, Flatrock Software in 2014. The original open source release is on github at https://github.com/FlatRockSoft/Hovertank3D.

Pure Borland 2.0 C++ code in 2024 is not that useful. After some investigating I found that an 'SDL Hovertank3D' port existed. I found it at https://github.com/Codes4Fun/SDL_Hovertank3D. Some other porting efforts existed, but as a Linux user, I found myself less interested in DotNet implementations and other odd languages. The SDL port kept the C++ code more or less intact.

This port uses CMake as its build system. I went ahead and cloned it, and tried to build it:

git clone https://github.com/Codes4Fun/SDL_Hovertank3D.git
cd SDL_Hovertank3D
mkdir build && cd build && cmake .. && make

This produced an error that appeared to me (Not a C++ programmer, but an excellent build hacker and integrator) that Codes4Fun used 'xor' as a variable name, which in more modern compilers than used at the time is now a reserved token.

/home/magamo/Projects/SDL_Hovertank3D/IDLIB_SDL.H:41:59: error: expected ‘,’ or ‘...’ before ‘xor’ token

I came to this conclusion by looking into this header file, and the C++ file it was referencing (IDLIBC_SHADERS.C [lines 204, 210 and 218] ) and seeing that it was being defined as an int, and used in comparisons. This was fixed by simply replacing 'xor' with 'x_or' in these four places. After another make, we got significantly farther into the build (78%) before the next errors showed up.

/home/magamo/Projects/SDL_Hovertank3D/HOVMAIN.C:798:15: error: ordered comparison of pointer with integer zero (‘FILE*’ and ‘int’)
798 | if (grhandle>0)
/home/magamo/Projects/SDL_Hovertank3D/HOVMAIN.C:800:18: error: ordered comparison of pointer with integer zero (‘FILE*’ and ‘int’)
800 | if (levelhandle>0)
/home/magamo/Projects/SDL_Hovertank3D/HOVMAIN.C:802:18: error: ordered comparison of pointer with integer zero (‘FILE*’ and ‘int’) 802 | if (soundhandle>0)

To me, it looked like another old syntax error that modern compilers balk at. From the look of them they're all trying to determine 'truthiness', so I replaced the comparison with unary checks
if (!soundhandle) and repeated this form for the other two errors. (This also tracked, because line 795 is a similar test in reverse: if (soundblaster)

After another make we had success! I had a binary called 'game', which I tossed into my ~/games/HOVER directory as 'HoverTank3D' and ran it. To my delight it runs very nicely. Although on my system it crashes on exit.

Enjoy everyone!