Thursday 19 February 2009

8PRL – the 8x8 pixel Roguelike Competition

The challenge: create a roguelike that has a total resolution of 8 pixels by 8 pixels, each pixel of which is an RGB LED display.

It's not entirely clear, but I suspect the RGB display implies a total colour depth of 2^3 = 8 colours (red, green and blue set to on or off state).

It may be possible to vary the intensities more: certainly the screen shot suggests this (orange is displayed, which doesn't fall into the above criteria). I’d suggest that you can have a maximum of 28 distinguishable colours in a 'screen based' RGB display, based on what Leon Marrick achieved in Sangband.

For consistency, it’s probably best to refer to them as follows:

D - Dark Gray

w – White

s – Gray

o - Orange

r – Red

g – Green

b – Blue

u - Brown

d – Black

W - Light Gray

v – Violet

y - Yellow

R - Light Red

G - Light Green

B - Light Blue

U - Light Brown

p – Purple

P – Light Purple

t – Teal

m – mud

Y – Light Yellow

i – Dark Pink

T – Light Teal

V – Light Violet

M – Mustard

I – Light Pink

z – Blue Slate

Z – Deep Light Blue

If you’re especially concerned, I can give you a copy of the RGB values that Sangband uses, or you can ask at the original 'challenge' location. Note that this is a maximum number of colours: you’re free to use less for bonus points and to make the game easier to understand.

Note the reference hardware supports a buzzer for a speaker and single life bar across the top consisting of a single colour status LEDs. It has a limited number of controls: a d-pad and two other buttons.

I’ll post my design separately to avoid influencing the discussion further.

May the best pixels win.


Darius Kazemi said...

Sweet, glad to see I inspired something :)

For reference, the "default" colors for the Meggy are:

Dark (off)
FullOn (bright white)

Nathan 'Vaevictus' Mahon said...

Anyone know of a IRC channel where they're playing with Meggy Jr.? I was wondering if there's a value for Tone_Start's Divisor parameter that'd function as a musical rest.

Darius Kazemi said...

Nathan: that would be 0.

Darke said...

Of course, to be true to the colourfulness of the hardware you'd have to port Piet then program it in that. :)


Pretty programs:

Nathan 'Vaevictus' Mahon said...

zero on the divisor? yeah right. :)
or zero on the irc channel?

and piet would be nice. (i've got a program on that piet page, btw. (5th from the bottom, check out the execution trace.))

Nathan 'Vaevictus' Mahon said...

BTW, I pondered a good BGM mechanism for meggy, and I think I've got a good solution. Lemme know if anyone is interested. :)

Darius Kazemi said...

Nathan, here's some code for making sounds with rests:

void getKeySound(void)
byte i = 0;
unsigned int freqs[5] = { 7648,0,5730, 0,4048 };

while (i < 5)
Tone_Start(freqs[i], 50);
while (MakingSound) {}

The zeroes are rests.

Nathan 'Vaevictus' Mahon said...

yeah. I was gonna use a struct of two ints to have divisor and duration. Is there a check in the library that understands 0 is a rest? otherwise it seems it'd be a divide by zero error somewhere. :)

Darius Kazemi said...

It's actually hardware PWM (pulse width modulation) control registers you're setting -- there's not any actual division taking place. The divisor is just a model for thinking about it that works most of the time, but breaks down for 0.

Nathan 'Vaevictus' Mahon said...

awesome. hmm... i don't have a meggy jr yet... is the sound bit just pins on the AVR? (i have a breadboard arduino...)
last time i made a noisemaker, i used a 555 timer... but i'm wondering if i could PWM it just as easily... (or more easily)

Nathan 'Vaevictus' Mahon said...

I just ordered my Meggy Jr!

Nathan 'Vaevictus' Mahon said...

I've taken that music system a step further and now have a tempo setting and a system for input that supports triplets down to 8th triplets, as well as 8th dotteds and 16th notes.
I can transcribe sheet music at this point, and it sounds fairly decent.

Nathan 'Vaevictus' Mahon said...

Alex Phillips said...

I stumbled across a Meggy kit today... and I knew I had seen it somewhere before. I'll give this rogue-like idea a shot.

beschizza said...

For your consideration!

Andrew Doull said...

Thanks Rob, but I think you're 9x9 :)

Darius is going to try to get a hold of you at some point...

beschizza said...

It was coded at 8x8 originally; the reason it's 9x9 is because it seemed weird to not allow the player to occupy the central pixel given that they actually 'move' #OCD

Andrew Doull said...

Rob: I figured that out pretty early on. My response was more to every journalist who couldn't count the number of pixels across and down the display :)

Andrew Doull said...

And congratulations on all the positive coverage btw. The Rock Paper Shotgun write up is particularly nice...