Hi there,
i'm writing a post here because i hope here are some persons who have deep knowlege of old DOS Games, specially of picture formats.
Whats my finish?
I want to MOD Radix: Beyond the Void. I don't want to make everything new, i only want to add some new Bitmaps and - if i don't fail at any point - double or 4times the original game size of 320x200 pixels. I like Radix much and i want to keep the spirit of it. But a little bit more graphic power would be nice
Why?
Because i can? Its my very very first game i played as i was young, and i play it since it was released in 1996 (the Version 2.0 Remix). I like the game much and i think its some underrated.
How?
It quite easy. The Gamefile (Radix.dat) is only a container wich is made by the Programm "3drescmp.exe" (3D Resurce Compressor). The 3DResCmp.exe need the raw gamefiles (like Pictures, Sounds, Levels and Texts) and a instruction file how to pack them.
3DResCmp.exe comes with the LevelEditor RadCad which all Levels are made with.
What i have finished?
I'm not a IT-guy, i'm a engineer so my basic tools are DosBox, Excel, HxD and LibertyBasic (i know, some of you are now laughing). With this tools i was able to unpack the whole Radix game file. Every file, exept the Pictures, is stored in a known format, so its not a problem to insert new Music or Levels if i want to.
But where i'm wrecked?
As you might, i wrecked at the pictures. I try to explain it at three examples.
I'm able to show every picture of the Game. The Pictures are stored in a Radix-own file format. This format has no header like a Bitmap or JPG. Every pixel of a picture has only one HexCode; so a 64x64 sized picture has the exact size of 4096 Byte. Every HexCode is a compressed RGB Code. An example at the "SmallHydraulicDoor":
This door is a 64x64 Pixel Bitmap. As is stored in 4096 Byte file, the picture can have maximum of 256 colors (00 to FF in Hex for each pixel). All WallBitmaps (thats the name of the Container for wall bitmaps ) have the same Colortable or palette, so after i made a table of all 256 colors, all bitmaps shown in correct colors.
The next thing are the Pictures of the Gamemenu and Objects in the game (like enemies or items). If i want to view this pictures my output looks like that:
or that:
As you can see, my colortable is only for the WallBitmaps. If i want to see others i may use an other palette.
But where's your problem dude?
My problem is the Gamepalette. At Radix.dat there are seven (7!) palette files. But the files are not for each type of picture (like WallBitmap or Gamemenu). The palette files are linked to each other.
There is the "Palette" file, wich is organised in 386 lines, ervery line has a three-byte number and 253 color entries.
There are the "RedShapes", "GreenShapes" and "BlueShades" files, which each have 32 lines with a three byte number and 253 entries.
Finally there are the "RedFromBluePal", "GreenFromBluePal" and "YellowFromBluePal" files, wich are only 765 byte long.
What i'm suspecting!
Radix.exe reads the file "SmallHydraulicDoor" and gets the first Byte for the first pixel. As example it has HEX(15) or DEZIMAL(21).
Now Radix.exe has to gererate the Color of the Pixel. To encrypt the HEX(15) Radix.exe has to know the lightning (dark map, bright map, shooting or nothing) and gererates the acutal color. To create the color Radix.exe has to make a 3-Dimensional vektor out of the 1-Dimensional Pixel HEX(15).
I assume 3-Dimesional because of: Red color, Green color, Blue color. So the individual looking color is gererated out of HEX(15).
Radix.exe is doing that with the 7 palette files. But how game developers of the early '90s are doing it?
Mathematics, Vectors, Arrays and so on is not a problem for me (or excel ). But with 3-Dimesions out of one HEX Code its too much for me. I cant see any regularity how HEX(15) is converted into a specific RGB-Code. I tryed to allocate HEX(15) and the RGB Color (wich i know) by rows, by colums and by mathematics (as example HEX(FF) minus HEX(15) = Red at colum1) and some other things.
Why i need to solve the problem?
If i know how the pictures are shown correctly, i can programm a tool wich does it reverse. Than i'm able to load custom pictures into the Gamefile.
Thanks for reading this long text!
Greetings,
Robert
P.S:
I found the file "DIBUTIL.DLL" wich is a DLL for DIB-Picures. Without that DLL the Leveledtitor can't work. Maybe the palette is made out of the DLL? Radix is written in Borland C++ from 1994.
Some links i found:
http://forum.zdoom.org/viewtopic.php?f=19&t=46035
http://forum.zdoom.org/viewtopic.php?f=37&t=29029
http://forum.zdoom.org/viewtopic.php?f=37&t=37520
My first level i created (some jears ago):
https://www.youtube.com/watch?v=nLoVVm2GEJM
Help from an other Universe - Radix: Beyond the Void
-
- Posts: 6
- Joined: Fri Dec 19, 2014 1:51 pm
-
-
- Posts: 10773
- Joined: Sun Jul 20, 2003 12:15 pm
Re: Help from an other Universe - Radix: Beyond the Void
Ha ha! This is awesome! Radix is fantastic.
Also props on getting a custom thing with RadCad going. Might be worth e-mailing the devs about it -- they'd get a kick out of it. O:
Also props on getting a custom thing with RadCad going. Might be worth e-mailing the devs about it -- they'd get a kick out of it. O:
-
-
- Posts: 17936
- Joined: Fri Jul 06, 2007 3:22 pm
Re: Help from an other Universe - Radix: Beyond the Void
I don't understand the problem.i440bx wrote: What i'm suspecting!
Radix.exe reads the file "SmallHydraulicDoor" and gets the first Byte for the first pixel. As example it has HEX(15) or DEZIMAL(21).
Now Radix.exe has to gererate the Color of the Pixel. To encrypt the HEX(15) Radix.exe has to know the lightning (dark map, bright map, shooting or nothing) and gererates the acutal color. To create the color Radix.exe has to make a 3-Dimensional vektor out of the 1-Dimensional Pixel HEX(15).
I assume 3-Dimesional because of: Red color, Green color, Blue color. So the individual looking color is gererated out of HEX(15).
Radix.exe is doing that with the 7 palette files. But how game developers of the early '90s are doing it?
Mathematics, Vectors, Arrays and so on is not a problem for me (or excel ). But with 3-Dimesions out of one HEX Code its too much for me. I cant see any regularity how HEX(15) is converted into a specific RGB-Code. I tryed to allocate HEX(15) and the RGB Color (wich i know) by rows, by colums and by mathematics (as example HEX(FF) minus HEX(15) = Red at colum1) and some other things.
Why i need to solve the problem?
If i know how the pictures are shown correctly, i can programm a tool wich does it reverse. Than i'm able to load custom pictures into the Gamefile.
A palette is one-dimensional, it's a list of colors. The value 0x15 merely means to take the 21st color of the palette. The RGB value depends entirely on the palette; you cannot extrapolate it from just the color index.
Radix has seven palettes, but it can only use one at once. So there's a palette for during the game, and a different palette for the title screen; this kind of setup was relatively common (one of the Doom engine games, Heretic, uses a different palette for one of its victory screens; other games like Wolfenstein 3D, Spear of Destiny, Rise of the Triad, Duke Nukem, etc. also feature several palettes; Doom itself used a different palette for its title screen in a very early alpha version).
In fact Doom dynamically changes the palette several times during the game, to implement some special effects, see [wiki]palette flashes[/wiki].
Anyway I presume it's all hard-coded in the game, so the only way to know which palette is used for which picture is to make a list. Presumably, all in-game textures and sprites will use the same palette (though it's possible that, like in Dark Forces for example, some levels may have an exclusive palette and textures that only look good with that level's palette), and the rest could be made as list of exceptions.
See this for how I've implemented some automatic palette hack detection in SLADE 3.
-
- Posts: 6
- Joined: Fri Dec 19, 2014 1:51 pm
Re: Help from an other Universe - Radix: Beyond the Void
Hi,
i understand the function of numerus palettes and a simple bunch of indexes in a picturefile. It is much faster for the game to load a single palette than all picturefiles during a explosion.
If it would so easy, "take palette at row 3 and color at column 21" i would not post here.
Take these files:
- Excelfile with three Shades and the Palette (konvertet from HEX to DECIMAL) sortet in Rows and colums
- SmallHydraulicDoor Bitmap in 1:1 (as 24bit Bitmap to have no losses)
- HexDump of SmallHydraulicDoor as Textfile
The Picture is build at first in Y-Axis, so the first 64 Bytes are the first Y-Row of the Picture. Starting at the top left corner.
The first three colors are:
0x07 - Red 154 / Green 146 / Blue 142
0x0A - Red 140 / Green 131 / Blue 124
0x32 - Red 73 / Green 75 / Blue 85
0x30 - Red 86 / Green 86 / Blue 94
Please let me know, if you have cracked the Palette
i understand the function of numerus palettes and a simple bunch of indexes in a picturefile. It is much faster for the game to load a single palette than all picturefiles during a explosion.
If it would so easy, "take palette at row 3 and color at column 21" i would not post here.
Take these files:
- Excelfile with three Shades and the Palette (konvertet from HEX to DECIMAL) sortet in Rows and colums
- SmallHydraulicDoor Bitmap in 1:1 (as 24bit Bitmap to have no losses)
- HexDump of SmallHydraulicDoor as Textfile
The Picture is build at first in Y-Axis, so the first 64 Bytes are the first Y-Row of the Picture. Starting at the top left corner.
The first three colors are:
0x07 - Red 154 / Green 146 / Blue 142
0x0A - Red 140 / Green 131 / Blue 124
0x32 - Red 73 / Green 75 / Blue 85
0x30 - Red 86 / Green 86 / Blue 94
Please let me know, if you have cracked the Palette
-
- Posts: 1
- Joined: Sat Jan 30, 2016 11:48 am
Re: Help from an other Universe - Radix: Beyond the Void
Off the top of my head those aren't palettes, they are lookup tables. Take the original pallete index and remamp it to another palette index to make it "more red" or "more green". Remember, we had to do that math outside the game loop and then encode the result as a lookup table that indexed back into the game palette.
So for the red one for example each 256 entries is another shade of red darker. Anyway, this is off the top of my head, I would have to go look at the source code to get more specific.
source: wrote RadCad and a bunch of the other stuff
So for the red one for example each 256 entries is another shade of red darker. Anyway, this is off the top of my head, I would have to go look at the source code to get more specific.
source: wrote RadCad and a bunch of the other stuff
-
- Posts: 6
- Joined: Fri Dec 19, 2014 1:51 pm
Re: Help from an other Universe - Radix: Beyond the Void
@Neutrino: I send you a PM.
@Xaser:
To make a new Leveleditor its necessary to understand the Levelfile. Within some hours i was able to create a simple encoding of the File. Its not finished at all, but a first view of the File type.
The actual content are only the header, Triggers, Sprites, StartPoints. Missing are Walls and Objects.
Look here: https://dl.dropboxusercontent.com/u/390 ... adCad.xlsx
@Xaser:
To make a new Leveleditor its necessary to understand the Levelfile. Within some hours i was able to create a simple encoding of the File. Its not finished at all, but a first view of the File type.
The actual content are only the header, Triggers, Sprites, StartPoints. Missing are Walls and Objects.
Look here: https://dl.dropboxusercontent.com/u/390 ... adCad.xlsx
-
- Posts: 6
- Joined: Fri Dec 19, 2014 1:51 pm
Re: Help from an other Universe - Radix: Beyond the Void
Uh, exactly 42 Days are gone. Thats some mysterious...
I made some progress in decompiling Radix.
Please see the Video:
https://www.youtube.com/watch?v=YHL7irP7r3g
I'm able to pack a new File with some of the Pictures. I can also load different Musicfiles and Textdocuments. The last reverse engineering success was the Mission Briefing, i find out for what all the Numbers are for. And i knew how to load things like a explosion or a damaged enemy into the briefing. Also a simple hack was the game palettefile.
The only thing, why i'm despairing are the wallpictures. I knew that are indexed pictures. I hacked the palette file. I know that the menu pictures has they own palette (wich i am able to see). But i don't find any way to load a custom made (or a original file) into a new .DAT for Radix.
Someone of you can use the "DIBUTIL.DLL" out of VisualBasic? Its a necessary file for RadCad and i think the WallPictures are made with it. I downloadet Photoshop 2.5 and 3.0 for Win3.11 but i'm not able to load the DIBUTIL.DLL into it, to make new WallPictures.
Greetings,
Robert
I made some progress in decompiling Radix.
Please see the Video:
https://www.youtube.com/watch?v=YHL7irP7r3g
I'm able to pack a new File with some of the Pictures. I can also load different Musicfiles and Textdocuments. The last reverse engineering success was the Mission Briefing, i find out for what all the Numbers are for. And i knew how to load things like a explosion or a damaged enemy into the briefing. Also a simple hack was the game palettefile.
The only thing, why i'm despairing are the wallpictures. I knew that are indexed pictures. I hacked the palette file. I know that the menu pictures has they own palette (wich i am able to see). But i don't find any way to load a custom made (or a original file) into a new .DAT for Radix.
Someone of you can use the "DIBUTIL.DLL" out of VisualBasic? Its a necessary file for RadCad and i think the WallPictures are made with it. I downloadet Photoshop 2.5 and 3.0 for Win3.11 but i'm not able to load the DIBUTIL.DLL into it, to make new WallPictures.
Greetings,
Robert
-
-
- Posts: 17936
- Joined: Fri Jul 06, 2007 3:22 pm
Re: Help from an other Universe - Radix: Beyond the Void
DIBUTIL is just a standard Windows library utility to manipulate Device Independent Bitmaps (DIBs). These files are more commonly known by their extension, BMP. If RadCad used it, it would have been to read BMPs files, and after reading them it could convert them to Radix's own format with custom code.
-
- Posts: 6
- Joined: Fri Dec 19, 2014 1:51 pm
Re: Help from an other Universe - Radix: Beyond the Void
Thats what i thought too, but it doesnt seem so.
RadCad is giving an error if DIBUTIL is missing, so its necessary for the Pictures.
But: If i try to load a .bmp File into a new DAT the ResourceCompressor is going into error: "Error reading resource File"
See here: https://www.youtube.com/watch?v=myi9D7BlIdA
I tryed at least 30 different Pictureformats but i cant load any into a new WallBitmap.
The strange thing is, that i can load any other File without problems. All other Radix-Picture-File have they own header, at least 4 Byte with the height and width. And all of them i can load without problems into a new DAT-File.
One test i made was to load a Radix-Picture with header (like the main menu) into a WallBitmap. Than 3DResCmp is not going into Error, but Radix.exe tells me "Picture not supported" or something like that. Thats logical because a WallBitmap can maximal have the dimensions 128x128px and not 320x200px like the Menu.
RadCad is giving an error if DIBUTIL is missing, so its necessary for the Pictures.
But: If i try to load a .bmp File into a new DAT the ResourceCompressor is going into error: "Error reading resource File"
See here: https://www.youtube.com/watch?v=myi9D7BlIdA
I tryed at least 30 different Pictureformats but i cant load any into a new WallBitmap.
The strange thing is, that i can load any other File without problems. All other Radix-Picture-File have they own header, at least 4 Byte with the height and width. And all of them i can load without problems into a new DAT-File.
One test i made was to load a Radix-Picture with header (like the main menu) into a WallBitmap. Than 3DResCmp is not going into Error, but Radix.exe tells me "Picture not supported" or something like that. Thats logical because a WallBitmap can maximal have the dimensions 128x128px and not 320x200px like the Menu.