English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. AMOS (https://eab.abime.net/forumdisplay.php?f=119)
-   -   Sprite colors all mixed up (https://eab.abime.net/showthread.php?t=69836)

Kenan 29 June 2013 20:17

Sprite colors all mixed up
 
Posted this on the AMOS forums but no reply so far..so was thinking of giving it a shot here:

Hello!

I'm currently reading the AMOS manual (I have a 2.0 Amos Pro) and so far couldn't find the answer to my problem. When I load up the sprite in Amos using the Sprite and Get Sprite Palette commands, the colors of the sprite are mixed up, they do not match the prefered ones in Object Editor. Same happens if I grab sprite images from an IFF file - in the Object Editor colors are fine but as soon as I load it in Amos, what was once say, a green sprite, it's now purple etc.

What am I doing wrong and how do I fix this problem?

Thanks in advance.

p.s.
Not sure if it matters, I'm running Amos on my real A1200 with an ACA1220 accelerator (hard disk install).

Amiten 29 June 2013 21:43

Ok, the quick way is after you made the sprites/bobs in Deluxe paint grab each one in the Amos object editor and also width the same palette/resolution you use for these object make a background image, after the object grab load iff as background image and them show your sprite/bobs in the screen and the result must be ok in colours aspect, dont need to get spritte palette calls, feel free to askme more help if you want , hope you can continue explorer The great Amos ;)

Remember Amiga sprites only are 16 pixel wide bigger than that is a Bob so if you try to show a bob like a sprite maybe you can get rong color or other issues...

Also max sprite colour are 8 , sprites its ok for misils, or similar small forms who need move very quick or like that, but I not usually use sprites for me bobs are better in major cases, big dimensions colours and moving using Amal its all smooth fast i need

fishyfish 30 June 2013 05:51

Sprites use color registers 16-31, so you can either define the colors manually if using a 16 color screen (sprites use a different palette, even when screen is only 16 colors), or just setup a 32 color screen and the sprites will use last 16 colors.

Sprites can actually be 16colors. Sprites 0 and 1 use registers 16,17,18,19, sprites 2/3 use 20,21,22,23, sprites 4/5 use 24,25,26,27, and sprites 6/7 use 28, 29, 30, 31.
You can however mix channels and have 16 color sprites, but you lose 1/2 the sprite channels (4x4bit color instead of 8x2 bit color). One color however, regardless of color depth will be transparent.

While theyre technicaly only 16 pixels wide and only allow 8 you can multiplex them which allows "unlimted" 64 pixel wide sprites (4 channels * 16). When doing this however youre restricted to 64 pixels per scan line (and in multiples of 16 (eg. cant have a 44 pixel wide sprite + 20 pixel wide sprite on same scanline, but can have 1x48+1x16)). This width is doubled when using 2bit color sprites (4 color). You can mix 4 and 16 color sprites, but I advise against it as it gets hard to keep track of what channels are used where, especially when using multiplexed sprites.

To multiplex sprites in AMOS you just need to use sprite "channel" 8 and above. Amos will do the hard work for you. For every channel you use between 0 and 7 you lose some width for multiplexing.

Sprites really are more useful than theyre given credit for and can reduce the amount of bobs needed, making for less blitter work required saving time for bobs and scrolling.

Amiten 30 June 2013 13:19

Rectify. Amiga supports. 16 pixel wide up to 255 high and max 8. Of 3xcolours sprites and 4 of 15xcolours sprites colour number 0 are transparent, computed sprites can vary between 16 and 128 pixel wide

16*8=128 pixel 3 colours

16*4=64 pixel for 15 colours

Sprites

Edit: Forget to mention max objects(computed sprites) at same time in the screen its limited to 64.

volvo_0ne 04 January 2016 22:08

All this is very interesting, but how do I get a 15 colour sprite in the first place?

My images are created with the AP object editor in 16 colour mode and output to a 16 colour screen in AMos, However it only ever shows the sprite in 3 colours.

scratches head........

Mrs Beanbag 04 January 2016 22:18

if they are really sprites and not bobs, bear in mind they use the upper 16 colours in the palette, that is, colours 17 to 31. They should appear the same even on a 2 colour screen, because sprites are independent of the screen.

Also since a 16 colour sprite is two sprites joined together, make sure you only use even sprite numbers.

volvo_0ne 04 January 2016 22:32

Quote:

Originally Posted by Mrs Beanbag (Post 1060215)
if they are really sprites and not bobs, bear in mind they use the upper 16 colours in the palette, that is, colours 17 to 31. They should appear the same even on a 2 colour screen, because sprites are independent of the screen.

Also since a 16 colour sprite is two sprites joined together, make sure you only use even sprite numbers.

Thanks Mrs Beanbag.
Yes it is a sprite (not Bob) 16x16 px in 16 colours.


It gets more curious........
i copied the lower 16 colours to the upper 16 and now I get more than 3 colours, but still the colours are wrong(in a different way).

eg :
for i=0 to 15:colour(i+16),colour (i):next i




I'm obviously going wrong somewhere.

Mrs Beanbag 04 January 2016 22:33

remember also your mouse pointer is already sprite 0, so you can't use sprite 0 or sprite 1 unless you turned the mouse pointer off.

3-colour sprites will use the following colours:
sprites 0 and 1: 17,18,19
sprites 2 and 3: 21,22,23
sprites 4 and 5: 25,26,27
sprites 6 and 7: 29,30,31

volvo_0ne 04 January 2016 22:41

Quote:

Originally Posted by Mrs Beanbag (Post 1060221)
remember also your mouse pointer is already sprite 0, so you can't use sprite 0 or sprite 1 unless you turned the mouse pointer off.

3-colour sprites will use the following colours:
sprites 0 and 1: 17,18,19
sprites 2 and 3: 21,22,23
sprites 4 and 5: 25,26,27
sprites 6 and 7: 29,30,31

Yes I hid the mouse pointer & used sprite 0, however my images in the object bank are 16 colours and they are all 16 px X 16 px

then i did get bob palette, then copied the colours as above.

getting tired now lol

Lonewolf10 04 January 2016 22:53

I have rarely used Bobs in AMOS so this could quite possibly be wrong, but what does the BOB UPDATE command do? Does that just update the Bob positions or does that update any colours changes too??


Secondly, are you sure you are applying Get Bob Palette etc. on the correct screen? If you are using multiple screens (including hidden ones) it is easy to wonder why graphical changes are 'failing' - usually because they are being applied to the wrong screen.

volvo_0ne 04 January 2016 23:00

Quote:

Originally Posted by Lonewolf10 (Post 1060229)
I have rarely used Bobs in AMOS so this could quite possibly be wrong, but what does the BOB UPDATE command do? Does that just update the Bob positions or does that update any colours changes too??


Secondly, are you sure you are applying Get Bob Palette etc. on the correct screen? If you are using multiple screens (including hidden ones) it is easy to wonder why graphical changes are 'failing' - usually because they are being applied to the wrong screen.

Hi Lonewolf.

It's a SPRITE I'm using, the reason I use get bob palette is to grab the palette from the object bank into my screen palette ready to copy the first 16 to the last 16 colours (see above)

volvo_0ne 04 January 2016 23:22

Gurrrrrrrrrrrrrrrr!

Panic over

Just reloaded everyting and it now works perfectly, sorry for wasting your time people.

And many thanks!

oh and.....

HAPPY NEW YEAR!!

Mrs Beanbag 04 January 2016 23:38

ha! "did you try turning it off and on again?"

Lonewolf10 06 January 2016 23:04

Quote:

Originally Posted by volvo_0ne (Post 1060231)
It's a SPRITE I'm using, the reason I use get bob palette is to grab the palette from the object bank into my screen palette ready to copy the first 16 to the last 16 colours (see above)

Ok, but isn't there a Get Sprite Palette instruction?


Good to see you now have it working though ;)

volvo_0ne 06 January 2016 23:41

Quote:

Originally Posted by Lonewolf10 (Post 1060830)
Ok, but isn't there a Get Sprite Palette instruction?


Good to see you now have it working though ;)

Thanks for the reply Lonewolf...

Indeed there is , but as far as I can see, Get Sprite Palette and Get Bob Palette do exactly the same thing?

Unless someone knows better?

Lonewolf10 08 January 2016 22:32

Hmmm... That's a good question. I did download the source to AMOS Pro a few years back. I'll take a look tomorrow (if I don't forget - I have to work this weekend :().

Samurai_Crow 09 January 2016 10:39

I think that the BOB color palette starts at zero and the sprite palette starts at sixteen.

volvo_0ne 20 January 2016 20:40

According to the AMOS manual (not pro) they are identical.

Mrs Beanbag 20 January 2016 21:49

AMOS Pro manual claims Get Sprite Palette uses the upper 16 colours if using a 32 colour screen, i do have a recollection of this not working, however.

volvo_0ne 20 January 2016 22:11

Come to think of it, how the hell do you change (colour) resolution in the AmosPro "object editor", because every time I tried and saved, the reloaded "objects" are always 16 colour.

Or am I missing something?


All times are GMT +2. The time now is 16:53.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04666 seconds with 11 queries