News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Carnivius

pixel effects.

Started by Carnivius, 16:29, 04 October 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Carnivius

In some games such as Beyond the Ice Palace there are effects where a lot of coloured pixels appear when something happens (in that game's case when enemies are killed), I just wondered what is going on there because I would have assumed if they were sprites it would slow down a lot but the game maintains a fairly steady speed even with scrolling.  So what is going on?
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

MacDeath

#1

they explode in colourfull particles.

this was sometimes used for games.




can't really tell how it is done exactly.

actually many impressive games used this technique.
a common pattern between the 3 games : all coded by David Perry. I guess it was his stuff, he probably reused code.

Trantor and Savage sometimes feel like sharing the same "engine".
must be some kind of starfield or particle effect.

CPC-POWER, sauvegarde du patrimoine de l'Amstrad CPC

David Perry did great CPC games in nice Mode0 with a lot of "particle effects" indeed.

arnoldemu

I am guessing here because I haven't looked at the code, but my guess is based on how I would do it.

For drawing a sprite this involves:
1. conversion of x,y coordinates to screen memory address
2. clipping the sprite so only the visible rectangle is on the screen (applies if sprite is partially hidden by the border or a panel)
3. reading from screen, masking, applying sprite pixels and writing back to screen for each byte
4. when we get to the end of the line calculate the memory address for the next line down the screen.

For drawing pixels:
1. you could convert x,y to screen memory address
2. clip pixel - of screen means to skip 3.
3. you then draw the pixel

There is much less work for drawing the pixels. And things like clipping are much quicker. drawing the pixel is much quicker too. if the background is a single colour you can OR it to the screen (avoiding a read of the screen, mask, combine and writing back). You can also avoid calculating screen address. You could store the path as a sequence or memory addresses which you add to the start position.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Axelay

Something else which would help with the CPU time in those David Perry games is that only one pixel explosion is ever in play at once.  If a new one begins, any existing one is ended prematurely.

||C|-|E||

I always found David Perry games exceptional form the technical point of view and I am curious about the technique as well.

McKlain

Another one of his games with particles:


TFM

Quote from: Carnivac on 16:29, 04 October 15
In some games such as Beyond the Ice Palace there are effects where a lot of coloured pixels appear when something happens (in that game's case when enemies are killed), I just wondered what is going on there because I would have assumed if they were sprites it would slow down a lot but the game maintains a fairly steady speed even with scrolling.  So what is going on?


These game are NOT spectrum ports.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

||C|-|E||

Another game that has this, although slower (the effect can slow down the action) is Exolon. However, Exolon uses sprites...


Exolon - Amstrad CPC - YouTube

AMSDOS

In "The Eternal Light" there's a pixel explosion effect when the evil black blobs have been shot. "The Eternal Light" is using Sprites Alive, so the effect must essentially be an segment of code that a RSX is pointing to. @Morri might be able to provide which RSX is being used.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Morri

Quote from: AMSDOS on 22:06, 04 October 15
In "The Eternal Light" there's a pixel explosion effect when the evil black blobs have been shot. "The Eternal Light" is using Sprites Alive, so the effect must essentially be an segment of code that a RSX is pointing to. @Morri might be able to provide which RSX is being used.
Yes, this was a sprites alive feature. The RSX command was |explode. Below is from the manual. I don't think it is as impressive as Dave Perry's games.

|EXPLODE,spr,spot,inc,lim,del
This command will make a sprite explode on the screen. Whilst the explosion is taking place everything on the screen will stop moving until the explosion dies down.
spr is the sprite that is to explode, it must be on the screen.
spot is the number of pixels that are put on the screen before the explosion expands.
inc is the size of the increase of the explosion in pixels.
lim is the maximum size of the explosion in pixels.
del is a delay to slow the explosion down.
Keeping it Kiwi since 1977

McKlain

So now we know that David Perry and Rafaelle Cecco knew how to do this  ;D

andycadley

If you look at Beyond the Ice Palace closely, the pixels appear to change colour as they pass over the background, which is a sure fire sign they're probably just XOR'd onto the screen. From memory that's also how Sprites Alive did it. That certainly helps to keep the effect cost down, whilst being barely noticeable when there's plenty of action going on and the explosion is multi coloured.

||C|-|E||

Another one... Cybernoid I and II.


Cybernoid the fighting machine - Amstrad CPC - YouTube

In Cybernoid it is very impressive. There is even a volcano. Of course, is Rafaelle Cecco again...

TFM

A bunch of MODE 0 dots are easy to handle, because to display it you have to write only one byte. Sprites are more complex, one needs to calculate to the next scan line and always keep the end of the V-RAM in mind. Of course one can work around, but still its way more coplex than a pixel storm.


Odiesoft did show that very nicely (in MODE 1 though):


Snowfall on CPC - YouTube

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

AMSDOS

Quote from: Morri on 22:39, 04 October 15
Yes, this was a sprites alive feature. The RSX command was |explode. Below is from the manual. I don't think it is as impressive as Dave Perry's games.

|EXPLODE,spr,spot,inc,lim,del
This command will make a sprite explode on the screen. Whilst the explosion is taking place everything on the screen will stop moving until the explosion dies down.
spr is the sprite that is to explode, it must be on the screen.
spot is the number of pixels that are put on the screen before the explosion expands.
inc is the size of the increase of the explosion in pixels.
lim is the maximum size of the explosion in pixels.
del is a delay to slow the explosion down.


Yes I must confess I forgot about everything stopping when the explosion takes place. I just thought there's a similar process occurring.


I recall Dizzy exploding in Fast Food when the monsters catch up with them and they don't seem to stop when Dizzy is in explosion sequence, I can only guess some conditional thing is occurring which is letting the rest of the game to function.
Sprites Alive might be using some Loop which is enforced until the condition is reached, rather than doing it one step at a time.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

andycadley

Quote from: AMSDOS on 23:37, 04 October 15

Yes I must confess I forgot about everything stopping when the explosion takes place. I just thought there's a similar process occurring.


I recall Dizzy exploding in Fast Food when the monsters catch up with them and they don't seem to stop when Dizzy is in explosion sequence, I can only guess some conditional thing is occurring which is letting the rest of the game to function.
Sprites Alive might be using some Loop which is enforced until the condition is reached, rather than doing it one step at a time.

To not stop the entire game, it's just a matter of doing a small amount of movement each game frame. That's not really easy to do with an RSX type approach, short of mucking around with timers and trying to compensate for overlapping explosions, so it's not much of a surprise the command just doesn't stop till the explosion is over. It's a very BASIC way of doing things.

robcfg

My 2 cents on the subject:


The colorful explosion is always made of square or rectangular bricks, so my guess is that they were blitting from a random memory area, most probably code or variables.

Optimus

Tubaruba also did it.

MacDeath

#18
I guess some Shooters/ Defender clones did this as well.

Need to be checked but I suspect David Perry to mostly use byte based mask/things...

DanDare3 is actually "character based" but the "explosion seem to use quarters of characters (4x4 mode1 pixel sized things) which is a clever way to get things running a bit smoother in the Character based engine.

Ninja turtle : some sprites really display some black pixels here and there indicationthey are masked at bytes, not pixels (as for Antiriad's sprites).

Bytes can be addressed so it is better CPU wise than mode0 pixel wise or any real pixel wise thing... good way to cut the way.


Some straight "speccy character" engine such as AMC can get nice result but lack in smoothness.
check attack of Zombi monster as well (nice modern exemple, cross-deved for Z80's MSX/Speccy/CPC).
Or even R-Type, somewhat (still smooth scrolling tiles effect inside the 8x8 grid, for the backgrounds only)

I always think that a pure "quarter character" based game engine is still to be done to see if this would be both fast and smooth on a CPC, or just do-able and valid choice...


Carnivius

Thanks people.  Gives me a better idea of what the CPC is capable of. Some folks believe stuff like that is impossible on the 8-bits due to looking like far too many sprites all moving fast at once but it's nice to show them that it is indeed possible and was even back then.


And damn I love Dan Dare 3. Such colourful, bold, chunky fun graphics, lots of those explosion effects and even a parallax star field in the background.   Dave Perry certainly had CPC skills.
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

||C|-|E||

Then, he would do it again with Global Gladiators, Earthworm Jim and, MDK... he always was very very skilled. Too bad that he is not programming with his own hands anymore, or programming at all. He is really rich and moved to other things.

Powered by SMFPacks Menu Editor Mod