Issue with importing graphics K5

Request patches for Keens 4-6.
Post Reply
55Aavenue
Posts: 19
Joined: Wed Apr 04, 2018 7:19 pm

Issue with importing graphics K5

Post by 55Aavenue »

Well, attempting to start my Keen 5 project but ran into an issue I'm kind of stuck on. I haven't even really done any modifications yet just trying to get everything set up and working, following the exact process I did with my K4 mod. I got everything set up in Abiathar and made a few small test edits and made sure the edited game loads via play.bat. It does. Next test graphics modifying, keengraph exports the graphics no problem but after I re-import them (I only modified one point item just as a test), my game will no longer get past the initial loading screen. After the initial loading screen, and you press a key to continue, the screen goes blank. The commander keen text never starts to scroll and it just freezes. Abiathar will show the edited graphics whether I use tile sheet bitmaps or the EGA graphics settings (I tested both ways, same result), but the game will never load again unless I replace the K5 game files with my original ones again and start all over.

I've done a few things to narrow down the issue:

I eliminated Abiathar from the equation. I started a fresh folder with my K5 files no Abiathar or level editing, just UNLZEXE the K5 exe (tested, still working) added keengraph and ck5patch to the folder (still works), exported the graphics with keengraph (still works), imported the graphics and let keengraph generate its own patch file for ck5patch since Abiathar patching is out of the picture for this test and now it doesn't work, exact same issue as before.

Tried the same procedure with a different Keen episode. I did the exact same thing as above (no Abiathar again) just testing exporting then re-importing graphics with keengraph, this time with Keen 6 and ck6patch, and this time, the game loads and plays fine, and will show any graphics I edit.

So the issue happens only after I have imported graphics with keengraph (whether I've edited them or not), and only with Keen 5. At this point, I kind of think the problem is my original Keen 5 files somehow. It is version 1.4, but I had to update it to 1.4 from 1.0 using the updater linked on the Keen wiki, so possibly that could be the issue? I already had Keen 4 and 6 versions 1.4 so I did not have to update those.

Perhaps my next step is to get another version of Keen 5 and try that. I could buy it again off steam I guess(I have my original Goodbye Galaxy disk still and its even version 1.4 but I don't have a 3.5" drive that works anymore), but first I though I'd see if any of you modding experts out have any ideas...I am still new at this so I could be missing something obvious or maybe there's a Keen 5 quirk I don't know about.
User avatar
Nisaba
Posts: 320
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Re: Issue with importing graphics K5

Post by Nisaba »

As you've already mentioned the exe file itself could be causing the problem.
But if I remember correctly, KeenGraph & Modkeen don't really like each other very much. My question to you is: have you worked with this very Keen5e + modkeen beforehand?

This might be a matter of taste but I for one would highly recommend ModId as the modding tool of choice! Maybe you can give it a go and check if this already solves the prob.
User avatar
Fleexy
Site Admin
Posts: 490
Joined: Fri Dec 12, 2008 1:33 am
Location: Bloogton Tower

Re: Issue with importing graphics K5

Post by Fleexy »

I tried running the patcher on a Keen 5 v1.0 setup and the result was byte-for-byte identical to v1.4. Just to be sure, I tried a KG export/import cycle on both, and both hit the same problem you described. I fiddled around with it for a bit and still couldn't get it to work. Maybe there's a bug in it? Levellass might be able to troubleshoot further.

I tested with ModId and everything worked fine, modulo needing to edit the BMPs with classic MS Paint to avoid mangling the colors.
55Aavenue
Posts: 19
Joined: Wed Apr 04, 2018 7:19 pm

Re: Issue with importing graphics K5

Post by 55Aavenue »

I tried it with ModId and it works no problem. Perhaps there is a bug with keengraph and Keen 5 seeing as Fleexy had the same issue. Anyway, I guess I'll use ModId for this project - thanks for that suggestion. What I mostly liked about keengraph is how the numbered file names of the extracted files line up with with bitmap numbers you use when editing the help texts or ending sequence, but I shall adapt!
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Issue with importing graphics K5

Post by levellass »

Curious. Such a basic issue shouldn't be occurring.

The problem seems to be the fact that the %egadict patch CK5Patch uses is wrong, causing the modified graphics to be read incorrectly. (ModID uses the original DICT so this isn't an issue.) It's possible to simply remove all DICT files with this patch, but this will require decompressing the audio too. (It has the advantage of speeding up the game.)

Code: Select all

#Keen 5 - remove Huffman compression
%patch $13CC9 $55 $8B $EC $56 $57 $8C $DA $C4 $7E $0A $C5 $76 $06 $8B $4E $0E $D1
              $E9 $FC $F3 $A5 $73 $01 $A4 $8E $DA $5F $5E  $5D $CB
However this patch can be used to replace the %egadict with the PROPER patch and also solve the issue:

Code: Select all

#Patch the EGADICT
%patchfile $362C4 EGADICT.CK5

Honestly I'm surprised. CKPatch was wrong and not me? This is truly a landmark day.
User avatar
Fleexy
Site Admin
Posts: 490
Joined: Fri Dec 12, 2008 1:33 am
Location: Bloogton Tower

Re: Issue with importing graphics K5

Post by Fleexy »

Nice troubleshooting! In the next version, I'll have Abiathar generate your corrected EGADICT patch instead of using the %egadict command.
User avatar
Nisaba
Posts: 320
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Re: Issue with importing graphics K5

Post by Nisaba »

Indeed: Nice troubleshooting!
NY00123
Posts: 85
Joined: Thu Sep 24, 2009 8:03 am

Re: Issue with importing graphics K5

Post by NY00123 »

Just a side-note, but while more than two years passed, I think that I fixed CKPATCH's wrong %egahead offsets in that unofficial CKPATCH extension?

See here for current version (0.11.3 as of typing this) and download links: viewtopic.php?p=21358#p21358

Note that it was fixed in (unofficial) version 0.11.2: viewtopic.php?p=20128#p20128.

I also have the code on BitBucket. You can see the changes to the EGADICT offsets in this diff (emphasis on CK5PATCH.PAS): https://bitbucket.org/NY00123/ckpatch/c ... at=default
Post Reply