Palette Patch for V2 (updated 2012-11-30)

Completed patches for Keen1.
Post Reply
Dr. Kylstein
Posts: 120
Joined: Wed Dec 16, 2009 5:20 pm

Palette Patch for V2 (updated 2012-11-30)

Post by Dr. Kylstein » Mon Nov 26, 2012 3:21 am

This is an add-on patch for lemm's V2 tilesets patch for Keen1. (It may also work without V2 with reduced features.)

Now, each level can have its own palette! That palette is stored in the tileset however, so to get different colors you need a different tileset file. Tileset Tool takes care of embedding the palettes. If you don't use V2, all levels will use the colors defined in default.pal, normally only used for the "One Moment" screen.

You also get color cycling! Color cycling means that the colors change over time during the level. This is based on a system of rows, where the game displays one row of a 16x16 grid of colors in sequence. You have full control over what colors those rows contain, and they can be different in every tileset. You can have stars that twinkle, computers that blink, water that flows, levels where the lights flicker, levels where the lights flash red, indicator signs a-blinking, anything that can be simulated by sequences of color changes.

All the features of the previous patch are included! You still get smoother fades and custom colors for when lights are turned out.

In Tileset Tool, the colors are laid out as follows:
Rows 1-8 are cycled through when the lights are on. Rows 9-16 are cycled through when lights are out.

In the provided demo, level 1 has been setup so that bright cyan cycles from light to dark all the time, and all the colors pulse red after switching a light switch. Try it and see for yourself!

Download latest version
Source on Github
Last edited by Dr. Kylstein on Fri Nov 30, 2012 5:35 am, edited 1 time in total.

levellass
Posts: 2895
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass » Mon Nov 26, 2012 4:12 am

I shall test this out and try to add it to the Keen wiki.

Draik
Posts: 117
Joined: Sat Jul 26, 2008 8:52 am
Contact:

Post by Draik » Mon Nov 26, 2012 5:39 am

whattt, this is insane. V2's multiple tilesets always intrigued me for their potential to vastly expand artistic capacity in modding, and now this is just... god, I wish I wasn't so lazy. I'd love to push the limits of this stuff.

Dr. Kylstein
Posts: 120
Joined: Wed Dec 16, 2009 5:20 pm

Post by Dr. Kylstein » Mon Nov 26, 2012 5:57 am

Draik wrote:whattt, this is insane. V2's multiple tilesets always intrigued me for their potential to vastly expand artistic capacity in modding, and now this is just... god, I wish I wasn't so lazy. I'd love to push the limits of this stuff.
Me too. I've been working on a mod in parallel with this, but it has a hunger for graphics that really hurts my momentum. That and I can't settle on a concept. :p

Benvolio
Posts: 214
Joined: Sun Aug 29, 2004 4:44 pm
Location: Ireland
Contact:

Post by Benvolio » Thu Nov 29, 2012 12:47 am

Wow this sounds just so incredible. My 2005 self would have really gone all out to do something with this. Can you elaborate please on what is meant by colour cycling?

Like, is it the case that you have say a 'level1' palette that is always used in Level1.ck1. And so forth? This is what I would hope for.

Or, is there randomly assigned, or 'cycled' palettes that are loaded every time you enter a level.

Or, does the palette change at all within levels??

And... this is obviously a stupid question but just checkin... you can't use this patch without using the V2 patching system, right? Like you couldn't just apply the palette bit to an otherwise unpatched mod, could you?

Anyhow, Dr. Kylestein, your mod sounds tantalising, if even simply because seldom has a major modding acheivement been made by the person who is also masterminding the patching.

Dr. Kylstein
Posts: 120
Joined: Wed Dec 16, 2009 5:20 pm

Post by Dr. Kylstein » Thu Nov 29, 2012 5:17 am

Benvolio:
Yes, each level can have its own palette. That palette is stored in the tileset however, so to get different colors you need a different tileset file. Tileset Tool takes care of embedding the palettes. All levels will use the same colors if you don't use V2, and it will require you to patch in those colors manually.

But that is not color cycling. Color cycling means that the colors change over time during the level. This is based on a system of rows, where the game displays one row of a 16x16 grid of colors in sequence. You have full control over what colors those rows contain, and they can be different in every tileset. You can have stars that twinkle, computers that blink, water that flows, levels where the lights flicker, levels where the lights flash red, indicator signs a-blinking, anything that can be simulated by sequences of color changes.

Right now color cycling uses the first 8 rows. Light switches use the first and second rows, and are incompatible with color cycling. That was a mistake on my part. I will update soon so that lights-on cycles through the first 8 rows and lights-off through the last 8. You do not want to use all 16 in one cycle, trust me. ;)

(This explanation took over two hours write. From TMI to clear in 20 drafts. ;p)

Edit: Oh, and thanks. What would really make me happy though, is to see it used.

Benvolio
Posts: 214
Joined: Sun Aug 29, 2004 4:44 pm
Location: Ireland
Contact:

Post by Benvolio » Fri Nov 30, 2012 12:46 am

Woah thanks for the large time investment in my rather foolish questions. The imagination does soar at the thought of how these things could be applied!

I would love to make your work gratifying by implementing it in a mod but sadly I am pressed for time continually. And it's hard to keep up with the pace at which modding technology is advancing. Of course the modder has the artistic licence to keep it simple and old-school (like Szemi's latest effort - it could as easily have come out in 2002) but then you play something like Bananasauros and you're blown away by what has been achieved!

levellass
Posts: 2895
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass » Fri Nov 30, 2012 3:07 am

In part Minkcraft was seeing what I could do, I should like very much to one day do a Keen 1 mod with just a few levels to see what I can do with this.

Keen's Ultimate Adventure or something.

Dr. Kylstein
Posts: 120
Joined: Wed Dec 16, 2009 5:20 pm

Post by Dr. Kylstein » Fri Nov 30, 2012 5:45 am

The patch has been updated so that light switches and color cycling can work together now. I also fixed a significant but hard to detect bug in the previous version. The updated download now contains a demo where the colors in level 1 are different, bright cyan cycles from light to dark, and the light switch activates pulsing red lighting.
Benvolio wrote:Woah thanks for the large time investment in my rather foolish questions.
Your questions weren't foolish. I was just mocking myself for taking so long. It was a combination of perfectionism and stopping myself from rambling on 20+ year old technical trivia.

Benvolio
Posts: 214
Joined: Sun Aug 29, 2004 4:44 pm
Location: Ireland
Contact:

Post by Benvolio » Sat Dec 01, 2012 2:12 pm

I would have liked to try your demonstration mod but it's giving me an error.

I used a copy of unlzexed Keen1 and now it's saying error line 42 invalid numerical format. Looking at it in text editor, the patch at that line has the letters RL in it. Is that intentional? Should that work?

Code: Select all

%patch $B7B2 $10001000RL
also line 60 has a lot of w's in it which it doesnt seem to like either.
am I doing something wrong?!?

Dr. Kylstein
Posts: 120
Joined: Wed Dec 16, 2009 5:20 pm

Post by Dr. Kylstein » Sat Dec 01, 2012 6:50 pm

Download the latest CKPatch from the wiki.

Benvolio
Posts: 214
Joined: Sun Aug 29, 2004 4:44 pm
Location: Ireland
Contact:

Post by Benvolio » Sat Dec 01, 2012 9:33 pm

Done... wow this is cool!!! Beautiful colours, and colour is one of my favourite aspects of art on and off screen including keenmods so this really appeals to me.

The cycling upon entering level01 is very xargon, or even a bit cosmoesque, iD could really have used that patch around 1993!!

Then when you flick on the lights... very dramatic. Of note, when I ran it in DosBox fullscreen there was slight frame delay in the painting of the screen in each successive colour. Nothing to do with the integrity of your patch or the Keen1 engine, only a consequence of my CPU/win7/dosbox or maybe even my settings on dosbox.

I was so enthused I decided to run it on my old win98 machine, and again there is some helf-screen-at-a-time-recolouring of pixels that the eye can detect.

But anyway, overall this is promising and maybe a modder will be careful not to overwhelm the screen's capability to refresh!

levellass
Posts: 2895
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass » Sun Dec 02, 2012 4:47 am

This is indeed an awesome tech demo and the wiki may well have to have its own page for how to run and work and fiddle everything.

levellass
Posts: 2895
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass » Tue Oct 29, 2013 5:04 am

Can anyone upload the demo to the wiki? it'd be nice to have a backup in case this link is broken.

Post Reply