CKPatch extended for other games: Released!

CKPatch is a set of patching tools for all Keen episodes.
NY00123
Posts: 80
Joined: Thu Sep 24, 2009 8:03 am

Post by NY00123 » Thu Oct 24, 2013 9:12 am

After more than 2 years since the last unofficial update, another such (unofficial) update is ready!

The following version of CKPatch (again, unofficial) adds support for (unpacked) Monster Bash executables. Registered game release, version 2.1, is supported, and the same applies to the shareware release (not the lite one).

Use "%ext mb1" (or mb2; or mb3), "%version 2.1" for the registered release and "%version 2.1s" for the shareware release.

Note that you should use UNP v4.11 (DOS version is supported) for unpacking any of the Monster Bash executables.
For CKPatch itself (version 0.11.1, unofficial) and possibly a few more related files check out this web page: http://ny.duke4.net/files.html

levellass
Posts: 2685
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass » Thu Oct 24, 2013 9:47 pm

Well well now, this is a welcome development!

NY00123
Posts: 80
Joined: Thu Sep 24, 2009 8:03 am

Post by NY00123 » Sat Apr 09, 2016 11:58 am

Again after around 2.5 years (since the last release), there is another unofficial update available, being version 0.11.2. As before, it can be downloaded from the following place (hosted by Duke4.net): http://ny.duke4.net/files.html

First of all, A FEW SENTENCES OF WARNING: BACKWARDS COMPATIBILITY MAY BE PARTIALLY BROKEN WITH EXISTING KEEN DREAMS PATCHES. Reason is, if the line "%ver 1.31" is used in any Keen Dreams patch, it should now be "%ver 1.13" instead. As expected, this change has been applied since 1.13 is the actual version number.

It should also be noted that I haven't done much regarding Keen 6 v1.0, although CK6PATCH appears to have at least partial support for this.

And now, on to the list of changes (other than the KDreams %ver 1.13 fix):
- Support for CGA versions of Keen 4-6 is now in. This covers Apogee v1.4 of Keen 4-5 and FormGen v1.4 of Keen 6. Use "%ver cga-1.4" to filter by the corresponding CGA version.
- As a little bonus, Keen Dreams v1.05 (CGA release) is also supported now. "%ver 1.05" is the corresponding version filter. Reason I consider this a "bonus" is that it may be somewhat less useful. Ignoring the general lack of interest in CGA modding, not to talk about CGA KDreams modding, the availability of Keen Dreams sources is expected to make this redundant for very few individuals (if any).
- Note that the level names of the warp-only levels (6,8,11,13) in version 1.05 differ from the ones in 1.13, so bounds on alternative level names' lengths also differ.
- Added a new %wholemaphead directive. It's similar to %maphead, but patches in the whole MAPHEAD.EXT/MTEMP.TMP file, including the tileinfo, in case you have this ready. See e.g., any version of MAPHEAD.KDR from this repository (Keen Dreams sources, "static" subdirectory): https://github.com/keendreams/keen/tree/master/static
- %audiohed and %audiodct definitions have been fixed, so these should actually be usable now.
- Also fixed %egadict definitions in at least one place, as well as level names' lengths and %maphead maximum size for Keen Dreams v1.13.
- Previously, CKPATCH could patch xGAHEAD files to be a little bit larger than the originals. Reason is, these were defined to be segments in the EXEs, so the actual size of each piece of embedded data would be divisible by 16 bytes. For instance, a 630 bytes long file would be stored with additional following 10 bytes. As of this version of CKPATCH, this further applies the audio and map headers (including the tileinfo).

NY00123
Posts: 80
Joined: Thu Sep 24, 2009 8:03 am

Re: CKPatch extended for other games: Released!

Post by NY00123 » Sun Mar 26, 2017 7:57 pm

Think it's time for the first update since K:M has moved to new hands!

This is a bit of a possible less stable update, numbered 0.11.3. It may currently be downloaded from this link: https://www.dropbox.com/s/e2031k72aunk8 ... 0.11.3.zip

It's also (still) possible to get it from this page (again hosted by Duke4.net): http://ny.duke4.net/files.html

Summary of changes:
- Added support for Keen 6 v1.5. This covers the CGA and EGA executables altogether. They don't have to be unpacked.
- When used with Monster Bash, you don't need to unpack the executables any more.

Note that a few changes were required for the above, so again this release may be somewhat less stable:
- In contrast to other LZEXE-packed executables, the Keen 6 v1.5 exes have the "LZ91" signature censored (that is, replaced with NUL bytes). So now, the first 232 bytes of the embedded LZEXE decompressor stub are checked, instead. This is the method used by UNLZEXE 0.8 (compared to 0.7 which checks for the "LZ91" signature).
- The Monster Bash executables were originally packed with PKLITE v1.15, so some work was required to support this. Surprisingly enough (or maybe not so), it wasn't very different from supporting LZEXE-packed exes, since the decompressor is again run from the exe itself. A check similar to the one from UNLZEXE 0.8 is in use.

A few more points on the above:
- You may have spotted that a few txt files (like README.TXT) are marked as modified on July 30th, 2016, even though the recent version number of 0.11.3 is mentioned. This is because I'd already added support for Keen 6 v1.5, after lemm had started his work on support for Keen 6 in Omnispeak (https://github.com/sulix/omnispeak/). Back then, though, only the EGA version was supported, and the EXE had to be unpacked.
- My interest in PKLITE decompression is actually a kind-of recent thing, stemming from some interest to support Keen Dreams v1.00 in Reflection Keen (https://github.com/NY00123/refkeen/commits/). The latter made P4R4D0X lead me to this discussion: https://github.com/afritz1/OpenTESArena/issues/51.
Eventually, after contributors to OpenTESArena successfully got a working decompressor written in C++11, I modified it as required for Keen Dreams v1.00 and ported it to C for Reflection Keen. Furthermore, I asked for a bit more assistance, mainly to get CKPATCH working with PKLITE-packed EXEs. Eventually, though, again it wasn't very different from supporting LZEXE-packed EXEs.

User avatar
szemigi
Posts: 407
Joined: Fri Jan 23, 2009 8:06 pm
Location: Hungary
Contact:

Re: CKPatch extended for other games: Released!

Post by szemigi » Wed May 24, 2017 7:31 pm

And what about Catacombs 3D?

Because that's okay I built the source code of Catacombs 3D, but when I modificated and then imported a graphic - which was successful - then the EGADICT file appeared, then I ran the built EXE and the game crashed or I don't know (of course I unpacked the EXE, but there is no CKPATCH for it)

So CKPATCH should be extended for Catacombs 3D, too.

levellass
Posts: 2685
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: CKPatch extended for other games: Released!

Post by levellass » Fri May 26, 2017 10:26 pm

I have a program for running modified graphics with it (And only graphics) but it is not as good as CKPatch.

User avatar
szemigi
Posts: 407
Joined: Fri Jan 23, 2009 8:06 pm
Location: Hungary
Contact:

Re: CKPatch extended for other games: Released!

Post by szemigi » Fri May 26, 2017 10:28 pm

If you can send it, I want the link to it.

NY00123
Posts: 80
Joined: Thu Sep 24, 2009 8:03 am

Re: CKPatch extended for other games: Released!

Post by NY00123 » Fri Jun 09, 2017 9:52 pm

Hey there,

This is going to be a weird (and somewhat belated) response to the following topic I started over at PCKF: https://pckf.rigeltechnical.com/viewtop ... f=3&t=4046

So basically, with the possible exception of version of 0.5.0 of CKPATCH, I think that I got all copies versions of CKPATCH, from v0.5.1 and later, including binary and source archives.

I had this weird idea to upload all of them to a Mercurial repository, on BitBucket. I even tried to use original modification times of files/folders as base for commit times, although there may be mistakes and/or guesses (especially for a few timezones).

Link for *sources only*: https://bitbucket.org/NY00123/ckpatch/

Note that original archives (e.g., ZIP files) are currently not available at the above repo. I mistakenly remembered that, while BitBucket does not have GitHub's "Releases" feature, it still (supposedly) has a way to store binary uploads somewhere. (Looks like the archives available for download from the repo. are automatically generated from the various commits, or at least the tagged ones.)

A few interesting tidbits: Some of may assume the collection of the various CKPatch versions is a simple linear sequence, but it's not exactly the case. Here are the exceptions:
- v0.10.0 was originally created from v0.9.0, skipping v0.9.0-ext (which added support for a few more games).
- Then, not known to me until recently, 2009 had the release of what I called "v0.11.0-20090414" in this repository. This is a "v0.11.0" release which *differs* from the one prepared by Mink and more commonly used back in the days. It added to v0.10.0 support for Keen 6 v1.5, imported KDRPatch (like Mink's update, I believe) and further added support for Keen Dreams v1.93 (might be labelled as 1.17 somewhere).
- Later, Mink's *totally unrelated* release of v0.11.0, which I called "v0.11.0-20101222", essentially merged versions 0.9.0-ext and 0.10.0, and further added the %tileinfo command for Keen 4-6 and imported KDRPatch.
- On March of 2011, I took v0.9.0-ext and made a few small updates to BM*Patch, leading to v0.9.0-ext2. For some weird reason I didn't apply the changes to "v0.11.0-20101222".
- Later Mink was there, ready to release an updated version with my changes. I essentially merged versions 0.11.0-20101222 and 0.9.0-ext2, and also mistakenly left in a debugging-related message in CKXPATCH.INC. It's still in up to the last release. (Should probably be edited, if not removed).
- All later versions (that I'm aware of) were released by me, starting from v0.11.0-20101222 as a base. I have not used v0.11.0-20090414 so far.
- Surprisingly enough, not aware of v0.11.0-20090414, I separately added support for Keen 6 v1.5 in v0.11.3. There are a few technical differences related to detection of LZEXE-packed executables, though.

Finally, I've considered adding one more revision with a few minor updates, but then decided it probably won't help a lot anyway. I've also wanted to be done with preparing this repository for a reveal. Not sure I'll repeat such work soon (especially with the differing modification dates), heh.
szemigi wrote:
Wed May 24, 2017 7:31 pm
And what about Catacombs 3D?

Because that's okay I built the source code of Catacombs 3D, but when I modificated and then imported a graphic - which was successful - then the EGADICT file appeared, then I ran the built EXE and the game crashed or I don't know (of course I unpacked the EXE, but there is no CKPATCH for it)

So CKPATCH should be extended for Catacombs 3D, too.
Hmm, I think you asked about this beforehand, when you started to use ModId?

Also, I know it's probably not new for you but, no need to shout, heh. (Yeah, I'm talking about the combination of bold text, which might be OK in certain circumstances, with the larger font size, which is probably less desired.)

Well, it's a bit off-topic, since CKPATCH won't be required at all. However, for Catacomb 3-D graphics editing, these are the steps which can be applied:
- First of all, I assume that version 1.22 of Catacomb 3-D (the GOG.com one, and presumably the latest) is used. If you're trying to use v1.00, though, then luckily enough, a small edit of cat3d_software_122.def might be the most you'll have to do (see below). Reasons: v1.00 uses the same audio file (AUDIO.C3D), the exact same map header (C3DMHEAD.OBJ) data (even though GAMEMAPS.C3D differs), and while the graphics aren't the same, GFXE_C3D.H didn't change at all (so you can use ModId with the usual definitions for v1.22).
- Edit ID_CA.H and uncomment the definition of GRHEADERLINKED. This way, Catacomb 3-D will look for the external files of EGADICT.C3D and EGAHEAD.C3D, instead of requiring you to have their data linked into the EXE (from C3DEDICT.OBJ and C3DEHEAD.OBJ).
- In your project file (based on CAT3D.PRJ), you can then remove C3DEDICT.OBJ and C3DEHEAD.OBJ, since there won't be a need to use them any more.
- There should be no need to unpack or pack CAT3D.EXE with UNLZEXE/LZEXE, at all.
- The newly created EXE should then be able to read the modified graphics + original maps and audio (if not modified).

If you still want to create OBJ files from EGADICT.C3D and EGAHEAD.C3D, and link them into the EXE, then look in the Keen Dreams sources for Blzut3's MAKEOBJ.C and MAKE.BAT (the latter assuming a ready Borland C++ environment). MAKEOBJ can be used to embed a data file in a Borland C++ compatible OBJ file, and MAKE.BAT has a few examples of usage.

POST EDIT: Two possible ways to make ModId work with Catacomb 3-D version 1.00:
1. Use MAKEOBJ to extract EGADICT.C3D and EGAHEAD.C3D from the OBJ files. Afterwards, create a modified copy of cat3d_softdisk_122.def with the "EXEINFO" line removed.
2. Use a modification of cat3d_softdisk_122.def, with the details of v1.00 under EXEINFO. Luckily enough, I got to fill these here for Reflection Keen: https://github.com/NY00123/refkeen/blob ... _fs.c#L842, https://github.com/NY00123/refkeen/blob ... _fs.c#L858. This is the current structure of EXEINFO in ModId, btw: https://github.com/owenmpierce/modId/bl ... 456.c#L153
Last edited by NY00123 on Sat Jun 10, 2017 7:47 am, edited 1 time in total.

User avatar
szemigi
Posts: 407
Joined: Fri Jan 23, 2009 8:06 pm
Location: Hungary
Contact:

Re: CKPatch extended for other games: Released!

Post by szemigi » Fri Jun 09, 2017 11:01 pm

Alright, thanks a lot for telling me that way. I'll try it!

NY00123
Posts: 80
Joined: Thu Sep 24, 2009 8:03 am

Re: CKPatch extended for other games: Released!

Post by NY00123 » Sat Jun 10, 2017 7:48 am

szemigi wrote:
Fri Jun 09, 2017 11:01 pm
Alright, thanks a lot for telling me that way. I'll try it!
No problem!

Just mentioning, though, that I've had a mistake regarding support for Catacomb 3-D v1.00 in ModId (if you're using v1.00 and not, say, 1.22). So my post has been edited accordingly.

levellass
Posts: 2685
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: CKPatch extended for other games: Released!

Post by levellass » Sun Jun 11, 2017 10:23 am

This is the program that allows graphics modifications for catacomb 3D, it works on the version that is 187Kb when decompressed: https://www.dropbox.com/s/jilzxav5chgk3 ... H.zip?dl=0

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest