Re: SPAM-LOW: Re: [stella] Reflex: Online level editor

Subject: Re: SPAM-LOW: Re: [stella] Reflex: Online level editor
From: "Thomas Jentzsch" <tjentzsch@xxxxxx>
Date: Thu, 09 Sep 2004 17:24:23 +0200
Lee wrote:
> The attached source code has a single compressed level (search for
> "levelData") and the decompression algorithm (search for "decompressLevel").
> The decompression algorithm is probably one of the most well-commented
> chunks of code in Reflex.

I just had a brief look a the code. Are you really building a full huffman tree
there? Wow!

But wouldn't it be easier to define something more static? E.g.
3 bits for the most frequent layouts, 4 bit for average frequent ones 
and 5 or more bits for rarely used layouts.

3 bits: 000..001 (2)
4 bits: 0100..1101 (10)
5 bits: 11100..11111 (4)
(or which distribution matches your tree best)

Then you would simply stream the bits from ROM into a buffer.

And after 3..5 bits you compare the buffer value with the higest value 
of that length +1 (010, 1111, 100000). If the buffer value is lower, then
you found the correct length. Take the buffer value, subtract an offset for 
that length (-0, -2, -16) and you have your index into an ordered(!) 

At least that's what I did in Jammed (combined with extra tables for various
intermediate layouts).

> I considered extending it for the same reason, but after playing with editor
> with mirroring set to horizontal or none, I found I was able to create some
> nice, identifiable _stuff_... Atari characters, RobotBob SpongeChipPants (he
> put the brain in the robot... you know), faces, animals, Windows icons...
> lots of _stuff_. :)

True, but you allow some less fun, but nasty levels, where the reaction time 
would be extremely limited then.

> Anyway, if you assemble the game, don't mind the funky paddles.  I still
> need to get to those.

I'll check it tonight.

Have fun!
Thomas Jentzsch         | *** Every bit is sacred ! ***
tjentzsch at web dot de |
WEB.DE Video-Mail - Sagen Sie mehr mit bewegten Bildern
Informationen unter:

Current Thread