Author Topic: Converting VGA images to EGA  (Read 9169 times)

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2183
    • Nol Drek's Web Site
Re: Converting VGA images to EGA
« Reply #45 on: June 13, 2015, 04:07:34 PM »
All of the walls I'm using were created by GoldBoxFan and/or hans.

I debated capturing some walls and small pics from Hillsfar, but decided against it.

I'm almost done verifying that all the images use colors 0-15 and nothing but colors 0-15, allowing me to change the palette of the entire game by simply replacing one file: ALWAYS.TLB.

Here's a screenshot from FRUA in 4-color CGA glory.
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline hans

  • Hero Member
  • *****
  • Posts: 2721
Re: Converting VGA images to EGA
« Reply #46 on: June 13, 2015, 05:51:40 PM »
That looks nice! 

I never played any of the Goldbox games in CGA, but after discovering them, went back to find some of SSI's older games, like Wizard's Crown, and Phantasie III, and Star Command.

Offline GoldBoxFan

  • Hero Member
  • *****
  • Posts: 1708
  • "We need more cowbell."
Re: Converting VGA images to EGA
« Reply #47 on: June 13, 2015, 06:48:50 PM »
All of the walls I'm using were created by GoldBoxFan and/or hans.
In my case converted. Some like BR may have slightly different colors, but I wouldn't say I created any. I did shorten walls that were too tall, but just copied part of a wall over another part, or cut the top off entirely.

EDIT: I made conversions here http://ua.reonis.com/index.php?topic=2374.0 and here http://ua.reonis.com/index.php?topic=2344.0
« Last Edit: June 13, 2015, 10:04:25 PM by GoldBoxFan »

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2183
    • Nol Drek's Web Site
Re: Converting VGA images to EGA
« Reply #48 on: June 27, 2015, 03:00:24 PM »
The EGA16 demo module is complete and available for download.

http://frua.rosedragon.org/pc/demos/ega16.zip

If a piece of art was available from Pool of Radiance, Curse of the Azure Bonds, Secret of the Silver Blades, Champions of Krynn, Death Knights of Krynn, or Neverwinter Nights Online, then I used it to replace the FRUA VGA version. If there was more than one pic to choose from, I usually opted for higher-quality pics from later games in the Gold Box series. However, there were many animations and sprites which were selected for use that could only be found in Pool of Radiance. If a few cases, I converted VGA images from Gateway to the Savage Frontier, Treasures of the Savage Frontier, Pools of Darkness, and Dark Queen of Krynn to use only the first 16 colors.

Some of the NPCs were changed to fit the available art. Derf Strongarm and Olive Ruskettle appear in the demo art, as do Kildirf, Strangbourn, and Tanis Halfelven. I researched these Gold Box NPCs, so that the familiar images go with the correct names wherever possible. The result is a Gold Box construction kit that feels like what would have been used to create the earlier, EGA-only Gold Box games. It includes 33 fully animated TLB small pics. You can change the palette and the animations still display perfectly.

Try the short demo module. Make sure you try out the palette choices.

The following art has been replaced with 16-color versions:
ALWAYS
ANIMATED PICS
BACKDROPS
BIG PICS
DUNGEON ART
FRAME
MONSTER COMBAT ICONS
PC COMBAT ICONS
SMALL PICS
SPRITES
TITLE SCREENS
WALL SETS
WILDERNESS ART

The art PCX files are available separately. The art pack includes everything that is in EGA16, plus a ton of other stuff that there wasn't room for. The art pack includes various ALWAYS files that have the 2 basic CGA palettes and 3 different alternative EGA palettes.

http://frua.rosedragon.org/pc/art/e/ega_art.zip

Thanks to:

Bil Simser for the invaluable Gold Box Explorer
hans for his EGA module "Kill the Heroes of Phlan"
GoldBoxFan for the NWNO Wall Sets
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline ProphetSword

  • Mod Designer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2903
  • FRUA Lives!
    • Lands of Adventure
Re: Converting VGA images to EGA
« Reply #49 on: June 27, 2015, 06:31:43 PM »
Thanks for the hard work that went into this.  I am actually looking forward to building some kind of module with it.
LANDS OF ADVENTURE: An Old-School Style CRPG

More Information Here: http://landsadventure.blogspot.com/

Offline hans

  • Hero Member
  • *****
  • Posts: 2721
Re: Converting VGA images to EGA
« Reply #50 on: June 27, 2015, 08:22:03 PM »
Great job, Nol! 

The mini-dungeon was fun, too!   ;D

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2183
    • Nol Drek's Web Site
Re: Converting VGA images to EGA
« Reply #51 on: June 29, 2015, 11:17:14 AM »
Thanks for the hard work that went into this.  I am actually looking forward to building some kind of module with it.

I can't wait to see what you come up with.
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline ProphetSword

  • Mod Designer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2903
  • FRUA Lives!
    • Lands of Adventure
Re: Converting VGA images to EGA
« Reply #52 on: June 29, 2015, 03:34:58 PM »
I'm using this as a base for a one-month challenge to get a module done.  I've asked if others want to join, but so far, no responses.
LANDS OF ADVENTURE: An Old-School Style CRPG

More Information Here: http://landsadventure.blogspot.com/

Offline marainein

  • Sr. Member
  • ****
  • Posts: 372
Re: Converting VGA images to EGA
« Reply #53 on: August 29, 2015, 07:27:34 PM »
A general mapping look-up table would be an awesome solution to this problem.

Using the Ogre/Giant pic as an example, it would be something along the lines of:

247, 165, 115 -> 255,  85,  85
247, 132,  99 -> 255,  85,  85
198,  82,  66 -> 170,   0,   0
132,  49,  40 -> 170,   0,   0
 66,   0,   0 ->   0,   0,   0


I could make use of such a table regardless of whether it is in decimal (as above) or in hex to completely automate the process of image conversion.

Unfortunately, I don't know enough about the DAX format to inspect the graphics directly. I have to use Goldbox Explorer to inspect the images. Goldbox Explorer is a great tool, truly invaluable, but the palettes it creates are not 100% accurate.

Sorry to reply to a half year old post, but can Nol or someone else give me an example of GBE producing a faulty palette? I'd like to fix the problem, but first I need an example of what exactly is wrong.

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2183
    • Nol Drek's Web Site
Re: Converting VGA images to EGA
« Reply #54 on: August 30, 2015, 11:23:49 AM »
Sorry to reply to a half year old post, but can Nol or someone else give me an example of GBE producing a faulty palette? I'd like to fix the problem, but first I need an example of what exactly is wrong.

The most obvious difference is that Gold Box explorer uses black for the transparent background and dark gray for pixels that should be black.
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2183
    • Nol Drek's Web Site
Re: Converting VGA images to EGA
« Reply #55 on: August 30, 2015, 12:22:29 PM »
Sorry to reply to a half year old post, but can Nol or someone else give me an example of GBE producing a faulty palette? I'd like to fix the problem, but first I need an example of what exactly is wrong.

Another difference is illustrated in the image below. The left half of the image is assembled by cutting and pasting out of Gold Box Explorer. The right half of the image is a screenshot from the final battle in Curse of the Azure Bonds.

Gold Box Explorer:
You can see that the colors on the left half use RGB values of 0, 82, 173, or 255.
For example: Red = (173, 0, 0) Cyan = (82, 255, 255)

Curse of the Azure Bonds:
You can see that the colors on the right half use RGB values of 0, 85, 170, or 255.
For example: Red = (170, 0, 0) Cyan = (85, 255, 255)

The difference is subtle, and I don't know if it comes from the data files or the way images get displayed at run-time.
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline marainein

  • Sr. Member
  • ****
  • Posts: 372
Re: Converting VGA images to EGA
« Reply #56 on: August 30, 2015, 03:52:08 PM »
Sorry to reply to a half year old post, but can Nol or someone else give me an example of GBE producing a faulty palette? I'd like to fix the problem, but first I need an example of what exactly is wrong.

The most obvious difference is that Gold Box explorer uses black for the transparent background and dark gray for pixels that should be black.
Hmm, something strange is going on. The EGA palette gold box games use may be different from the standard one. I replaced color 0 (normally black) with the transparent green color, and moved black to color 8 (normally gray), and that's improved things. Although it does make me wonder what EGA icons do for gray. Do they even use the color? Is there a list of what the EGA palette should be somewhere?

Offline marainein

  • Sr. Member
  • ****
  • Posts: 372
Re: Converting VGA images to EGA
« Reply #57 on: August 30, 2015, 04:13:17 PM »
Sorry to reply to a half year old post, but can Nol or someone else give me an example of GBE producing a faulty palette? I'd like to fix the problem, but first I need an example of what exactly is wrong.

Another difference is illustrated in the image below. The left half of the image is assembled by cutting and pasting out of Gold Box Explorer. The right half of the image is a screenshot from the final battle in Curse of the Azure Bonds.

Gold Box Explorer:
You can see that the colors on the left half use RGB values of 0, 82, 173, or 255.
For example: Red = (173, 0, 0) Cyan = (82, 255, 255)

Curse of the Azure Bonds:
You can see that the colors on the right half use RGB values of 0, 85, 170, or 255.
For example: Red = (170, 0, 0) Cyan = (85, 255, 255)

The difference is subtle, and I don't know if it comes from the data files or the way images get displayed at run-time.
You're right - the cotab ones are the standard ega palette https://en.wikipedia.org/wiki/Enhanced_Graphics_Adapter#Color_palette and the ones in gbe are different. I'll change it, but I also want to figure out where the current gbe palette came from, in case I'm breaking something else.

Edit - further detective work shows that GBE has always had that palette for EGA colors, and it may have come from https://github.com/simeonpilgrim/coab/blob/master/Classes/Display.cs. I'll have to ask Simeon Pilgrim where he got that palette from.
« Last Edit: August 30, 2015, 06:05:47 PM by marainein »

Offline marainein

  • Sr. Member
  • ****
  • Posts: 372
Re: Converting VGA images to EGA
« Reply #58 on: September 03, 2015, 11:02:54 PM »
To follow up my own question, gray is the background color during combat mode for the EGA icons. Furthermore, looking at the cotab code https://github.com/simeonpilgrim/coab/blob/master/engine/ovr025.cs#L1514 the game switches palette entries 0 (normally black) and 8 (normally gray) when it enters combat mode.

Code: [Select]
internal static void RedrawCombatScreen() // sub_68DC0
{
ovr033.Color_0_8_inverse();
seg037.DrawFrame_Combat();

This explains why GBE (which reads the icons directly out of the files) has these colors swapped around when compared to screen captures from the actual game.

Which leads me to the question - do you guys want the combat icons exported with a gold box EGA gray background, or with a transparent one?

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2183
    • Nol Drek's Web Site
Re: Converting VGA images to EGA
« Reply #59 on: September 03, 2015, 11:54:41 PM »
Wow, that's great!

Sorry I didn't have time to respond earlier... I could have told you that Gold Box games use gray as the color of the floor (the background color) in the combat tiles.

I'd like the background to be this color:

Red=103, Green=247, Blue=159

In hex, that would be #67F79F

See image below
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

 

anything