Page 1 of 4
Raw D2K Art
Posted: Sun Jan 23, 2011 8:32 pm
by chrisf
Contents of DATA.R8, as PNG8 with correct palette embedded[/url]
http://ijw.co.nz/d2kout.zip
Posted: Mon Apr 30, 2012 1:36 pm
by psydev
Thanks!
I am wondering, do you know of a way to convert these graphics to CNC / RA color palettes? I know a lot of them are bigger than 24x24, but a lot of them aren't, and could be resized/recentered.
And are there any more data files from Dune2K with art in them?
Posted: Mon Apr 30, 2012 5:19 pm
by BaronOfStuff
Oh, now this is good. Thanks for these, now I won't have to scrounge around cutting and pasting existing C&C units together like some sort of low-budget Frankenstein's Army.
psydev wrote:
I am wondering, do you know of a way to convert these graphics to CNC / RA color palettes? I know a lot of them are bigger than 24x24, but a lot of them aren't, and could be resized/recentered.
You can use the TD/RA palettes in Paint Shop Pro (or any other program supporting palettes), although at the moment it wouldn't translate the 'house remap' colour properly.
I guess I can attempt to create a JASC-format 'purple palette' (using roughly the same range of shades as the commonly-used
TD/RA conversion palettes by Nyerguds) so you can translate everything cleanly, but obviously you'd have to resize all the images you want to use yourself.

Dune2k SHPs
Posted: Tue May 01, 2012 12:36 pm
by Matt
Already created the windtrap (or at least tried to). It worked in the dev mod "palettetest" (from git) if you rename it as powr.shp and add it like the MCV you can replace the power plant in RA. However transparency at the borders did not work well. I did not use the RA.Utility.exe because I did not understand how it worked (seems you need to arrange the .pngs in a picture using a graphics program and then tell the commandline tool the right properties. But I won't recommend trying XCC Mixer and SHPbuilder either.
I found
http://ra.afraid.org/html/downloads/mods.html and extracted some .shps from some strange mod .mix files. The grey building animations looks a little adapted to RA. When I had a look at the original png files the Dune 2000 building animation is cracking out of the sand (even though you reinforced the ground with concrete plates...)
Edit: Removed the game files for copyright reasons.
R8Reader
Posted: Sat May 12, 2012 6:32 pm
by Matt
You can put the PNG pieces together to prepare for RA.Utilities.exe --SHP:
Code: Select all
convert {4109..4150}.png +append mcvdeploy.png
This requires ImageMagick (and a bash script that I will start working on right now).
I am currently working on a DATA.R8 parser because I don't think that uploading pre-converted Dune 2000 game files is legal.
https://github.com/Mailaender/OpenRA/commits/ I already fixed the error about stopping at Frame 1010. First it cropped the files ignoring the offset, now it aligns everything to the left using the full frame mimicking the PNGs in d2kout.zip However they are not correctly aligned. In DATA.R8 there is a offset field to position the image inside a virtual frame. I would be happy if someone tells me how to fix it. Notice the Debug messages and the unused variables StartX/Y, EndX/Y that I calculated from OffsetX/Y.
Posted: Sat May 12, 2012 6:50 pm
by Matt
However RA.Utility.exe fails:
Received args: --shp mcvdeploy.png 96
System.IO.EndOfStreamException: Failed to read past end of stream.
at System.IO.BinaryReader.ReadByte () [0x00000] in <filename unknown>:0
at OpenRA.FileFormats.Graphics.PngLoader.Load (System.IO.Stream s) [0x00000] in <filename unknown>:0
at OpenRA.FileFormats.Graphics.PngLoader.Load (System.String filename) [0x00000] in <filename unknown>:0
at OpenRA.Utility.Command.ConvertPngToShp (System.String[] args) [0x00000] in <filename unknown>:0
at OpenRA.Utility.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
Edit: This happens when not using compatible PNG files (8bit Indexed palette). Not a bug, just a very technical and hard to understand error message.
DATA.R8 -> PNG -> SHP working!
Posted: Sun May 13, 2012 5:58 pm
by Matt
I removed all the pre-converted SHPs of the original Dune 2000. For legal reasons I don't think we should supply ripped game files even though the game looks like abandonware. However my adapted RA.Utility.exe can now create SHPs from the Dune 2000 R8 game files.
https://github.com/Mailaender/OpenRA/co ... 7e8eb8ff95
It works like this (on Linux):
mono OpenRA.Utility.exe --r8 "/home/user/.openra/Content/d2k/DATA.R8" "mods/palettetest/d2k.pal" 1699 1730 "harvester" --transparent
mono OpenRA.Utility.exe --shp harvester.png 32
I will create a shell script / batch file (Windows) that automatizes this. However the offset is still ignored as it sometimes has negative values or the picture is set outside of the frame and I don't know how handle this at the moment (help appreciated).
Re: DATA.R8 -> PNG -> SHP working!
Posted: Mon May 14, 2012 4:08 am
by Sleipnir
Cmd. Matt wrote: ↑However the offset is still ignored as it sometimes has negative values or the picture is set outside of the frame and I don't know how handle this at the moment (help appreciated).
I hit the same issue with my original parser, which, combined with the legal issues you have already mentioned are why I abandoned my d2k efforts.
I had three thoughts on the problem, which I never followed up on:
- What happens if you increase the frame size to encompass these (seemingly) bogus offsets?
- Are the file format specs wrong? Perhaps the offsets mean something subtlety different from what we think?
- These offsets may be unused by the game, and there may be an offset table embedded elsewhere in the game data / exe
Posted: Mon May 14, 2012 7:05 pm
by Matt
Apart from the offset: the direction for moving vehicles is also wrong when I add the D2k trike or mcv to RA mod. Driving left and right backwards and hovering sidewards to the 45° angles. Mirroring the PNG won't help eather.
Posted: Mon May 14, 2012 11:00 pm
by Sleipnir
For some reason, they thought it appropriate to change the mapping between direction and frame. You will need to reverse and cycle the frame order, or (probably simpler in the long run) change the mapping used in the engine.
Posted: Thu May 17, 2012 2:56 am
by psydev
Are the offsets for each frame available somewhere in human-readable format?
Posted: Thu May 17, 2012 5:13 am
by katzsmile
Offsets for infantry frames is
OffsetX = frameWidth/2 - Width/2
OffsetY = frameHeight/2 - Height/2
Offset for vehicles and projectile frames is
OffsetX = frameWidth/2 - frameOffsetX
OffsetY = frameHeight/2 - frameOffsetY
Offset for buildings frames is
if (frameOffsetX < 0) { frameOffsetX = 0 - frameOffsetX; }
if (frameOffsetY < 0) { frameOffsetY = 0 - frameOffsetY; }
OffsetX = 0 + frameOffsetX
OffsetY = frameHeight - frameOffsetY
Posted: Thu May 17, 2012 10:59 am
by Matt
katzsmile wrote: ↑Offsets for infantry frames is
OffsetX = frameWidth/2 - Width/2
OffsetY = frameHeight/2 - Height/2
works:
http://content.open-ra.org/?p=detail&table=units&id=100
katzsmile wrote: ↑Offset for vehicles and projectile frames is
OffsetX = frameWidth/2 - frameOffsetX
OffsetY = frameHeight/2 - frameOffsetY
works:
http://content.open-ra.org/?p=detail&table=units&id=98
katzsmile wrote: ↑Offset for buildings frames is
if (frameOffsetX < 0) { frameOffsetX = 0 - frameOffsetX; }
if (frameOffsetY < 0) { frameOffsetY = 0 - frameOffsetY; }
OffsetX = 0 + frameOffsetX
OffsetY = frameHeight - frameOffsetY
works:
http://content.open-ra.org/?p=detail&table=units&id=99
Code:
https://github.com/Mailaender/OpenRA/co ... 6ad845446c
Thanks!
Posted: Thu May 17, 2012 12:48 pm
by Matt
Sleipnir wrote: ↑For some reason, they thought it appropriate to change the mapping between direction and frame. You will need to reverse and cycle the frame order, or (probably simpler in the long run) change the mapping used in the engine.
I didn't know where and how to change the mapping used in the engine and therefore reversed and cycled the frame order for vehicles.
Code is a little redundant and ugly, but it works (tested with palettetest mod). *yay* I think I can start creating the OpenD2k mod now or at least add the Dune 2000 units and buildings to the Red Alert mod. Arrakis.yaml is currently crashing the editor and I don't know how the map tiles where extracted, appended and scripted in the first place.
Posted: Thu May 17, 2012 4:48 pm
by Sleipnir
The arrakis tileset was created with the OpenRA.TilesetBuilder tool.
Up until the last time I looked (about a year ago) it was never very well supported (most of the ui was unfinished and nonfunctional) and it relied on hardcoded parameters in the source. Looking at the current code, this doesn't appear to have changed. I believe that katzsmile was working on a successor at one point, but don't know what happened with it.