Inspired by qrleon's painstaking hand-capture of some of Klik & Play's most glorious sprites, I decided to look into how hard it would be to crack the Klik & Play file format.
As it turns out, it wasn't really that hard at all! Reverse engineering is kind of fun. And I discovered 010 Editor in the process, which is all kinds of badass.
I'm pretty sure I now have enough information to batch extract raw bitmap data, if I just knew exactly what KNP's colour palette was. I think the simplest way to find out is just to take a screen grab of the sprite editor and slurp up the colours from that.
The on-screen colour palette maps onto colour indexes like so:
0 16 32 ... 240
1 17 33 ... 241
2 18 34 ... 242
... ... ... ... ...
15 31 48 ... 255
except for one cute trick. The first colour, 0, doesn't actually map to 0, it maps to some other black elsewhere in the palette (207, IIRC). 0 is the transparent colour.
I'm not sure yet if there's any way to tell, just given the .img file, which images correspond to which objects, animations, etc. I'm guessing that there probably isn't, which is unfortunate, as .gam files are a lot more complicated. (There's all kinds of friggin' garbage data in them.)
I've attached the 010 Binary Template that I whipped up while I was figuring out the Klik & Play .img file format, to help future generations of people who want to reverse-engineer the Klik & Play file format. I also loaded that last sentence up with keywords so that Klik & Play hackers might find this page via Google.
Attachment | Size |
---|---|
knp.bt | 1.1 KB |
Comments
So, I've written a python
So, I've written a python script to scrape all of the images out of an .IMG file! Hooray!
The filenames are of the format [ImgID]_[Hotspot X]_[Hotspot Y].png, so that after manual sorting, I'll be able to write a script that churns out properly lined-up animated gifs and so forth.
Unfortunately, it only sort of works. Boo!
Bugs:
Fixed the bugs! I should be
Fixed the bugs! I should be releasing the script soon, once I can package it up into a vaguely nice EXE.
For the curious:
Pretty bad ass! If I were
Pretty bad ass!
If I were more into the proper spirit of Trainwrecks I'd probably be working on an import sprite to processing mechanism right now so I could partake of more of this cliparty goodness. But, I'm wicked lazy.
Yeah, I'm definitely
Yeah, I'm definitely interested in writing scripts to ease the importation of klipart into other rapid game creation systems.
Awesome! Thank you for doing
Awesome! Thank you for doing this.
I'd love to see what crazy stuff it extracts from Venture 2.
Holy shit, thanks for the
Holy shit, thanks for the torture test. Venture 2 has 8170 individual images inside of it. I'm now pretty confident that my tool will successfully rip any Klik & Play .IMG file.
KNPDS, KNPWII, KNPSP...
This feels like the earliest stages of something I'd been hoping would eventually come about... You know how the first things to show up in every new homebrew community are emulators, and various ports or game engine recreations (I'm lumping JNES/SNES9X/JENESIS/STELLA in with SCUMMVM/REMINISCE/CLONEKEEN/PRBOOM). Usually it's DOS-era games or 4th generation consoles (and only commercial games!). But the idea of an easily ported engine to play cheesy freeware KnP games is terribly appealing. The two central problem are the absense of any source code for porting and the lack of a definitive archive of the best games written in the format (Don't rom archives drive emulator development? Or is it the other way around?).
Of course, games that rely on the buggy nature of the engine (such as every game I make) probably wouldn't run very well on a port, much like ZZT games running in DREAMZZT. Still, it's an interesting thought.
You know, I hadn't even
You know, I hadn't even thought of that, but it would be pretty incredible to have the Pirate Kart running on the Wii.
First MMF Java, and then...
Man, those clickteam folks way, waaay in the future of two-thousand-and-nine are making their futuristic-klik-n-play program export to flash. Their first example is Gracillis V, the demo game they've been re-exporting since the first days of knp. Assuming they're backwards-compatible all the way back to the first format, and realizing that the Opera browser on the Wii can play flash files...
Still, I'd rather they release an open-source version of their first game engine, bugs and all.
further KnP Wii thoughts
With the port of DosBox to the Wii, it's now possible to install Windows 3.1 on a Wii, which means, of course, it is now possible to play KnP games on a Wii.
Also, the flash route was probably no good, since the wii browser is locked into an older version of flash, and their new export option probably uses the flash 10 player.
I'm still waiting for
I'm still waiting for someone to hack KnP to fix up its tricky relationship with importing images with a higher bit depth than the graphics mode you are working with as well as all those little things that cause it to crash for no apparent reason. It would be a halfway house but as a halfway house it would be a damn sight better than the home we can run away from.
They kinda did that.
It's called "Click & Create", I believe. ;)
I was thinking lately about
I was thinking lately about making a KnP games on-line archive. Shouldn't be too hard as those games aren't really that big. Just need now some motivation and moneys for server space and bandwidth. Will do something around this after my exams.
I've got like 10 gig of free
I've got like 10 gig of free storage on my linode right now -- obviously I don't want to cram it absolutely full of other peoples' stuff, but I don't mind mirroring old Klik & Play games for preservation's sake myself, if you find some cool stuff.
Great. I will undust an old
Great. I will undust an old cd from PC World komputer with KNP competition - about 20 games, e.g. point-and-click adventure game, sidescrolling shmup, some kind of action-strategy etc. Also I will browse some polish sites about klik games.
Another fascinating
Another fascinating possibility here is writing .IMG files. Wasn't there some wonderful archive of beautiful animated gifs extracted from C64 games posted here a while ago? How difficult would it be to make a streamlined app to import animated gifs, remap them to the KnPalette, and write out a library?
Doesn't KNP accept some kind
Doesn't KNP accept some kind of import-at-once spritemap format? If so, it's probably much easier to write a tool to generate THAT than a .gam/.img pair. (There are still some bits of the .img format that are a total mystery to me. Not a big deal to skip over when you're reading, but probably tough to trick KNP.)
Still, it'd be nice to have, sure.
It does but it's totally ass.
It does but it's totally ass.
So is there any way to get
So is there any way to get like a giant set of KNP anims as animated GIFs?
I realize that someone else has made a nice animated GIF import tool for processing
.... actually in terms of the Pirate Kart... I know one time I asked if I should keep on w/ processing, or force myself to KNP, and I think SpindlyQ said "KNP sprites in Processing" -- is that a good idea? is it cooler to keep w/ the theme that way, or to have this one set of idiosyncratic looking shape-based games?
The problem is that I
The problem is that I haven't decoded quite enough information to figure out which images go together, in which order.
That might be a fun bus project for me to work on next week, though!
Re: "going with the theme", my experience with the first Pirate Kart was that everyone had their own discernible style anyway, even when using the same sprites. To me, that was an unexpected and really cool result; a direct refutation of the idea that a tool like Klik & Play led directly to cookie-cutter games that were all really just the same. What I mean to say is, make games in the way that feels most simple, natural and comfortable to you. Keep the conduit between your brain and the screen flowing as smoothly as possible.