Commander Keen 4 & 5 - Composite CGA Editions (by VileR)

Here is where to post about the latest Commander Keen fangame or modification you've finished, a new website you've made, or another Keen-related creation.
NY00123
Vorticon Elite
Posts: 508
Joined: Sun Sep 06, 2009 19:36

Commander Keen 4 & 5 - Composite CGA Editions (by VileR)

Post by NY00123 »

SECOND EDIT FOR SAME DAY (JUL 16): OK, here is the link to VileR's post about Keen 5 here: viewtopic.php?p=80917#80917

VOGONS post about the sub-topic: https://www.vogons.org/viewtopic.php?p=513325#p513325

ANOTHER POST EDIT (JUL 16): There's now a Composite CGA Edition of Keen 5 as well. You'll still need a compatible copy of Keen 5 (Apogee version 1.4). Details posted here and at VOGONS, but this specific post will still be about Keen 4.

FILE LINK EDIT (MAY 30): Minor updates to .PAT file from VileR; A few groups of patch lines were consolidated, and some bits of unnecessary code were removed (disabling/enabling interrupts across a single port write).

LATE POST EDIT (MAY 27): Been a bit confused about the ckpatch/upx/8088 bit; I've mistakenly concluded/assumed that VileR has re-packed the CK4PATCH.EXE file with upx, so it'll be compatible with the 8088. Instead, he's simply unpack the EXE. This post has been edited in order to reflect this.

Hey there,

I'm going to introduce a Keen-related project that VileRancour from the VOGONS forums (https://www.vogons.org/) has just released:

It's basically a graphics-mod of the CGA version of Keen 4, with a few bits of patching, that brings you Keen 4 with 16 colors (not exactly the same as EGA) with CGA's composite output!

Original topic: http://www.vogons.org/viewtopic.php?f=24&t=48215

Note that you'll want to run this either with a genuine CGA connected to a composite monitor, or DOSBox with machine=cga (preferably an SVN build, see above topic for more details).

His download link (patch only): http://int10h.org/filez/KEEN4C16.ZIP
- This requires Keen 4 v1.4 for the CGA, available from various places, like this: http://www.shikadi.net/keenwiki/Keen_4_ ... ersion_1.4

My alternative link (includes a copy of keen4c): http://www.filedropper.com/keen4c16complete20160530

More links shamelessly stolen from VOGONS:

https://youtu.be/VL1RcuZsnjg - Video: running in DOSBox
https://youtu.be/LJ_Fr7Ug7b4 - Video: running on real hardware (The Oldskool PC)

Note about patching

It's my impression that VileRancour hasn't really been familiar with Keen modding, and Keen mods in general. In the case of keen4c16, originally he hexedited the EXE. It was me who convinced him to eventually prepare the patch, created (mostly) automatically from a diff of the EXEs.

A few more notes

- If you try to run this under DOSBox with default settings (and especially a default SVGA machine), you're expected to get monochrome graphics. As said above, you should run with machine=cga, and better use an SVN build of DOSBox. Again, see above topic @ VOGONS for more details.
- For technical reasons, VileRancour preferred to use CGA mode 6 (monochrome 640x200 on RGB/VGA monitors), rather than mode 4 as usually done (4-colors 320x200 on RGB/VGA monitors). This also explains why you'll get monochrome graphics with (s)vga machines. Note that the omposite color burst signal is manually enabled by the way of a register write (it's disabled in mode 6 by default).
- If you're wondering if CKPATCH supports CGA Keens, my unofficial build numbered 0.11.2 is used (http://keenmodding.org/viewtopic.php?p=20128#20128). Note, though, that VileRancour unpacked the CK4PATCH.EXE file, since I originally packed it with upx such that it became incompatible with the 8088. While upx appears to have the option to preserve the computability, it's more-or-less unused for now.
- For the graphics, he used the last version of ModId available as Windows EXE (https://github.com/owenmpierce/modId). Although the CGA graphics are for a different CGA mode, their basic layout is exactly the same.
Last edited by NY00123 on Sat Jul 16, 2016 20:41, edited 8 times in total.
User avatar
Allstories
Annoyed Grunt
Posts: 84
Joined: Thu Nov 01, 2007 23:05
Location: Michigan
Contact:

Post by Allstories »

I feel like I must be doing something wrong, but idk what hahah

Image

That said, this looks gorgeous! I saw the 8-bit Guy's video about Composite CGA a few weeks back and was impressed but also confused as to why he would use Commander Keen as an example thumbnail when it's demonstrably not a good example of composite CGA. This looks great! Are there any images of the tiles/sprites? I kind of get the gist of how CGA color mixing works, but I'm really interested to see what this looks like under the hood, and how this conversion was executed.
Keening_Product
Kuliwho?
Posts: 2167
Joined: Fri Jan 20, 2012 7:02
Location: Tied up in the Oracle Chamber's basement
Contact:

Post by Keening_Product »

Heh, neat. Didn't know CGA could be bent that way.

Allstories, did you try VileRancour's "pre-baked" patched build of DOSBox?
Keening_Product was defeated before the game.

"Wise words. One day I may even understand what they mean." - Levellass
NY00123
Vorticon Elite
Posts: 508
Joined: Sun Sep 06, 2009 19:36

Post by NY00123 »

Hey there,

I should probably begin by actually posting a few screenshots. Simply stealing the ones from VOGONS...

Image
Image
Image
Allstories wrote:I feel like I must be doing something wrong, but idk what hahah
Heh, this looks a bit weird. Have you downloaded the archive as I've posted (which also includes a copy of the original game)? If yes, these should be the steps to follow:
- Extract the archive's contents to a new, empty directory.
- Start the extracted copy KEEN4C16.BAT from DOSBox in this directory, with machine=cga set in the DOSBox configuration which is used. (Admittedly, I tend to mistakenly start KEEN4C.EXE instead, which simply brings the usual RGB graphics).

You do seem to use an SVN build of DOSBox . Is it just an ordinary "vanilla" build? (Although I don't know how would other builds, like DOSBox-X or Daum, fail.)

Maybe you should reset some DOSBox configuration to use the default values, and then simply make sure that you have machine=cga set.
That said, this looks gorgeous! I saw the 8-bit Guy's video about Composite CGA a few weeks back and was impressed but also confused as to why he would use Commander Keen as an example thumbnail when it's demonstrably not a good example of composite CGA. This looks great! Are there any images of the tiles/sprites? I kind of get the gist of how CGA color mixing works, but I'm really interested to see what this looks like under the hood, and how this conversion was executed.
VileR has said in VOGONS that he plans to write more details about the patch in his blog: https://8088mph.blogspot.com/

Other blog posts may have some explanations about the way one can take advantage of CGA with composite (NTSC) output. I'm sure there are other resources with explanations, too.

What I can say, though, is that most of VileR's work on this patch was really on the graphics side, rather than coding. He manually made the graphics look as they do in CGA mode 6, with composite output and the color burst signal being (manually) turned on.
User avatar
Allstories
Annoyed Grunt
Posts: 84
Joined: Thu Nov 01, 2007 23:05
Location: Michigan
Contact:

Post by Allstories »

Haha, d'oh! I think I grabbed the wrong version of CGA Keen. I got it working. It looks great! I was surprised at how many colors are being made using only black and white. I'll definitely be interested to read more about the process of making this mod.

Here's what it looks like without DOSBox composite emulation, for the curious:

Image
User avatar
lemm
Blorb
Posts: 696
Joined: Fri Jul 03, 2009 10:18
Location: canada lol

Post by lemm »

If you squint your eyes enough, it looks like VGA!

(This is seriously neat, though).
User avatar
Levellass
S-Triazine
Posts: 5265
Joined: Tue Sep 23, 2008 6:40

Post by Levellass »

Methinks this needs a Keenwiki topic.

Can EGA be bent in a similar manner?
What you really need, not what you think you ought to want.
VileR
Grunt
Posts: 5
Joined: Sat May 28, 2016 6:16
Contact:

Post by VileR »

Heya, appreciate the interest in this.
I had never modded Keen before, so I gotta thank NY00123 for his help with CKPATCH and ModId, and for bringing some more attention to this. :)
NY00123 wrote:VileR has said in VOGONS that he plans to write more details about the patch in his blog
Allstories wrote:I'll definitely be interested to read more about the process of making this mod.
Here you go. TL;DR as hell, but that's what long train rides are for!
https://8088mph.blogspot.com/2016/05/do ... een-4.html
Levellass wrote:Can EGA be bent in a similar manner?
Unfortunately no-- no composite output on EGA.
However (there's always a "however", typically right next to the "but"): EGA had this little-used onboard 'feature connector', along with a pair of RCA outputs that could be used in conjunction. I suppose one could build a daughter-board of sorts with some CGA-like circuitry to generate a composite NTSC signal from the RGBI output (and a crystal?), which would get you 256 artifact colors at 4-bit 320x200... and potentially up to 65,536(!) at 640x200.

Definitely above and beyond anything I could do though, even if I wanted to. ;) Somehow the talk about a 256-color VGA version strikes me as more interesting...
User avatar
Levellass
S-Triazine
Posts: 5265
Joined: Tue Sep 23, 2008 6:40

Post by Levellass »

Also, I notice that's an NZ website linked in the OP. Where are you from Vile?
What you really need, not what you think you ought to want.
User avatar
kvee
Vortininja
Posts: 67
Joined: Sat Sep 26, 2015 11:17
Contact:

Post by kvee »

VileR wrote:256-color VGA version
A thousand times yes!
VileR
Grunt
Posts: 5
Joined: Sat May 28, 2016 6:16
Contact:

Post by VileR »

Levellass wrote:Also, I notice that's an NZ website linked in the OP. Where are you from Vile?
Hmm, an NZ website? nope, not me (I'm in Israel)... some services tend to redirect to local TLDs for some unknown reason, so if you're in NZ you may be seeing Blogspot with the ".nz" extension (if that's what you meant).
Keening_Product
Kuliwho?
Posts: 2167
Joined: Fri Jan 20, 2012 7:02
Location: Tied up in the Oracle Chamber's basement
Contact:

Post by Keening_Product »

Yeah, Blogspot localises its domain extension. It's really frustrating.
Keening_Product was defeated before the game.

"Wise words. One day I may even understand what they mean." - Levellass
VileR
Grunt
Posts: 5
Joined: Sat May 28, 2016 6:16
Contact:

Post by VileR »

kvee wrote:
VileR wrote:256-color VGA version
A thousand times yes!
Hey, you're the IMFPLAY guy... small world! :D
User avatar
kvee
Vortininja
Posts: 67
Joined: Sat Sep 26, 2015 11:17
Contact:

Post by kvee »

VileR wrote:Hey, you're the IMFPLAY guy... small world! :D
Yup, that's me! And I'm pretty sure I've seen this video before!

(Great job on 8088MPH, and I've gotta read your blog, looks like very interesting read!)
VileR
Grunt
Posts: 5
Joined: Sat May 28, 2016 6:16
Contact:

Post by VileR »

Didn't really think I'd stop at 4, did you? ;) Here's a composite CGA edit for Keen 5:

- Download (patch only; you need the original KEEN5 CGA v1.4, Apogee release).
- Youtube (DOSBox footage)

As before, it'll work on the same hardware as the Episode 4 mod, but for DOSBox here's my Windows SVN build which includes the improved composite & PC speaker patches.

Image

Image

Image

Image

Reworking the graphics for this was interesting, since the visual style is quite different to that of Keen 4 despite many elements being the same. Code-wise, the only really 'new' functionality for Keen 5 is the palette animation for the game over screen; the EGA version messes with the galaxy colors before the particle explosion (which, BTW, is a slideshow on a real XT!), but the vanilla CGA version settles for a boring static image, so I had to roll my own routine here.

Image
Post Reply