hankmorgan / UnderworldExporter

Updated Release 27th Oct 2018 Unity based port of Ultima Underworld I and II. Download under releases
https://www.youtube.com/watch?v=4DZj3eWP9cw
MIT License
322 stars 22 forks source link

Exporter Tool usage and issues #103

Open FitzRoyX opened 3 years ago

FitzRoyX commented 3 years ago

Sorry if this is not an "issue" with the engine per se, but I couldn't find an email or discussion section. I'm interested in extracting the assets of these games. The 1.0 release has a nice tool that can do this, but it's from many years ago and I had some questions regarding its usage and output. So far I have attempted UW2 only.

-I couldn't get PANELS.GR to spit out any files -Are CRIT dimensions really this variable internally or are they dynamically cropped somehow by the tool? I noticed the same critter sprite will often have two sets of sprites at different heights. For example, CR05_00 (62x67) and CR05_01 (52x88) appear to be a continuation of the same skeleton sprite. I would've expected them all to be 64x96 or something (they could be more easily merged into a horizontal spritesheet if they were). -There are options to export to BMP or TGA, and I'm not sure which is more accurate. Did the original data have transparency markers or did they just say black=transparent at render time depending on the GR file being read? When converting TGA to PNG, stuff like this can happen, which seems wrong, like GENHEAD wasn't meant to have black=transparent.

data^genhead gr^0040

-BYT.ARK spits out a bunch of duplicate images, most of them using the wrong palette. -None of the palette choices 0-7 seem to work for the cutscene BYT files. -WEAP.GR prints out "HHHHHHH" in the console and seems to work, but I noticed numbers being skipped, like 0017, 0018, 0019, 0020, 0021. Is there missing data here or just blanks?

hankmorgan commented 3 years ago

The tool was wrote a good few years ago. It's pretty buggy and my first time writing a large C program so it was not good to be honest. If you look at the folder https://github.com/hankmorgan/UnderworldExporter/tree/master/Editor/UnderworldEditor you will see the source for a WIP C# GUI editor that can load (some) image files and extract them for you.

As for your questions: Panels.GR is a special case/bug with the original files. The file header gives the wrong bit map size. See code from grloader for correct parameters BitMapWidth = 83; BitMapHeight = 114; if (_RES == "UW2") { BitMapWidth = 79; BitMapHeight = 112; } Getting the bitmaps is a bit of trial and error. Not sure about the duplicates but palette numbers differ from image to image See https://github.com/hankmorgan/UnderworldExporter/blob/master/UnityScripts/scripts/Loaders/BytLoader.cs for a better implementation and a list of palettes. Its very very likely the exporter tool is not using the correct palette.

Crit Dimensions really do vary from image to image. One of the data files defines a pivot point for each sprite. See https://github.com/hankmorgan/UnderworldExporter/blob/master/UnityScripts/scripts/Loaders/CritterInfo.cs https://github.com/hankmorgan/UnderworldExporter/blob/master/UnityScripts/scripts/Loaders/CritLoader.cs https://github.com/hankmorgan/UnderworldExporter/blob/master/UnityScripts/scripts/Loaders/CritLoader.cs for my implementation of npc sprites

Transparency was done using one of the indices in the game palette. Some image types use transparancy and some don't. Again trial and error to get the right setting. The BMP and TGA exports are identical except the BMP does not have any transparency.

Weapons.gr. As I recall some images are invalid. Basically ones at the end of an animation.

FitzRoyX commented 3 years ago

Nice, I didn't know you were working on a new editor/extractor. It would also be nice if there was some kind of batch extract option that just extracted everything it could in one go. Going through the menu for all the GR/ARK/BYT files took a while. Overall you're pretty close to getting all the art unburied and viewable. I love being able to look at all the great pixel art so easily in just my file browser. The character portraits were so cool for these games! ss