OpenRA uses the .SHP format from C&C and Red Alert. But there probably exist more fan-made .SHP files in Red Alert 2’s fan communities than for the original, even though only their infantry still use this format (vehicles use a voxel format). So that leaves a lot of potentially untapped art for us to dip in to! But there are technical hurdles to using them: the color palettes are different from those SHPs and they are not compatible with OpenRA. Units are also larger than C&C / Red Alert’s. Neither is the infantry’s animation frames in the same order. So what to do? Let me give you this quick guide to moving units from Tiberian Sun / Red Alert 2 / Yuri’s Revenge into a format readable from OpenRA!
Step 1. Pick a unit to import.
There are many resources on the web. One place with a lot of user-generated SHPs is YR Argentina. You can also download the original Tiberian Sun data files. You can also try ModDB, Project Perfect Mod, and Sleipnir’s Stuff; I’m sure there are far more sites out there.
Step 2. Extract frames from the .SHP into images
The method I use to extract the images I want from the .SHP is Open Source Ship Builder. By going to File Menu, Export, SHP->Images you can extract each frame from the .SHP file and into many .PNG images. The command-line program OpenRA.Utility also lets you extract the frames from .SHPs, but it can only output them to a single image containing all the frames, which can be a hinderance in steps 3.5 and 4 (color replacements and scaling).
The .SHPs in Tiberian Sun / RA 2 frequently have a night-time/daytime version of the same unit. For infantry, typically the first half, 292 frames, are day and the second set of 292 are night, giving a total of 484. Since there is no night-time in OpenRA we can remove the second half of frames.
Step 3. Convert “team colors” into the ones you want.
This post has instructions on converting team colors quickly from one game into another, as well as scripts to automate the process.
Color palettes on units have 16 colors set aside to be your “team colors”. They vary from game to game. I have made some scripts that allow you to convert those team colors quickly so that you can import units from one game to another with minimum of hassle.
In C&C and Red Alert, team colors are yellowish, are are then converted into whatever team color you choose for a multiplayer game.
The “team colors” indicators for Tiberian Sun / Red Alert 2 are red, requiring conversion:
Step 3.5 - fixing up minor blemishes (optional)
A problem with infantry from RA 2/TS is that they use two of the team color reds for muzzle flashes and blood. For this reason, the brightest color of the team colors palette is not changed by my script by default (the line for that color is commented out). If you want to be careful to not alter those colors, move the shooting/blood frames to another folder while you use the script to convert the bright red color in the rest of the frames (uncomment the top line of the script). (Blood and shooting animations for RA2 infantry are usually found between frames 134 and 259). If you do this, when you run the team color conversion script for the shooting / blood frames, you can also comment out the lines for color #a89854 from the script. Any remaining red dots of those two colors in the shooting or blood frames can be edited by hand.
If you’re lazy, the blemishes from the commented-out bright red will be barely visible, if at all, after you scale down your unit. Changing the darker red color found in muzzleflash to a team color is generally hardly noticeable, and it’s usually fine if you just convert it to a team color for all the frames. The Jump Jet Infantry is an exception to this rule, where the dark red is a bit more prominent in the muzzle flash.
To see what I’m talking about, behold the colors that are conflicted.
Notice also that the gun for this Ghost Stalker unit is the same dark red, even thought it is supposed to appear as the team’s color. For this reason I chose to be lazy and convert all the dark reds to team colors, even though a few pixels from the muzzle flash were also changed.
4. Resizing / scaling your unit.
Read this post for instructions on resizing / scaling your unit for OpenRA.
5. Re-package back into a .SHP file