Image Map Image Map
Page 8 of 16 FirstFirst ... 456789101112 ... LastLast
Results 71 to 80 of 151

Thread: VGA & CGA Graphics Library for DOS Games

  1. #71
    Join Date
    Dec 2014
    Location
    The Netherlands
    Posts
    1,522

    Default

    Quote Originally Posted by Trixter View Post
    I don't know what is going on with the screenshot, but it doesn't look that way when the game is playing. The game is in 256-color mode, and each sprite cluster has its own palette, and are combined when the game is running.

    A simple example: If you have 4 sprites, each with 16 unique colors, you would place the first sprites' palette in palette indexes 0-15, the second sprite's colors in 16-31, the third sprite's colors in 32-47, etc. And then you must remap the sprite data to match their new palette indexes: The first sprite requires no shifting; the second sprites needs all of its pixels added by 16, the third sprite needs all of its pixels added by 32.

    Playing around with the palette in DeluxePaint's 256-color mode may help illustrate this.
    I've been thinking about this, and I'm pretty sure this is not the case.
    Namely, I'm quite sure the VGA version of Prince of Persia uses only 16 colours (it looks the same on Amiga. The Amiga has a 32 colour mode, but firstly, that wouldn't get you much further than 1 sprite with this idea, and secondly, 32-colour mode is slower than 16-colour mode, so most games used 16-colour. This also made it easier to port games to/from other 16-colour systems). Therefore all sprites should map to the same palette.
    What probably happened is that the colours in the palette are the same, but not every image uses all colours, and whatever software was used to process the images may have 'optimized' the palette to put the most-used colours first.

    I think you should do an analysis on all the palettes. Combine all palettes to one 'uber-palette', and remove all duplicate colours. You'll probably end up with 16 (or possibly 32) unique colours, but no more. So you should probably just remap all your sprites and backgrounds to use the same palette once, then you can use a fixed palette during the game (I think it does change to different palettes for different levels, but that's mostly the background colours. The sprites remain the same I suppose. They would just have reserved a few colours to create different kind of colours for the stones and such).

  2. #72

    Default

    I think its the way Trixter said, because if you look at the intro of the game, you'll noticed that all the bitmaps are displayed instantly. Even if you slow down DosBox too much. I guess that all the bitmaps were loaded in different palette indexes. And they are all put on the screen at the same time, but the palettes are initialized when you want that bitmap to show. That way you won't noticed the bitmap being drawn on screen which is the problem I'm having right now.

  3. #73
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    4,060
    Blog Entries
    1

    Default

    It's the way I said Here is a picture captured from the opening scene:

    dp_000.png

    This is in MCGA 256-color mode and has over 50 unique colors. The entire palette is a mixture of the default palette as well as obvious 16-color sections that have been changed. Here are both changed sections:

    dp_001.pngdp_002.png

    I checked the main running program (ie. when you first start the game) and it is also in 256-color mode with 32 colors changed from the default palette (16 for the dungeon tiles, and 16 for the prince sprite). If I run into the room with an enemy, it now jumps to 48 new colors. You can verify this for yourself by running the game in DOSBox, then capturing a screenshot using ctrl-f5, then loading the picture into irfanview and selecting Image->palette->edit palette.
    Offering a bounty for:
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)
    - Any very old/ugly IBM joystick (such as the Franklin JS-123)

  4. #74
    Join Date
    Dec 2014
    Location
    The Netherlands
    Posts
    1,522

    Default

    Well, then I wonder why it looks exactly the same on Amiga, which is physically incapable of displaying 50 unique colours (it can do 64, but only in 'halfbrite' mode, where the second 32 are a mirror of the first 32 colours with half the intensity. I don't think Prince of Persia uses that).
    It could just be a very sloppy port of the Amiga version to MCGA.


    I guess what I'm saying is that we could both be right: the game might actually use the convoluted way of re-indexing sprites and updating the palette, in 16-colour chunks.
    But that does not necessarily mean that all 16 colours of each block are actually being used on screen. The sprites don't strike me as being 16-colour. They look more like 5-6 colour tops.
    In the palette you show, you see a lot of purple/pink shades, which I don't think are in the image at all. The characters seem to use one purple and one pink shade, and not much in the background either.

    As I say, an analysis would be required:
    How many unique colours are in the palette, and which of these colours are actually being indexed by the pixels on screen.
    Last edited by Scali; February 16th, 2017 at 11:20 PM.

  5. #75
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    4,060
    Blog Entries
    1

    Default

    In the Palace intro scene I posted earlier, there are 52 unique onscreen colors.

    I think both versions use the same techniques and possibly the same source assets; it's just that the Amiga version was possibly better about creating combined palettes and not wasting colors, since it had to (only 32 onscreen at once). The MCGA version is clearly a little lazier; you can see in the palettes that each element in the dungeon (background tiles, sprite #1, sprite #2) have their own 16-color entry/range in the total 256-element palette.

    I don't fault them for that -- If all my source assets were 16 colors or less, and I had 256 to work with, that's exactly how I'd do it as well. There's no full-screen animation in POP, only localized small updates (it did originate on the Apple II in double-high-res so minimizing screen writes was mandatory) so using full-blown MCGA is not a problem -- there was no need for the speed of a 16-color mode.
    Offering a bounty for:
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)
    - Any very old/ugly IBM joystick (such as the Franklin JS-123)

  6. #76

    Default

    I still can't figure out how are they putting the intro bitmaps on screen so fast! I tried doing what I said in a previous post but it shows black rectangles on screen... so thats no good. I'm still thinking about some kind of color palette trick that I don't know. What do you guys think?

  7. #77
    Join Date
    Dec 2014
    Location
    The Netherlands
    Posts
    1,522

    Default

    Quote Originally Posted by Trixter View Post
    so using full-blown MCGA is not a problem -- there was no need for the speed of a 16-color mode.
    On the other hand, they had to solve this problem for EGA (and CGA) anyway:

  8. #78
    Join Date
    Dec 2014
    Location
    The Netherlands
    Posts
    1,522

    Default

    Oh, they have a separate video for the intro:

  9. #79
    Join Date
    Dec 2014
    Location
    The Netherlands
    Posts
    1,522

    Default

    Quote Originally Posted by NicolasF View Post
    I still can't figure out how are they putting the intro bitmaps on screen so fast! I tried doing what I said in a previous post but it shows black rectangles on screen... so thats no good. I'm still thinking about some kind of color palette trick that I don't know. What do you guys think?
    I think they either prepare the background+overlay in a backbuffer, and copy the whole thing to screen (same as with regular sprites as explained in my earlier post), only updating the part of the screen that is affected.
    Or, they do it on-the-fly with masking.
    You should never see black rectangles on the screen, unless you explicitly draw black into the frontbuffer. There's no reason to ever draw black.

  10. #80
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    4,060
    Blog Entries
    1

    Default

    Quote Originally Posted by NicolasF View Post
    I still can't figure out how are they putting the intro bitmaps on screen so fast! I tried doing what I said in a previous post but it shows black rectangles on screen... so thats no good. I'm still thinking about some kind of color palette trick that I don't know. What do you guys think?
    It's not a color palette trick. You're giving up too easily; just debug your dirty rectangles and it will work.

    Maybe it will help to just do this: Have a 64K background buffer, a 64K work buffer and of course there is the 64K screen RAM at 0xA000. Try doing just this for your animation loop:

    1. Copy the entire background buffer to the work buffer to "erase" the work buffer.
    2. Plot your sprites into the (now clean) work buffer.
    3. Copy the entire work buffer to screen RAM.

    This is slow, but it will let you easily debug any trouble with your sprite routines. Get this working first.

    Once you have this working, you can speed it up by optimizing step #3 (instead of copying the entire work buffer, you copy only the areas you changed). And once you have THAT working, you can optimize step #1 (by copying only the background areas that you need to erase the sprites from the previous frame). And that's it -- you'll get your massive speedups (unless you're plotting a lot of very large sprites, of course)

    Quote Originally Posted by Scali View Post
    On the other hand, they had to solve this problem for EGA (and CGA) anyway:
    Yes, by using a fixed palette and remapping each sprite's colors into it. Which is likely what the Amiga version did, but it's less noticeable because their fixed palette is 32 colors and optimized.
    Offering a bounty for:
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)
    - Any very old/ugly IBM joystick (such as the Franklin JS-123)

Page 8 of 16 FirstFirst ... 456789101112 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •