News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_redbox

Mode 3

Started by redbox, 15:00, 06 March 11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sigh

Quote from: TFM/FS on 02:20, 05 April 11
Well, there is a use for Mode 3 ... think about SHADDOWS ;-)

And as second hint... think about switching between Mode 0 and 3 ;-)

Got it ;-)

Could you elaborate on these?

What do you mean by shadows?
Also, why would you want to switch modes?

TFM

Quote from: sigh on 13:21, 05 April 11
Could you elaborate on these?

What do you mean by shadows?
Also, why would you want to switch modes?

When you switch between Mode 0 and 3 then you literally switch between 4 and 16 colors. And you switch between watch it all (Mode 0) and watch half of it (Mode 3). Sorry can't tell it better in english words...

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

FatAgnus

#27
POST EDITED:
Sorry, bad test. Yes, colour depth changes without distorting gfx.
Some flickering effects could be archieved (it's faster than changing entire palette for "flashing" effects, i.e.)

sigh

Quote from: TFM/FS on 01:02, 06 April 11

When you switch between Mode 0 and 3 then you literally switch between 4 and 16 colors. And you switch between watch it all (Mode 0) and watch half of it (Mode 3). Sorry can't tell it better in english words...

Do you have any control of the colours that it is switching too? For instance, if you wanted to change a 16 colour pic to a black, grey and white etc.
Would it be the whole scene/pic or could you allocate it to certain areas or sprites?

I would also still like to know what you mean by shadows.

TFM

Well, shaddows in the sense of other colors. Here a link, that is a bit related, but not completly what I mean:


http://www.youtube.com/watch?v=ztf7pacNf6A

You surely can define the colors. But you usually use the whole screen.

Just play a bit around and switch between 0 and 3 (  LD BC,&7F80 or 83 : OUT (C),C   )

In case you work under basic you have to switch the interrupts off.

Go assembler, in Basic you can't do that properly.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

arnoldemu

Quote from: TFM/FS on 04:07, 06 April 11
Well, shaddows in the sense of other colors. Here a link, that is a bit related, but not completly what I mean:


http://www.youtube.com/watch?v=ztf7pacNf6A

You surely can define the colors. But you usually use the whole screen.

Just play a bit around and switch between 0 and 3 (  LD BC,&7F80 or 83 : OUT (C),C   )

In case you work under basic you have to switch the interrupts off.

Go assembler, in Basic you can't do that properly.
Nice effect. I see now.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

sigh

#31
Thats a very interesting effect. Thanks for showing.
This could be used for some lighting effects in games such sprites walk under light rays etc.

TFM

If you can wait 10 years more... then our RPG will please you :-)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

sigh

#33
Question on the 4 modes:

1) If you were to take each of the 4 modes and make them 160x200, in order(the fastest first) , which would be the faster mode to use for a sprite fest of a vertical scrolling bullet hell shooter game?

2) Also, are there any examples of games done in mode 2?

Quote from: TFM/FS on 21:21, 07 April 11
If you can wait 10 years more... then our RPG will please you :-)

A very ambitious project indeed! Roll on 2021 :) !

AMSDOS

Quote from: sigh on 10:19, 09 April 11
Question on the 4 modes:

1) If you were to take each of the 4 modes and make them 160x200, in order(the fastest first) , which would be the faster mode to use for a sprite fest of a vertical scrolling bullet hell shooter game?

2) Also, are there any examples of games done in mode 2?

I'm also interested to know if there were any graphical games done in Mode 2, my feeling is most of them are Text Adventures. At one time though I thought SWIV might have been since the main playing field is two colours, sadly it isn't, though my feeling is it's seems as if it could be done by simply having 3 quarters of the playing screen in Mode 2 and the Bottom quarter in Mode 1 for the Control Pannel.
* 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

TFM

Quote from: sigh on 10:19, 09 April 11
Question on the 4 modes:

1) If you were to take each of the 4 modes and make them 160x200, in order(the fastest first) , which would be the faster mode to use for a sprite fest of a vertical scrolling bullet hell shooter game?

2) Also, are there any examples of games done in mode 2?

1) The fastest mode is Mode 2. For examples see some of Bollwares Mode 2 games. Sprites are very easy to handle in Mode 2. Mode 1 and 0 need more complex (and therefore slower) routines.
But... it all depends if you work with or without background. Without background it doesn't matter much.

2) Err... yes... see: http://www.bollaware.de/

Hope that helps a bit...
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

sigh

#36
Quote from: TFM/FS on 07:29, 10 April 11

1) The fastest mode is Mode 2. For examples see some of Bollwares Mode 2 games. Sprites are very easy to handle in Mode 2. Mode 1 and 0 need more complex (and therefore slower) routines.
But... it all depends if you work with or without background. Without background it doesn't matter much.

2) Err... yes... see: http://www.bollaware.de/

Hope that helps a bit...

Mode 2 - Fres attack game by Bollwares. That really is an incredible game. Smooth horizontal scrolling(is it pixel scrolling? It looks incredibly smooth) - just wow!

It's the only mode 2 game I've seen on their site. Are there others?

(..and it is 2 player...)

arnoldemu

Quote from: sigh on 21:58, 10 April 11
Mode 2 - Fres attack game by Bollwares. That really is an incredible game. Smooth horizontal scrolling(is it pixel scrolling? It looks incredibly smooth) - just wow!

It's the only mode 2 game I've seen on their site. Are there others?

(..and it is 2 player...)
I thought the mastertronic game transmuter was in mode 2.
Or was it just the title screen?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

sigh

Quote from: arnoldemu on 09:23, 11 April 11
I thought the mastertronic game transmuter was in mode 2.
Or was it just the title screen?

Looking at the screen shots on transmuter it seems to be mode 1 as there are 4 colours: http://www.cpcgamereviews.com/t/index9.html

So, would a bullet hell shoot em up be possible with Mode 2 graphics seeing that the sprites are quicker to handle? Also, with that huge sheet of 640x200 only taking up 16kb, you could most likely have some interesting graphical effects and huge end of level bosses.

andycadley

Quote from: sigh on 13:30, 11 April 11
So, would a bullet hell shoot em up be possible with Mode 2 graphics seeing that the sprites are quicker to handle? Also, with that huge sheet of 640x200 only taking up 16kb, you could most likely have some interesting graphical effects and huge end of level bosses.

I seriously doubt that Mode 2 sprites will be faster, if anything I'd expect them to work out slower. Whilst it's true that a sprite of equal dimensions uses less memory, you end up needing the sprites to be twice as wide for them to be physically the same size - so no memory savings there. Furthermore, since they're only monochrome, you have to maintain a seperate mask unless you want very primitive looking mono sprites. That effectively means you've doubled the memory requirement over Mode 1 sprites and gained very little in the process.

sigh

Quote from: andycadley on 19:48, 11 April 11

I seriously doubt that Mode 2 sprites will be faster, if anything I'd expect them to work out slower. Whilst it's true that a sprite of equal dimensions uses less memory, you end up needing the sprites to be twice as wide for them to be physically the same size - so no memory savings there. Furthermore, since they're only monochrome, you have to maintain a seperate mask unless you want very primitive looking mono sprites. That effectively means you've doubled the memory requirement over Mode 1 sprites and gained very little in the process.

I was wondering about the masking. Some interesting and different points made by both you and TFM/MS.

TFM

Exactly right! Andy Cadley is wrong here (probably he never made sprite routines...). In Mode 2 it's totally easy to connect Sprites with a background, because a pixel can be set or not. That's so simple. But in Mode 1 and 0 you have more colors, and every pixel uses different bits of a byte. In addition - depending in the pen - a set pixel can consist out of ones and zeroes. So the fast and easy Z80 instructions can't be used any longer.
What was 1-step in Mode 2 becomes at least 2-steps in Mode 1 and 0. If Andy Cadley still thinks he is right, then let him proove it.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

andycadley

LOL, I can assure you I've written a great many sprite routines on both the CPC and the Spectrum (which has a very Mode 2 like display) so I do have a clue what I'm talking about here. I can see where the assumption it must be faster comes from, because it seems inherently obvious at first. It's only when you start to consider the details of how it has to be done that the rather more surprising truth becomes self evident.

Unless your sprites are going to be solid blocks of one colour that never pass over background (or, if they do you just allow some parts to appear incorrectly transparent) you have to use a seperate mask layer to first clear the relevant area of the display under the sprite. Doing this ends up being just as much work as masking a Mode 1 sprite but uses more memory overall (since Mode 1 sprites usually just sacrifice 1 colour to act as a mask, which you can't do in Mode 2).

As odd as it may seem, you're usually much better off working in Mode 0 from a performance point of view as it both minimizes the amount of masking needed and reduces the amount of memory needed for pre-shifting frames. From a gaming perspective Mode 2 doesn't really make much sense at all.

arnoldemu

#43
I too have written some sprite routines for all the modes.

Really there is not much in them, but perhaps I need to make a demo program to show what you need and the resulting speed so we can settle this.

In all modes, it comes down to do you sacrific one pen for transparency. If you do, you can have a 256 byte mask table. If you don't you need extra mask bytes.

Now in mode 2, Andy is correct, you *must* have a mask, you've got no choice.

So then it comes down to, do you store pre-shifted sprites or do you store a shift table and compute at runtime.

For mode 2, this is approx 3.5K of shift table, for mode 1 it's half this, for mode 0, it's 512 bytes i think.

The actual code is almost the same regardless of the mode, it just depends on how wide and tall the sprite is.

The way you can make sprite drawing faster is to reduce the width of the screen to be 32 chars wide (64 bytes), because then you can use more 8-bit arithmetic to move around the screen compared to being forced to use 16-bit.

So which mode is best? I would say, go for mode 1 if you need resolution and detail in your sprites.
Go for mode 0 if you want colour.
Mode 2 is not really that great for games, but could be used in a stylised way to create something interesting and different from the norm. Here I am more thinking of using mode 2 with some interrupts to have more than 2 colours on the screen, and produce some interesting colour mixes.

EDIT:
For those who are not sure of the terms I used here, go to:

www.cpctech.org.uk/

Look under "source" and here you will find examples for drawing masked sprites, pre-shifted sprites, sprites in mode 1 and mode 2.

So you can get an idea of how to draw a sprite on the cpc.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

sigh

I see.

While I've been working on the beatem up game, I've been toying with the idea of trying out a different mode for the next game I want to create (football) but first want to test on something less animation heavy like a vertical shooter, so I can have a better understanding of the different modes and what's capable with each one. (I'll eventually will be doing something using mode 2). I now am even more impressed at how quickly Fres Attack plays with all these other variables!

TFM

#45
In Mode 2 the Sprite itself is the mask and the quick Z80 command OR can be used to lay the Sprite over the background. This is the most efficient way, and it can't be used in Mode 1 and 0.

So Mode 2 is the winner! ;D


EDIT: Maybe we should do some Sprite-Routine benchmarks here, but you guys will really start to hate me if I'm right at the end - because I'm usually right (ok, you can start to hate me now).

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

ssg

Quote from: TFM/FS on 05:32, 13 April 11
In Mode 2 the Sprite itself is the mask


That's not true. You'd want to have opaque black color in your sprites, for dithering or detailing etc.

arnoldemu

#47
Quote from: TFM/FS on 05:32, 13 April 11
In Mode 2 the Sprite itself is the mask and the quick Z80 command OR can be used to lay the Sprite over the background. This is the most efficient way, and it can't be used in Mode 1 and 0.

So Mode 2 is the winner! ;D


EDIT: Maybe we should do some Sprite-Routine benchmarks here, but you guys will really start to hate me if I'm right at the end - because I'm usually right (ok, you can start to hate me now).
a fast sprite drawing challenge!
this will be fun.
If you're correct, I'll not hate you ;)

EDIT: Mission genocide uses OR to draw the sprites and AND to remove them, but then you loose some colours ;)
I already made a sprite example that shows this one ;)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

FatAgnus

Ssg is right.
You need 3 colours in mode2, "ink"+"black"+"transparent", so you can't simply "OR it" (if you want a USEFUL routine, of course)


TFM

Quote from: ssg on 07:50, 13 April 11

That's not true. You'd want to have opaque black color in your sprites, for dithering or detailing etc.

Well, in Mode 2 you have only 2 colors (pixel set or pixel not set). The dittering must be done to the background, so the sprite remains as it is.

Or do you want to dither that sprite? Then it would be like a shaddow, nice effect but not wanted for most sprites I guess.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod