Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2   Go Down

Author Topic: Palettes in AMOS and the obejct editor  (Read 9274 times)

0 Members and 6 Guests are viewing this topic.

MarcoCol

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 10
  • Generic Amiga User
Palettes in AMOS and the obejct editor
« on: April 30, 2017, 08:05:29 AM »

Hi @all,

well, about 25 years ago, I programmed a lot in AMOS - the creator.
Now I am back on my Amiga and want to code again.
But over all those years it seems, that I forgot something :(

So I have a few questions for AMOS Pro:
1) When I use a palette of 16 colors, can then each set screen have another palette of those 16 colors, or must they have the same?
2) Using the object editor (I didn't use it before) for placing GUI-elements (icons), they all must have the same palette together, right? Must that palette have the same colors as the images using in the main programm (see 1)?
3) I have a lot of graphics, which I want to port from my PC. Of course, they are 16-Bit artworks. I use Paint Shop Pro X5 to optimize them for 16 colors. Then I load them into Paint Shop Pro X2 and there I can save them in real 16 color-mode. Do you have any suggestions which programm I can use for that too? Deluxe Paint on the Amiga?
4) When I try to load iff-graphics to grab an image into a bank, I see only a washed and wrong iff-image. Are there any specifications to the graphic?
5) I want to add several main scenes for my project. We speak about 14 different, where I want to switch with. I can only use 8 screens (open screen). So how should I use the screens? For example 0 = for title, 1 for menu, 2 for ingame, or should I set the scenes to the screens 0-7 and open/close screens and when I try to load another scene, then close/open a new screen?

Thank you for your help.
Logged

Sidewinder

  • Forum Mod
  • A600
  • *****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • http://www.liquido2.com/
Re: Palettes in AMOS and the obejct editor
« Reply #1 on: April 30, 2017, 03:41:04 PM »

Hello MarcoCol,

Welcome back!  I'll answer your questions to the best of my ability:

1.  Each screen can have its own palette, separate from all the others.  Screens may even have different numbers of colors.  You will find that if two screens are placed in the view at the same time, there will be a single blank line between them.  This blank line is where AMOS turns off screen rendering while it changes the palette and sets bitmap pointers to the next screen.  This occurs even when the screens have the exact same palette.

2.  All icons or sprites in the object editor at a given time are stored in a single AMOS bank.  All the objects in a bank must have the same palette together.  Different banks may have different palettes.  There are functions to change a screen's palette to that of a sprite/icon bank:  Get Sprite Palette/Get Icon Palette are the commands, I believe.  If these commands aren't used, then the screen may have a totally different palette and the graphics will be displayed in the screen's palette.

3.  I've always used Deluxe Paint, but I'm sure other programs like Personal Paint and certainly many others will allow you to "remap" the colors.  In DPaint this command is in the Color menu and it remaps the image to a new color palette, attempting to make it appear similar to the original image.  Results may vary, but in my experience, it's usually pretty good.

4.  Iff files do have a specification:  https://en.wikipedia.org/wiki/ILBM  If the image isn't displaying correctly, it may be easier to save as a png file or some other format and convert it using ADPro or even loading in Personal Paint and then saving to iff.  PC export of IFF images are often wonky.  The gold standard is Deluxe Paint.  If it loads and displays correctly in DPaint, then it's virtually guaranteed to load correctly in AMOS.  Be sure to use a typical Amiga screen size though.  I've had trouble with the object editor and oversized screens.

5.  You'll generally want to close any screens that are not currently in use and reopen them (and reload their graphics) when it becomes necessary.  There isn't a whole lot of graphics memory on most Amigas, so attempting to open all 8 screens simultaneously will be difficult to do within the memory constraints unless special care is taken beforehand to limit colors and screen size.  Generally I use Load Iff to load the title, and then again Load Iff to load the menu.  Once the menu was swapped to front, I'll then close the title screen, since it is not needed anymore.  In this way there are never more than two screens open at once.  Once the transition is over, the previous screen is closed to conserve memory.  For main game play I will usually have just one screen open (the main screen) or possibly two screens (the main screen and a status/menu screen) that are both displayed at the same time using Screen Offset.

Hopefully that helps.  Let us know if you have any other questions or need clarification.
Logged
- Sidewinder

MarcoCol

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 10
  • Generic Amiga User
Re: Palettes in AMOS and the obejct editor
« Reply #2 on: May 01, 2017, 06:25:21 PM »

Hi Sidewinder,

wow, first, thanks a lot for your great and detailed feedback.
Regarding your answers:
1. Ok. Will try to use for each screen 16 colors. And they should be used as full-screen (320x200 or 320x256).
2. Ok. So as soon as I want to use different palettes, I have to make different banks?!
3. So you mean I can load the 16-Bit graphics in DPaint and save it there with 16 colors for example?
4. In DPaint, they will be loaded and look pretty fine. But in the AMOS object editor, they look wrong.
5. To understand: For example, I open screen 0. There I load an IFF. When I then want to load another IFF, should I do that in another screen or in the same? What is the best for that?
Your answers helped a lot. Thank you for them
Logged

Sidewinder

  • Forum Mod
  • A600
  • *****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • http://www.liquido2.com/
Re: Palettes in AMOS and the obejct editor
« Reply #3 on: May 01, 2017, 09:16:58 PM »

wow, first, thanks a lot for your great and detailed feedback.
Regarding your answers:
1. Ok. Will try to use for each screen 16 colors. And they should be used as full-screen (320x200 or 320x256).
2. Ok. So as soon as I want to use different palettes, I have to make different banks?!
3. So you mean I can load the 16-Bit graphics in DPaint and save it there with 16 colors for example?
4. In DPaint, they will be loaded and look pretty fine. But in the AMOS object editor, they look wrong.
5. To understand: For example, I open screen 0. There I load an IFF. When I then want to load another IFF, should I do that in another screen or in the same? What is the best for that?
Your answers helped a lot. Thank you for them

1.  Excellent!  Full screen is typical, and should be just fine.

2.  What I'm saying is that each bank has a built in palette that is saved with the bank.  You don't have to use that palette though, you can use whatever palette you want.  The graphics will be displayed using the screen's palette, always.  To make the screen's palette match the saved bank palette, use the Get Sprite/Icon Palette command.  Otherwise, just change the color entries manually to whatever you want.

For instance, my son and I have been making a clone of Super Mario Bros. using AMOS.  The graphics are all 16 colors and we cut out all the icons/sprites using the object editor.  For the first level we use bank's color palette since it matches the first level colors, but for the second level we manually change the colors to a different palette to give it a darker/underground feeling.  In both levels we use the exact same object bank and images.  If you plan correctly, there is no need to make a separate bank just to change the colors.

3.  I don't think DPaint can load 16-bit graphics.  I could be wrong, but I think DPaint only loads planar IFF images.  Other programs, like Personal Paint can load .png files and then convert them.  Otherwise you'll need to convert the images using a third-party tool on the Amiga (like ADPro or Image Studio) or some other conversion program on the PC side.

4.  Are you grabbing all the objects from the same screen or from multiple screens?  In the object editor (I think it's in the sprite grabbing screen menu) there is a button that sets the bank's palette to the loaded image's palette, be sure that this button has been used to set the bank palette to the image palette, otherwise the grabbed sprites/icons will use the default palette and will look very strange indeed.  If you're using multiple image files to grab from, be sure they all have the same palette, otherwise some grabbed images will look strange rendered in another screen's palette.

5. To save the most memory, you would want to use only one screen and load the IFFs onto only that single screen.  But that may not always be the most professional way to do it.  If you use two screens, say screen 0 and screen 1, then you load the first image to screen 0 and the second image to screen 1.  Then you can use some of AMOS' transition commands like Fade to transition between the screens in a more professional way.  Once the transition from screen 0 to screen 1 is done, then load the next screen image to screen 0 (overwriting the previous contents) and then transition from screen 1 to screen 0.  The process can be repeated as often as necessary.
Logged
- Sidewinder

MarcoCol

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 10
  • Generic Amiga User
Re: Palettes in AMOS and the obejct editor
« Reply #4 on: May 02, 2017, 02:11:50 PM »

Hi,
2. Ok. I will try. So the best would be, having the same palette for the bank and the screens?
3. Ok. I will try with some programs.
4. No. I put all graphics into one file which are having all the same palette.
5. That make sense. I will try that of even use only one screen for the main game and then load a new image into it. But they can have different palettes, right?
Thank you.
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Palettes in AMOS and the obejct editor
« Reply #5 on: May 03, 2017, 09:39:02 AM »

5. That make sense. I will try that of even use only one screen for the main game and then load a new image into it. But they can have different palettes, right?
Each screen can have its own palette.  Even if you do the split-screen effect Sidewinder described above.
Logged

MarcoCol

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 10
  • Generic Amiga User
Re: Palettes in AMOS and the obejct editor
« Reply #6 on: May 07, 2017, 09:16:30 PM »

Thanks a lot for your answers.

Two additional questions:
1) If I want to have several game-images (background) with some gui on it, I must be sure, the gui has every time the same palette, right? How can I handle that in Deluxe Paint?
2) There is for sure an option to have sprites/gui (...) with a transparent background, right? How can I set that in the object editor?
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Palettes in AMOS and the obejct editor
« Reply #7 on: May 08, 2017, 11:09:07 AM »

In AmosPro you use the Resource editor and Deluxe paint to make the pieces of your GUI.
Logged

MarcoCol

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 10
  • Generic Amiga User
Re: Palettes in AMOS and the obejct editor
« Reply #8 on: May 09, 2017, 02:53:45 PM »

But they must use the same palette too, right?
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Palettes in AMOS and the obejct editor
« Reply #9 on: May 09, 2017, 06:07:17 PM »

Just use palette entries consistent with the destination palette.
Logged

Mia

  • A600
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 101
  • Generic Amiga User
Re: Palettes in AMOS and the obejct editor
« Reply #10 on: May 09, 2017, 08:04:10 PM »

Deluxe paint is good, but i've used Personal Paint for years, it can load jpgs - it also has more advanced palette tools, and merging of palettes which it does really well.

not sure if this is the best but you can manually use Bob banks to store graphics, cut a brush out in dpaint and save it, the background colour is transparent. do Load Iff "filename" in amos (in direct mode even) and then use:

 Get Bob 1,0,0 To sizex,sizey

 grabs it into the Bob bank (called Sprite - check "List Bank") and then use:

 Paste Bob x,y,1

or is this me being lazy?



AMOS also uses the amigas ocs 12bit palette, not the full 255 range for RGB, it is 16 ranges only, I found some online conversion tools which can properly remap colours almost perfectly, it made a difference.
Logged

MarcoCol

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 10
  • Generic Amiga User
Re: Palettes in AMOS and the obejct editor
« Reply #11 on: May 10, 2017, 06:56:39 PM »

I will try.

so for using the bob banks I didn't need the resource editor?

So can I only use 16 colors or are 32 colors possible to use at once?
Does it make sence to use the first colors for the bobs/hud, so that they didn't change?
Logged

Mia

  • A600
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 101
  • Generic Amiga User
Re: Palettes in AMOS and the obejct editor
« Reply #12 on: May 10, 2017, 07:51:27 PM »

I will try.

so for using the bob banks I didn't need the resource editor?

So can I only use 16 colors or are 32 colors possible to use at once?
Does it make sence to use the first colors for the bobs/hud, so that they didn't change?

you can see the bobs with the Object Editor

when you load the iff the palette is set from it, with this method you need all your background pictures and gui pictures already saved using the same palette else the bobs palettes won't map, they are pasted into the screen so the bitmap would be rendered using the background image palette, pasteing a bob does not set the palette.


i understand you want to have a background image with gui elements drawn on top, the background image being different with different palettes, bit complicated in lowres colours, so you would just have to be clever with the palette by reserving colours for the gui , 24 for the picture, 6 for gui - have you got a screen grab to get an idea...

use colour 0 for background transparency - 32 lowres, 16 hires
Logged

MarcoCol

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 10
  • Generic Amiga User
Re: Palettes in AMOS and the obejct editor
« Reply #13 on: May 10, 2017, 09:26:44 PM »

Ok. I will try that.

So is 0 each time for the background-color or must that be set?
What is the best tool to set the palette like that?
I think 26 for the picture and 4 for the gui plus 1 for the background transparency would be fine, so 0-4 shouldn't change, but the rest can change.
Logged

MarcoCol

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 10
  • Generic Amiga User
Re: Palettes in AMOS and the obejct editor
« Reply #14 on: May 17, 2017, 08:32:51 PM »

After I found a way to set the palette for each scene, where I reserve color 0 for the background-color and the colors 1-4 for the gui (they are all time the same, in all scenes), I will no go on, trying to add the gui-elements.
I've tried the suggestion with the bob, and it works already. Will Amos save the bob which I've taken in the direct-mode? Is there no need to grab it in the code?
So they will only getting 4 colors. Must I change the complete image, where I pick later the gui elements from, a 4-color picture?
And how can I say to Amos, which colors of the main scene-palette are used for the GUI?
« Last Edit: May 17, 2017, 08:43:28 PM by MarcoCol »
Logged
Pages: [1] 2   Go Up
 

TinyPortal 2.2.2 © 2005-2022