Keen: Galaxy editor - it's coming

Utilities for editing Keen:Galaxy and Keen:Dreams levels.
User avatar
XkyRauh
Posts: 1114
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

Post by XkyRauh »

Works great, this time! Yay! :) Gimme a second to try it with my custom graphics and stuff...

Edit: Hahaha holy crap, that booted it in the rear so hard Windows asked if I wanted to send an error report.

I'm going to email you my Maphead.ck4, Gamemaps.ck4, 4TIL0000.bmp and 4TIL0001.bmp, so you can see what I'm working with.

Maybe this has something to do with the TED5 workaround compression/fake compression we've developed? I don't know all the technical stuff.
User avatar
ckguy
Posts: 465
Joined: Tue Oct 14, 2003 11:20 am
Location: Wakefield, RI, US
Contact:

Post by ckguy »

XkyRauh wrote:Maybe this has something to do with the TED5 workaround compression/fake compression we've developed? I don't know all the technical stuff.
Ooh, this is quite possible. Yes, I think you should try carmackizing the maps again ... the editor expects them to be in the standard format, which my fake carmackizer does NOT use.

I'm checking my mail now.

(edit) yep, it crashes ;-) Trying to figure this out now ... I'm running from the original (uncompiled) source file now, which gives me actual runtime diagnostics ...

The tiles you have so far look nice, btw. Like the one-level-mod ... but better!

(edit) Hmmm, the gamemaps file look all right - at it looks like a normally formatted one. The problem seemed to be the maphead file, the offsets were all weird. I'll email you one I made with fixed-up offsets. However, I am slightly suspicious that you did not include the right gamemaps file ... the levels all look identical to the originals (except with the different tileset, of course).

... wait, nvm, I just checked your levels with the original tiles and border village had been changed. So I really don't know what happened with your maphead file.

(edit) So I emailed you the new corrected maphead file, and in the process of writing the email I think I have an idea of what the problem was - It looks like you ran ted5's carmackizer, but I don't think you ran fixmhead afterwards. My editor expects the maphead to be in the same format as is used by Keen.

(edit) Now LL's here, yay!

(edit) ... awww, and she left too :-(
Last edited by ckguy on Sun Feb 03, 2008 6:40 am, edited 1 time in total.
User avatar
XkyRauh
Posts: 1114
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

Post by XkyRauh »

Alright, so lemme clarify, as this seems to be an error on my part, not your editor's: After I Carmackize within TED5, I need to run FixMHead? I wasn't aware of that (oops)!
User avatar
ckguy
Posts: 465
Joined: Tue Oct 14, 2003 11:20 am
Location: Wakefield, RI, US
Contact:

Post by ckguy »

Indeed. Try it and see if it works (i.e., gives you a maphead that lets you load the levels in my editor and lets you play them with ckpatch).

As for whose fault it is - I could probably always put more sanity checks in my programs. ;-p
User avatar
XkyRauh
Posts: 1114
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

Post by XkyRauh »

Alright, after I finish up with TED5, I did a FIXMHEAD.EXE GAMEMAPS.CK4 MAPHEAD.CK4 and then I moved both the edited GameMaps and the new MapHead file into the Tpt3 folder. It no longer crashes hardcore, it simply gives me an error that "repetition count must not be negative."
User avatar
ckguy
Posts: 465
Joined: Tue Oct 14, 2003 11:20 am
Location: Wakefield, RI, US
Contact:

Post by ckguy »

You need to do a "fixmhead ck4mhead.obj maphead.ck4" The .obj file, which is meant to be linked in with Keen when it is compiled, is also the properly-formatted mapheadfile with 128 bytes on the front. All fixmhead does is load in its first file, strip 128 bytes off the front, and stick it in the second file.
User avatar
XkyRauh
Posts: 1114
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

Post by XkyRauh »

Alright--thank you for clarifying. This is going to be a fairly stupid question, but where is that information documented?
User avatar
ckguy
Posts: 465
Joined: Tue Oct 14, 2003 11:20 am
Location: Wakefield, RI, US
Contact:

Post by ckguy »

I'm not sure - I just did some poking around, but can't find that information anywhere. And since I can't remember where I found it, I think it might have been accrued from several sources over time. ;-) A combination of the "Changing the World / Editing Keen with TED" article in the first Keen Newsletter, partly from the contents of the GOx.BAT files, and partly from ... I don't know. Sorry. Maybe some posts of Andrew's somewhere.
User avatar
XkyRauh
Posts: 1114
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

Post by XkyRauh »

Fantastic. Photachyon Transciever loads my levels nicely now... so here's some feedback, which will hopefully help.

In TED5, if I push SpaceBar to pull up a list of tiles, I can use the {C}opy mode to select a big chunk of tiles to put into my levels--that's the reason there's so much wasted space in the default tilesets, is because things are being laid out in a way that makes cut-paste level building possible. If I try to {C}opy in tPT, I'm actually copying my level, which is hidden behind the tiles overlay. :\ Not very useful.

I found the editing itself to be very intuitive, and similar enough to TED5 that I think going between the two won't be an issue.

The trouble comes from saving--Keen won't load my maps, after they've been saved in tPT. :) If I run it straight from Windows, I get a "Unending Foreground Animation!" error; if I run it in DOSBox, I get a "Block not found." error. This is both before and after trying the FixMHead thing.

Hopefully one of the things we can accomplish, out of this whole thing, is a straightforward set of directions on how to get maps working. :) My XkyKeen4.pat file is a MESS in the header, with about six different file pointers, and I don't think I need all of 'em!
User avatar
ckguy
Posts: 465
Joined: Tue Oct 14, 2003 11:20 am
Location: Wakefield, RI, US
Contact:

Post by ckguy »

Okay, the original way that everything in tededit.zip was set up was very confusing. The GOx.BAT files would check to see if custmaps.ck? existed, if not, it would copy gamemaps.ck? to custmaps.ck?, then run fixmhead, then call ckpatch with a patch file something like:

Code: Select all

%ext ck?
%gamemaps custmaps.ck?
%maphead maphead.ck?
%end
No offense to whoever set it up, but it is a confusing way of doing things. I think it was probably adurdin, and I probably shouldn't be saying things about him on his forum ...

With TPT, there is no custmaps.ck? file and there is no ck?mhead.obj file, there is no go?.bat file, and there is no fixmhead. The editor reads/writes gamemaps.ck? and maphead.ck? directly. This means that your script file should be:

Code: Select all

%ext ck4
%maphead maphead.ck4

(patches here)

%end
There should be only one of the 'file' commands. The gamemaps one is not needed because Keen's default place to look (gamemaps.ck?) is the correct file. What might be happening is that you have "%gamemaps custmaps.ck4" in there, which would tell Keen to use an older version of the gamemaps file (because TPT doesn't write to custmaps).

Also, you might have a %ckmhead.obj command. This command was added in version 0.9.0 of ckpatch, and combines the functionality of fixmhead and %maphead. It reads in its file, strips off the initial bytes, leaving the maphead resource, and then patches it into memory. Again, TPT doesn't write to ck4mhead.obj, so such a %ckmhead.obj command would tell Keen to use an old version of the maphead resource.

What I would recommend doing is creating a go4.bat file that looks like:

Code: Select all

ck4patch patch4.pat
The patch4.pat file should look like:

Code: Select all

%ext ck4
%maphead maphead.ck4
%end
After everytime you run TED5, make sure you run fixmhead with:

Code: Select all

fixmhead ck4mhead.obj maphead.ck4
You might want to put this in a .bat file as well.

*whew* Long post. Hope this is clear enough. I tried to give you some of the why's instead of a bunch of unexplained instructions.
User avatar
XkyRauh
Posts: 1114
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

Post by XkyRauh »

Excellent post. :) I had just finished creating the .bat file to do exactly what your last {code} recommended when I came to the forums!

Thank you very very much for clearing up all those file arguments. :) This streamlines things quite a bit--I'm running out of excuses to not work... ;)
User avatar
Fleexy
Site Admin
Posts: 490
Joined: Fri Dec 12, 2008 1:33 am
Location: Bloogton Tower

Post by Fleexy »

ARG! I can't get it to work >:( . My GAMEMAPS are straight from Keen, my version of Keen 4 is 1.4 not by Goodtimes Software, and I did everything you told me to. I did these things:

1. Open TPT, open the included GAMEMAPS
2. Edit
3. Save All Levels, close TPT
4. Copy the MAPHEAD and GAMEMAPS from TPT's subfolder
5. Paste them in my Keen 4 directory
6. Rename GAMEMAPS.CK4 to FLEEXFUN.CK4
7. Run keen4.bat
8. Keen closes instantly

keen4.bat looks like this:

Code: Select all

ck4patch keen4.pat
keen4.pat looks like this:

Code: Select all

%ext ck4

#Load the custom graphics
%egahead egahead.ck4

%gamemaps FLEEXFUN.CK4
%maphead MAPHEAD.CK4

%end
My GAMEMAPS have not been touched by TEDSETUP or TED5. What am I doing wrong? Please help!

--Fleexy
Mink
Posts: 192
Joined: Sat Nov 03, 2007 4:08 pm
Location: Providence, RI, US

Post by Mink »

I tested editing levels the way you had it set up, and everything worked fine for me. The only problem I can think of is an error with the custom graphics. Have you tried editing levels on a copy of Keen with unmodified graphics?
User avatar
Fleexy
Site Admin
Posts: 490
Joined: Fri Dec 12, 2008 1:33 am
Location: Bloogton Tower

Post by Fleexy »

Thank you for feedback. I can use all of it I can get. The CK communtity is a very useful place. I wouldn't be able to do any modding with out you guys.

Good question. Yes, I have tried editing with normal graphics. It still crashed Keen. It is odd that Keen doesn't even start. Any other flashes of inspiration? I need more help!

--Fleexy
Mink
Posts: 192
Joined: Sat Nov 03, 2007 4:08 pm
Location: Providence, RI, US

Post by Mink »

I can't think of anything else that would cause these problems. If you'd like, you can download this folder which has everything already set up. To edit levels, just use the enclosed copy of TPT, and to insert your custom graphics, you have to replace the egagraph.ck4 and the egahead.ck4 files with your own modified copies. If you encounter any problems, please let me know.
Post Reply