gaming  openbsd 

2022-11-20

lgeneral on OpenBSD

Armchair generals of OpenBSD

Few things can rattle the hollow space in my head more than spreadsheet-esque video games, but this text is not about those games. Panzer General is an old DOS wargame, in which one leads an army on massive hex maps depicting entire countries. This game is not quite as hardcore as, say, Garry Grigsby's War in the East/West, which may at times feel more like a job than an outlet. But Panzer General never really claimed to be a part of the extreme-wargames-club.

In simple terms, PG is a rather casual turn based strategy game, set during the second world war. Its ruleset is fairly basic but efficient. Think: 'calvary beats infantry, infantry beats archers, archers beat calvary.' Some call it the rock-paper-scissors ruleset, but reducing the game to such an idea might be doing a disservice to an otherwise fantastic piece of gaming history, which spawned numerous sequels and copycats. Funnily enough, installing many of today's modern PG clones will feel all too similar to the old DOS experience, as many of the scenarios seem no more than copy and pasted maps from the original in a fancier coat. A nitpicker might suggest that this only goes to show that good wargames all base their information on [the same] historical sources, but then this speaks about the timeless-ness of the original PG.

The game has since reached the status of abandonware and is freely downloadable wherever one may find it.

LGeneral

Dedicating a text to OpenBSD gaming with the use of DOSBox would not only feel like cheating, but in the case of PG would be littered with a whole lot more hacking and tuning. PG can be installed and ran in DOSBox, believe me, I tried it with the original disks, but to make it somewhat enjoyable takes time, effort and results in a very dated experience. This is where LGeneral comes in.

LGeneral is an opensource recreation of the original PG engine which can play scenarios from the original game, as well as user created campaigns both for LGeneral and the original. This means that to be able to play PG through LGeneral, one needs the original game's files - but it's not as simple as copying the files over and running LGeneral. Since the new engine recreates PG in its own way, it needs to transform the original files to its specific format. LGeneral comes packaged with lgc-pg, which aims to do that for you, but - this is where it gets tricky.

In my attempt to perform this transformation I ran into issues. LGeneral is old. Not the kind of old where it would no longer feel as an adequate replacement for the DOS experience - but old in the sense that some bits of it have broken along the way. This is true for the lgc-pg converter. Long story short, it's virtually impossible to perform the conversion on an OpenBSD machine. It's also been impossible to do so on a Linux machine. There is also the problem of uncertain documentation, where some sources claim that it's not so much the problem of the actual program, as it is an issue with some version of the original game and file naming conventions. What the magical combination is however, is nowhere specifically stated. I tried converting the files from my disks on both OpenBSD and a linux machine to no avail.

In a brief moment of nostalgia and many previous failed attempts, I decided to try again. Admittedly, I have not before tried digging through the code of the converter, or any other sensible steps like reaching out to the project's authors. Instead I gave up and played the K.U.K. campaign. This time was different. I found the original game files tarballed on the official site of LGeneral. (Along with several user made campaigns specifically for the engine - namely the K.U.K. campaign, which features the first world war). But you guessed it, the project expects you to download the original files and convert them yourself. Why not include the already converted files could be a licensing issue, or simple bragging rights that the converter program lgc-pg works great. Only it doesn't. At least until recently.

I downloaded the tarball, tried running it through lgc-pg. No dice. Then I tried on a recently updated debian machine for work. And it worked. It did it. The working original campaign now rested in /usr/share/games/lgeneral. Quickly I packaged the files and moved them to my OpenBSD machine. Note that the manual pages in the lgeneral package on OpenBSD are not updated for the OS specifications. The game on OpenBSD instead looks for files in /usr/local/share/games/lgeneral. I copied the files over and ran LGeneral. Voila. 2 years later since my initial attempt, I can play the original campaign.

I will try reaching out to the maintainer of the OpenBSD package to maybe at least help update the man pages and inform them that the converter might be busted. But to make matters simple for now - here are the converted files for you to enjoy without a hassle. Extract the tarball to /usr/local/share/games/lgeneral and play. It also includes the K.U.K. campaign.

Have fun, general.

Addendum

Since this is not mentioned anywhere in any of the documentation: To change the resolution of lgeneral, edit the file in $HOME/.lgames/.lgeneral.conf. The rest should be self-explanatory.

src: