Raw D2K Art

Information and discussion for custom maps and mods.
chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

Raw D2K Art

Post by chrisf »

Contents of DATA.R8, as PNG8 with correct palette embedded[/url]

http://ijw.co.nz/d2kout.zip

psydev
Posts: 84
Joined: Sat Mar 31, 2012 4:49 am

Post 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?

User avatar
BaronOfStuff
Posts: 438
Joined: Sun May 22, 2011 7:25 pm

Post 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. ;)

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Dune2k SHPs

Post 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.
Last edited by Matt on Sun May 13, 2012 5:46 pm, edited 1 time in total.

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

R8Reader

Post 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.

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post 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.
Last edited by Matt on Sun May 13, 2012 6:00 pm, edited 1 time in total.

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

DATA.R8 -> PNG -> SHP working!

Post 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).

User avatar
Sleipnir
Posts: 878
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Re: DATA.R8 -> PNG -> SHP working!

Post 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:
  1. What happens if you increase the frame size to encompass these (seemingly) bogus offsets?
  2. Are the file format specs wrong? Perhaps the offsets mean something subtlety different from what we think?
  3. These offsets may be unused by the game, and there may be an offset table embedded elsewhere in the game data / exe

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post 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.

User avatar
Sleipnir
Posts: 878
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post 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.

psydev
Posts: 84
Joined: Sat Mar 31, 2012 4:49 am

Post by psydev »

Are the offsets for each frame available somewhere in human-readable format?

User avatar
katzsmile
Posts: 39
Joined: Mon Sep 06, 2010 7:03 am
Location: Arkhangelsk
Contact:

Post 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

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post 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!

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post 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.

User avatar
Sleipnir
Posts: 878
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post 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.

Post Reply