Can CKSRCMOD, in theory, be used to port CK4?

Tools, assembly, and file formats.
Post Reply
buricco
Posts: 3
Joined: Sun Feb 12, 2017 2:41 am

Can CKSRCMOD, in theory, be used to port CK4?

Post by buricco »

Hello, new (and bit of a n00b) poster here. I used to do some hacks on Wolf3D about 15 years ago and have some experience working with Borland C++ 3.1, as I used to do a lot of my personal coding with it.

OK, here's the idea. I read that some people around here cooked up a source tree that should be able to run Commander Keen 4 in its original environment, though I haven't put that to the test.

For some years, I've entertained the thought of bringing Commander Keen 4 specifically to other systems, and obviously if I had a buildable source tree, that's not entirely out of the question - so I guess my first question is, can cksrcmod be used to build a replacement for "keen4e.exe" ? From a quick analysis, I'm guessing if it's possible, it probably shouldn't be too difficult.

The idea came to me when a friend of mine who does hacking on the Sega Genesis sent me a random piece of music he was asked to recreate for someone else, and asked me if I could identify it. It was the first stage music from CK4. ;)
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Re: Can CKSRCMOD, in theory, be used to port CK4?

Post by lemm »

Hello,

I did cksrcmod and yes you could use it for that purpose.

Check here: https://davidgow.net/keen/omnispeak.html and here: https://github.com/sulix/omnispeak

CK4 has been reverse engineered for omnispeak and it is completely authentic, as far as I can tell.
buricco
Posts: 3
Joined: Sun Feb 12, 2017 2:41 am

Re: Can CKSRCMOD, in theory, be used to port CK4?

Post by buricco »

Thanks.

I'm not leery of coding, but I am a little leery of blindly fumbling through other people's code - anything specific that would need to be tweaked for the purpose of using the CK4 files, other than the extensions?
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Re: Can CKSRCMOD, in theory, be used to port CK4?

Post by lemm »

There are a few things:

1. Modid.exe, the graphics import/export tool, has been updated since I released cksrcmod. Download this zip file, which has it. Modid is on my github page.

Updated CKSourceMod
ModId.

2. #define NEWMODS is enabled by default, which saves memory by shifting sprites on the fly. This is a modification that I added to the engine, so if you want to disable that (maybe to play the game on a real 286), then you'll have to use a sprites.txt file that has shift values other than 1 (for which an example is also provided in the BMP folder).


Other than that, you'd just need to go through the tedious process of redefining constants and copy-pasting stuff from omnispeak into your mod. Note that a lot of the omnispeak code is newer than what is in the CK source mod, whose code hasn't been modified since Feb 2016. There may have been some very small tweaks to the core physics code since then (or maybe not; I can't really remember).
buricco
Posts: 3
Joined: Sun Feb 12, 2017 2:41 am

Re: Can CKSRCMOD, in theory, be used to port CK4?

Post by buricco »

Thanks, I'll see if I can make something of it. :)
Post Reply