Colour Dizzy

Need help with using DizzyAGE then look here
delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Colour Dizzy

Postby delta » Sat Sep 12, 2009 11:24 pm

one thing about DizzyAGE games, is that obviously because DizzyAGE uses tiles for the map, the Dizzy Character is always white, even when in front of a background object. Whereas in the original games, dizzy was whatever colour the background object was - even multiple colours!

so i was a bit bored this evening, and started idly wondering if there was a way to do this in DizzyAGE (make dizzy multiple colours when in front of background objects). Now, the developers among you will think this over for a few seconds, realise that the dizzy character is one tile, and say 'no'. and initially, so did i.

but i don't like taking 'no' for an answer... ;)

<object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/IS8SXDzdROA&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/IS8SXDzdROA&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object>
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

xelanoimis
Team Yolkfolk
Team Yolkfolk
Posts: 1002
Joined: Sun Jan 21, 2007 6:34 pm
Contact:

Postby xelanoimis » Tue Sep 15, 2009 12:59 pm

He,he - cool one.

Though, this was so annoying on Z80. It had only 2 colors for each 8x8 pixels block. A pixel was either on or off, meaning it was getting the "paper" or the "ink" color from the color block it was in. So, even if you do a smart movement per pixel,you were still limited and could not move it's colors too (unless moving from 8 to 8 pixels).

We were hearing stories about how the Comodore computes have colors for each pixel, but I never had one.

Now about your amazing trick in DizzyAGE, you own us an explanation :)

Just a quick guess - do you have the graphics white in the background, than paint white dizzy, then another set of brushes (white rectangles with no alpha) painting the proper colors with modulate?

Alex

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Postby delta » Tue Sep 15, 2009 1:40 pm

xelanoimis wrote:Now about your amazing trick in DizzyAGE, you own us an explanation :)

Just a quick guess - do you have the graphics white in the background, than paint white dizzy, then another set of brushes (white rectangles with no alpha) painting the proper colors with modulate?

Alex


I wasn't sure what you meant at first, but i get it now. I've never tried anything like that, and didn't even know it could be done! interesting... i may try something like that. It would be a bit of a pain to do though, painting every object (and item) twice.

i may modify my rather complex coding to incorporate something like that tho.

the way i did it is as follows:

it's relatively easy to change the actual colour of dizzy depending on what he collides with. the issue is how to break it down into blocks of colour. So what i did was draw 9 'Dizzys' elsewhere in the map, then use coding in the HandlerGameAfterUpdate() function to specify which part of the tile was shown for each 'dizzy', and then to position that part of the tile over the main 'dizzy' character. So there are actually 2 dizzys, one on top of the other. The only difference is that the one on top is made up of 9 blocks, each 8x8 pixels.

then what i do is use a small bit of code i wrote for CoTM to determine when each of those 9 blocks collides with an object in the room. If it does, it finds the colour of that object, and changes the colour of that 8x8 block to be the colour of the object. The original Dizzy tile is still white behind the 9 coloured blocks.

See the picture below for a more graphic explanation.

<img src="http://i402.photobucket.com/albums/pp106/eqixx/colourdiz.png">

the only problem with this is that it doesn't exactly correspond to the colour directly behind him, as if he moves 4 pixels to either his left or right, all the 8x8 blocks will be half-way between one colour and another.

The solution would be to make him up of 36 4x4 blocks instead, which should fix the issue.

I hope that satisfies everyone, and is clear enough! :p
Image



Image



"Quotes from the internet may not be genuine" - Abraham Lincoln

Meph
Hard Boiled Egg
Posts: 2914
Joined: Fri Apr 13, 2007 12:47 am
Location: England, Suffolk
Contact:

Postby Meph » Tue Sep 15, 2009 9:34 pm

Thats rarther clever stuff.
[font="Comic Sans MS"]Its always the cracked ones that let the light in [/font]

xelanoimis
Team Yolkfolk
Team Yolkfolk
Posts: 1002
Joined: Sun Jan 21, 2007 6:34 pm
Contact:

Postby xelanoimis » Wed Sep 16, 2009 5:56 pm

aha :)

The thing with your method is that your background brushes must be dynamic objects to test the collision.

A nice optimization would be to build a color map based on the background static brushes. The dynamic objects would simply read their colors from this map (still have to split them in 8x8 blocks). The color map would be room_w/8 x room_h/8 in size and can be build offline and saved in separate file.

About the trick I suggested, an editor script can be made to generate the front color brushes and remove color from background brushes automatically, like a map compilation.

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Postby delta » Wed Sep 16, 2009 6:36 pm

xelanoimis wrote:aha :)

The thing with your method is that your background brushes must be dynamic objects to test the collision.
i know. i had to change all the background scenery brushes into objects. you can see that the rock he stands in front of at the end is a brush however, as his hand is still white when in front of it.

I do have another option, which is to make them all objects, and use the O_COLLIDE function I've introduced into CoTM, which effectively simulates a solid object for the purposes of moving around. However I'm not sure whether it would work properly for walking on top of curved objects.

xelanoimis wrote:A nice optimization would be to build a color map based on the background static brushes. The dynamic objects would simply read their colors from this map (still have to split them in 8x8 blocks). The color map would be room_w/8 x room_h/8 in size and can be build offline and saved in separate file.

About the trick I suggested, an editor script can be made to generate the front color brushes and remove color from background brushes automatically, like a map compilation.
arrrghhh I'm not even going to bother! haha it's far too much effort for a visual effect that not only is a step backwards, but that i may not include in any games anyway!

i just wanted to see if it could be done! :p now that I've proved to myself it can, I'm happy. :)
Image



Image



"Quotes from the internet may not be genuine" - Abraham Lincoln

xelanoimis
Team Yolkfolk
Team Yolkfolk
Posts: 1002
Joined: Sun Jan 21, 2007 6:34 pm
Contact:

Postby xelanoimis » Wed Sep 16, 2009 7:30 pm

Yeah, I wouldn't like to see the DizzyAGE games using this feature.
As I said, it's more like a limitation of the Z80, not really something to bother with.

Meph
Hard Boiled Egg
Posts: 2914
Joined: Fri Apr 13, 2007 12:47 am
Location: England, Suffolk
Contact:

Postby Meph » Fri Sep 18, 2009 9:09 pm

But can it be done too only work in certain rooms?
it could be a nice little featuer within a big game.. some kind of dodgy magic spell lol
[font="Comic Sans MS"]Its always the cracked ones that let the light in [/font]

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Postby delta » Fri Sep 18, 2009 9:15 pm

oh yes, quite easily. a simply variable check and switch it on/off when entering/leaving the room.

wouldn't really want to tho. it's not perfect, and i can't be arsed spending time on it to make it perfect.
Image



Image



"Quotes from the internet may not be genuine" - Abraham Lincoln

Joe
Free Range Egg
Posts: 48
Joined: Tue Jan 30, 2007 12:19 pm

Postby Joe » Mon Nov 30, 2009 4:28 pm

Colour-clash is a limitation of the ULA in the ZX Spectrum, the Z80 doesn't have any responsibility for generating the video display :) There's a Z80 in the Amstrad, Master System, Game Gear, Game Boy, Megadrive and even the Commodore 128, it's a general purpose microprocessor, and a very nice one at that :D


Return to “DizzyAGE Help”

Who is online

Users browsing this forum: No registered users and 1 guest