Author Topic: pixel effects.  (Read 2417 times)

0 Members and 1 Guest are viewing this topic.

Offline Carnivius

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.514
  • Country: gb
  • Mayhem Attack Squad
    • index.php?action=treasury
  • Liked: 1108
  • Likes Given: 606
pixel effects.
« on: 18: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?
Favorite CPC games: SwitchBlade, Stryker in the Crypts of Trogan, Turrican II, UN Squadron, Oh Mummy

Offline MacDeath

  • Chaotic post writer and mock-up specialist
  • Supporter
  • 6128 Plus
  • *
  • Posts: 4.075
  • Country: fr
  • Liked: 1191
  • Likes Given: 670
Re: pixel effects.
« Reply #1 on: 18:41, 04 October 15 »
[youtube]https://www.youtube.com/watch?v=4BehXNT0Z8I[/youtube]
they explode in colourfull particles.

this was sometimes used for games.
[youtube]https://www.youtube.com/watch?v=jz7RxwiYGIo[/youtube]

[youtube]https://www.youtube.com/watch?v=VpKCM5eAlsM[/youtube]

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
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.
« Last Edit: 18:50, 04 October 15 by MacDeath »

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2280
  • Likes Given: 3478
Re: pixel effects.
« Reply #2 on: 18:43, 04 October 15 »
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

Offline Axelay

  • 6128 Plus
  • ******
  • Posts: 594
  • Country: au
  • Liked: 394
  • Likes Given: 89
Re: pixel effects.
« Reply #3 on: 19:14, 04 October 15 »
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.

Offline ||C|-|E||

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 1.864
  • Country: gb
    • index.php?action=treasury
    • Mundo CPC
  • Liked: 1044
  • Likes Given: 1152
Re: pixel effects.
« Reply #4 on: 23:06, 04 October 15 »
I always found David Perry games exceptional form the technical point of view and I am curious about the technique as well.

Offline McKlain

  • 6128 Plus
  • ******
  • Posts: 867
  • Country: es
  • Programmable Sound Generator
    • www.mcklain.com
  • Liked: 339
  • Likes Given: 950
Re: pixel effects.
« Reply #5 on: 23:47, 04 October 15 »
Another one of his games with particles:

[youtube]https://www.youtube.com/watch?v=BP_D_ow9B-g[/youtube]

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1985
  • Likes Given: 4650
Re: pixel effects.
« Reply #6 on: 23:52, 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

Offline ||C|-|E||

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 1.864
  • Country: gb
    • index.php?action=treasury
    • Mundo CPC
  • Liked: 1044
  • Likes Given: 1152
Re: pixel effects.
« Reply #7 on: 23:55, 04 October 15 »
Another game that has this, although slower (the effect can slow down the action) is Exolon. However, Exolon uses sprites...

Exolon - Amstrad CPC - YouTube

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.939
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1159
  • Likes Given: 1931
Re: pixel effects.
« Reply #8 on: 00:06, 05 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.
* 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

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
Re: pixel effects.
« Reply #9 on: 00:39, 05 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

Offline McKlain

  • 6128 Plus
  • ******
  • Posts: 867
  • Country: es
  • Programmable Sound Generator
    • www.mcklain.com
  • Liked: 339
  • Likes Given: 950
Re: pixel effects.
« Reply #10 on: 00:47, 05 October 15 »
So now we know that David Perry and Rafaelle Cecco knew how to do this  ;D

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 979
  • Liked: 479
  • Likes Given: 79
Re: pixel effects.
« Reply #11 on: 00:50, 05 October 15 »
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.

Offline ||C|-|E||

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 1.864
  • Country: gb
    • index.php?action=treasury
    • Mundo CPC
  • Liked: 1044
  • Likes Given: 1152
Re: pixel effects.
« Reply #12 on: 01:11, 05 October 15 »
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...

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1985
  • Likes Given: 4650
Re: pixel effects.
« Reply #13 on: 01:17, 05 October 15 »
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

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.939
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1159
  • Likes Given: 1931
Re: pixel effects.
« Reply #14 on: 01:37, 05 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

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 979
  • Liked: 479
  • Likes Given: 79
Re: pixel effects.
« Reply #15 on: 10:03, 05 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.

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.412
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1093
  • Likes Given: 2672
Re: pixel effects.
« Reply #16 on: 12:55, 05 October 15 »
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.

Offline Optimus

  • 464 Plus
  • *****
  • Posts: 366
  • Country: gr
  • Liked: 193
  • Likes Given: 147
Re: pixel effects.
« Reply #17 on: 17:44, 05 October 15 »
Tubaruba also did it.

Offline MacDeath

  • Chaotic post writer and mock-up specialist
  • Supporter
  • 6128 Plus
  • *
  • Posts: 4.075
  • Country: fr
  • Liked: 1191
  • Likes Given: 670
Re: pixel effects.
« Reply #18 on: 20:14, 05 October 15 »
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...

« Last Edit: 20:28, 05 October 15 by MacDeath »

Offline Carnivius

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.514
  • Country: gb
  • Mayhem Attack Squad
    • index.php?action=treasury
  • Liked: 1108
  • Likes Given: 606
Re: pixel effects.
« Reply #19 on: 14:23, 10 October 15 »
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: SwitchBlade, Stryker in the Crypts of Trogan, Turrican II, UN Squadron, Oh Mummy

Offline ||C|-|E||

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 1.864
  • Country: gb
    • index.php?action=treasury
    • Mundo CPC
  • Liked: 1044
  • Likes Given: 1152
Re: pixel effects.
« Reply #20 on: 14:43, 10 October 15 »
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.