Welcome to Keen: Modding!

Anything related to Keen Modding.
Post Reply
User avatar
adurdin
Site Founder
Posts: 549
Joined: Fri Aug 29, 2003 11:27 pm
Location: Edinburgh, Scotland
Contact:

Welcome to Keen: Modding!

Post by adurdin »

Keen: Modding is now open. This forum is intended for discussion of Commander Keen editing and modding, and as a storehouse for tips, tricks, patches, and utilities.

If you want to visit these boards regularly, or post any comments, you'll need to register. Just click the Image Register link at the top of the page. You'll need to use a valid email address.

If you have any questions, or think that the real plural of forum is actually fora and want to argue about it with me, send me an email: andy@durdin.net
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

Andrew - this is very cool!
I wish you good luck, and if you ever need admin/moderator, I can help.. ;)

One more time: this forum techs!
User avatar
XkyRauh
Posts: 1114
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

re: Welcome to Keen:Modding!

Post by XkyRauh »

Due to the recent flood of off-topic posting, I wanted to offer this link as a reminder to the Keen:Modding community:

Keen:Modding opens at PCKF

This board is intended for useful information regarding the modding of the Commander Keen games, and the PCKF is just what its name implies; a Public Commander Keen Forum. Please sort your posts accordingly. Thank you! :-)

--Xky
grafix the 5000th

We're back!

Post by grafix the 5000th »

Welcome back people!

Since the board is now open (with posts seemingly intact) we can resume all those threads that we couldn't get at over the holidays.
User avatar
OmniKeen
Posts: 21
Joined: Thu Jan 04, 2007 6:01 pm
Location: Between a rock and a hard place

Post by OmniKeen »

Hello everyone! I wasn't sure where to post my 'hello' post, so I just posted here...

Anyway, I've loved Keen forever and I've always wanted to create my own levels. I found this forum a few weeks ago and I've downloaded a bunch of modding tools from here and got to work on my first Keen mod already.

Also, I know absolutely nothing about programming.

XkyRauh, your link doesn't work, it just gives me a 404. Has PCKF been closed down? Does anyone else have a link to it?

[/newbie]
User avatar
XkyRauh
Posts: 1114
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

Post by XkyRauh »

Hehe--PCKF is still alive and well, and can be found right here. The thing is, there was an EzBoard crash, and a lot of the old topics were lost, so that thread I linked to up there no longer exists. :(

Welcome aboard, though!
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Hello

Post by lemm »

Hi, I'm new to modding, and no real programming experience. I took a couple semesters of compsci electives (Java, lol) a few years back.

I just downloaded a pile of tools for the vorticons trilogy:

modkeen, ckpatch, mindbelt, tileinfo, unlzexe, and the giant index of patches.

For my first project I just want to make a few keen 2 levels, and maybe some new background tiles using the extra empty squares leftover in the 2til0000.bmp.

... but I have a few questions ...

1. Are those empty squares in the tileset just empty space that I can edit?

2. I was reading over the ckpatch and the behaviour readme in the patch index/keen1/sprites folder, and as I understand, it works something like this:

The %patch <offset> <bytestream> command in ckpatch overwrites the memory starting at offset with bytestream bytes.

A "behaviour" is a subroutine, and the $ABCD is the memory address the program arrives at when it gets to the end of this subroutine?

For example:

Code: Select all

%patch $1A22 $4F $19 #Yorp walks toward Keen, turns around when hitting walls [Yorp after searching for Keen]
Offset $1A22 references the subroutine (behaviour) that will be called once the program has reached the end of the Yorp-searching (behaviour). By writing $4F $19 at this location, the program is told to go to $194F in memory, which is the start of the Yorp-walk routine.

Am I understanding this right?

3. How do you people determine what memory address does what?


Sorry if these are noobish questions =).


-lemm
Kdash
Posts: 405
Joined: Sat Feb 26, 2005 5:45 pm

Post by Kdash »

The empty tiles in the tileset can be edited, and you can change any of the other tiles. There's a program called Tileinfo that can be used to change each tiles' behavior, too, so you can make tiles that block, items, etc.

Patches, as far as I understand, work by just overwriting certain bytes in memory.
So for instance:
%patch $1A22 $4F $19
The $1A22 is the address of a byte, which will become value $4F. The next byte, $1A23, will become $19.

That's about as much as I know about patching. :-P I just usually find a patch I need, and copy-and-paste it.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Any and all Keen graphics can be edited however you want with 2 main exceptions. (I recommend my own program KeenGraph, huzzah!) These exceptions are:

* All sprite or bitmap images must have a width divisible by8 due to how Keen stores data. (For sprite bitmaps, each 'section' of the bitmap must obey this rule.)

* Some graphics have preset sizes, either because of the program used or Keen itself. For example the tileset bitmap must be 208 (13 tiles.) wide and the external graphics 320x200 (1 screen.) in size. For Keen 1-3, the screen graphics and font and tile bitmaps have fixed sizes, at least for ModKeen.

Aside from that you have free rein to do what you want. I suggest downloading and extracting the graphics from various 'neat looking' mods to see how people did what they did. (Ever since Xky's landmark 'full screen title image' many mods have copied him.)



Patching itself is simple enough, the Keen executable is copied into memory and then has changes made to this 'shadow copy' which change its function. (This copy is deleted when the application is closed.) There are several commands to make things easier, the copy file (%patchfile) the Yorp message (%level.message or something.) but the one you will use most is the %patch command, this has a location and one or more values to copy to that location.

Patch values are usually in hex ($xx, though some strange people use 0x0xx), but can also be in plain decimal (xx) which has the advantage that you can enter negative values (-40 say) more intuitively than hex.

There are several basic kinds of patches out there:

Number patches: 1 or two bytes long,t these change the number of something, for example, what sprite image a sprite uses or how many lines something moves down.

Speed patches: Usually two bytes long, these control how fast something moves, left-right or up-down. The differ from number patches in that they have 'negative' values too, (Negative is left or up.) Thus 1 is $01 $00, and -1 is $FF $FF

Behavior patches: For sprites only, these are two bytes long, change what actions sprites take and can be very tricky to use (Crashes may ensue.) They must have specific values and basically point to a place in the Keen code (Thus $4F $19 points to $194F in the executable.)

Other stuff: Exactly What It Says On The Tin.
Post Reply