Patches

The Commander Keen Community Mod!
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Patches

Post by lemm »

I guess there should be a patch thread to accompany all the other topical threads. I've divided up patching into a few areas/phases/whatever you want to call them.

I: Tiles

I "unified" all of the previous tileset related patches into one big patch, which I think is much easier to work with than all the other stuff. In addition, Dr. Kylstein is creating a TileInfo program which will support the patch and generate all the data files so there is no more patching together TLS and what not. All features described below are optional:
  • Sloped Tiles: Top/Bottom slopes of 45, 22.5 or 11.25 degrees. Can be jump through too!
  • Extended Multiple Tileset: Like the earlier patch, but this time, you can have UP TO 910 tiles per level, as many tile graphics as you can fit in memory, custom animation patterns, and possibly up to 8 frames of animation (still have to make that last one).
  • Unique tilesets for finale, menus, and world map (previously all of these used the same image) This is worth mentioning because now we can use tiles instead of costly bitmaps for images, freeing up more space for tiles and sprites.
  • More free memory: includes a (fixed) "Free 4KB of graphics memory" and "Free ~15kB of space" patch (see Keen1 patch forum)
All the individual components work, it's just a matter of getting them together and creating the final file format. Will be done within days/weeks. Side notes: We MUST use KeenGraph (which I've asked levellass to modify to allow as many tile images), and we also need a level editor that can display at 910 tile tilesheet (mindbelt cuts off at 611).

II: Sprite Behaviours

If people want to go ahead and write sprite behaviours, do it in English, or C- or Basic-like syntax and post it. We can divide it into three logical sections: Keen behaviours, creature behaviours (includes rayguns, and possibly pick up items), and controller or "body" functions (see end of post).

Then, when absolutely everything is planned and complete, we can begin the actual coding. It's important that everything (story, all the sprites, what gets collected) is mapped out in exacting detailed and scrutinized thrice before coding because it's a pain in the butt and a waste of time to go back and re-code stuff. Anyways, when all that is done, I will collate everything.

I am thinking a complete rewrite of sprite behaviours may be easier than trying to manage dozens or hundreds of individual sprite patches. We could certainly make more interesting sprites that way. Since it is known where pretty much every important function and variable is held in game memory, I am wondering if it is possible to use this information so that sprite behaviours could be written in C, compiled, and then used as patchfiles.

III: Other Stuff
Status Box, Main Menu, Finale, String Data and all that stuff. Can just use standard patches for all of this.

Background: There are 3 types of behaviours. "think" procedures that are called every level loop, "contact" procedures that are called when two sprites collide, and a third type for "bodies," for lack of a better word. Bodies include the ice cube spawner, door opener, vorticon crusher, and the shot chain. Bodies are different from sprites in that they have a different structure in memory, and are not stored in the same place (this is why you can only have 16 ice cannons), and the body procedures are called after the sprite think procedures. Bodies don't have images (as far as I can tell), but are used to control tiles and other sprites. All 3 types of behaviours are in one big chunk from $1713 to $4B69, intermingled with other procedures like tile collision and pogo calculation and so forth.
Draik
Posts: 117
Joined: Sat Jul 26, 2008 8:52 am
Contact:

Post by Draik »

Well, I'mma start hacking Mindbelt to work with large tilesets just now.

EDIT: nvm, I just remembered why I gave up on my previous Mindbelt modification. I hate programming in Euphoria.
I might start working on a new editor tho. Don't let that stop you, everyone else. Mine will prolly never get finished, I am terminally lazy.
Mink
Posts: 192
Joined: Sat Nov 03, 2007 4:08 pm
Location: Providence, RI, US

Post by Mink »

Okay, I've modified Mindbelt for use with tilesets containing 910 tiles. Here it is: http://www.mediafire.com/?1hj344i4zzz (Gah, I can't stand not being able to use files.commanderkeen.org). I've tested editing levels with a larger tileset, but I haven't actually tested them in-game since I can't find that extended tileset patch anywhere. It should work fine, though. Feel free to suggest other features that might be useful.
Draik
Posts: 117
Joined: Sat Jul 26, 2008 8:52 am
Contact:

Post by Draik »

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

Post by Mink »

Thanks, Draik.

Forgot to mention this, but to use the new version, be sure to put it in your standard Mindbelt directory; it requires the episxdat script files to run.
User avatar
Tulip
Posts: 394
Joined: Mon Jun 16, 2008 2:40 pm
Location: Heidelberg, Germany
Contact:

Post by Tulip »

Very cool. I wonder if ckfs stays down for good now, or is there just a little maintaining going on?
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Well then...


Not much I can do here is there?
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

Can we make a sprite bring up a popup text?
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

I've done so before, though I've had problems. (Text pops up. Enter. Text pops up. Enter. Text pops...) involving the fact that Keen is still touching the sprite after the message has appeared. The way I got around it was using the chain and making it zot when Keen touched it. I am sure Lemm can do better.
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

Lemm mentioned in the sprite thread that it's possible to have up to 255 AI sprites. What are the practical limits on these?
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

The practical limit is the amount of video memory.
(Text pops up. Enter. Text pops up. Enter. Text pops...) involving the fact that Keen is still touching the sprite after the message has appeared.
The way to get around that would be to take levellass' patch and add a line that sets one of the bytes in the sprite data structure after the popup text is called. The sprite checks for this byte before pop up window, if it is set, then there is no popup text. Easily doable, we can finagle with it.


EDIT: I stand corrected. EGASPRIT is not loaded into video memory, it appears. So, we have a good ~160KB of free memory to use for sprite graphics =)
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Interesting; when I was testing Keengraph I always got an 'out of memory' with large EGAGRAPHs; the limit sounds about right, but what *sets* the limit?


And I'll see if I can dig up my old patch.
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

The VGA had 256 KB video memory on the card itself.

In dosbox though, if you set in your dosbox config file machine=svga_paradise, and then set a couple things at game loading (20bytes of patches or so), you can double that to 512kb without having to patch anything else.


Question: Do people want a resolution of 640x350 or the good old 320x200?

(640x480 is also doable, but it wouldn't leave much extra room for bitmaps; 640x200 is doable too, but it looks kind of funny)
Last edited by lemm on Thu Jan 14, 2010 7:29 am, edited 1 time in total.
User avatar
doomjedi
Posts: 341
Joined: Mon Jun 11, 2007 4:30 pm
Location: Israel

Post by doomjedi »

I prefer the classic look. It's Keen's charm
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

For this project, I'd prefer 320x200. But we could always put in an option to go with the higher resolution...
Post Reply