lwciv…

Last fall, I had this notion that it ought to be possible to implement a Civilization style game on the Coco3. With 512K RAM and 320×225 16 colour graphics, such a game should be at least as playable as the original civilization. Based on that notion, I set about tinkering to see if it was, in fact, plausible to do so. Herein are chronicled my adventures so far.

The first thing that occurred to me was that I needed to play the original Civilization to get a feel for it. I dug up a copy of it somewhere, fired up a DOS emulator, and set off to play. The first thing I realized is that the graphics in 16 colour mode suck, especially for one such as myself who is partially colour blind. It is not clear whether there is anything that can be done to help that given the limited palette available.

The second thing that became obvious quickly is that I would need a text rendering scheme. Notably, I would need to be able to render a proportional font with a few formatting features such as automatic line breaks, centered text, and some text colour effects. Based on that, I set off to implement exactly that on a 320×225 screen on the Coco3. In a surprisingly short time, I managed to create a basic font rendering routine and an overall text rendering routine. I also managed to track down a proportional font from somewhere. This particular part of the process was not particularly interesting and the code is not in any fit state to share at the moment. (Read: I can’t actually find it right now.)

Another thing I realized is that it would be helpful if I had the original Civilization graphics as a reference when working out how to do things on the Coco3. I started poking at the data files for the original game and I realized quickly that the data was compressed or otherwise encrypted somehow. Some trawling around the interwebs revealed that nobody who tried really understood how that coding works but one person did manage to document what the decoder needs to do, if not why. Based on that information, I cranked up my Mad C Skillz and implemented a decoder into which I fed the main data file which contained all the sprites. It was quite informative when I decoded it to 320×225 and fed the result straight into the Coco3. Wonder of wonders, it decoded to something useful.

I puttered around for some time after that attempting to create a tile rendering process for the map display. That proved to be relatively simple and it wasn’t long before I had it rendering blank ocean tiles. This is, of course, not terribly useful in itself but I didn’t have anything to render yet. Obviously I needed a map generator.

Map generation proved to be elusive. This is partly due to the fact that it is pretty much impossible to discover how, exactly, the maps in any Civilization game are actually generated without decompiling the binaries. This is not something I particularly wanted to do. I also found it very easy to be distracted by other things due to the complexity of generating reasonable maps. As a result, lwciv languished on the “Maybe I’ll get back to it one day” pile until recently when I starting poking at it again. More on that in the next post.

One thought on “lwciv…”

Leave a Reply

Your email address will not be published. Required fields are marked *