Creating a new airplane resource file (.srf)

Please post here for questions and discussion about scenario design and general game modding.
Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

Creating a new airplane resource file (.srf)

Post by Unhappy »

Part 1. The Basics.

I’m far from an expert on this topic but this is what worked for me.

The resource file for an airplane is essentially an image file (such as .BMP, .JPG, .PNG etc). In CAW the dimensions of this image file are 512 (across) by 256 (high). On this image are six sections each containing an image of the airplane. They are:

• Section 1: A large profile (that appears at the bottom left of the carrier/airbase screen when an aircraft is selected)
• Section 2: A small profile (that appears at the bottom center of the screen during an airstrike)
• Section 3: A very small top-down image that represents the airplane when it is conducting an attack and also on the taskgroup screen etc.
• Section 4: A slightly offset shadow that accompanies the above image on the taskgroup screen, carrier/airbase screen etc.
• Section 5: A very small shadow that moves in tandem with the top-down image during attacks
• Section 6: A top-down ‘glow’ that surrounds the top-down image when it has the focus.

These six sections need to conform to certain size constraints and it is easiest to use a template to guide you as to the size and placement of each section.

So for example – the composite image with template (and sections indicated) looks something like this:


Image
Attachments
B17Ewith..sections.gif
B17Ewith..sections.gif (14.75 KiB) Viewed 805 times
Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

RE: Creating a new airplane resource file (.srf)

Post by Unhappy »

Part 2. Creating a Template

The first thing to do is create a template. Using image editing software that allows you to display a grid and shows coordinates will really help for this. For starters the image has to be 512 x 256. Also (as far as I can tell) – the background has to be a certain shade of purple. That color is treated as transparent by CAW and will not show up in game. In MS Paint it is one of the standard colors (bottom row - eighth one from the left) with a value of:

Hue: 200
Saturation: 240
Luminescence: 120
Red: 255
Green: 0
Blue: 255

Fill your entire image with that color of purple.

**** Note: Ryan has [using some arcane magic I don't understand] been able to replicate this effect of a transparent background by creating a multilayered image - please see his posts on the matter further along in this thread. ****

Next you have to add some lines. Any color that shows up on purple is fine for this (I chose yellow). You will delete the lines from completed images.

Add the following lines.

Horizontal
From 0, 151 to 255, 151
From 214, 186 to 354, 186

Vertical
From 214, 151 to 214, 255 (bottom)
From 249, 151 to 249, 186
From 284, 151 to 284, 186
From 319, 151 to 319, 186
From 354, 151 to 354, 186

Save your template – you may want to save a couple copies in case you accidentally mess one up during the subsequent steps.

Having done that you should end up with a template that looks like this:


Image
Attachments
PlaneTemplate.gif
PlaneTemplate.gif (1.94 KiB) Viewed 800 times
Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

RE: Creating a new airplane resource file (.srf)

Post by Unhappy »

Part 3. Filling in the six sections.

Next you have to create the large airplane profile. I looked on the internet for an image of the plane I was interested in. If you’re more artistic than I am you could create one yourself. Save the image file. Using your image editor of choice (I just use MS Paint because it is super easy to use) open the saved image.

Next rescale the image so that the airplane will fit comfortably inside an area 512 x 150 (see in the example from Part 1 that the large B-17 image is probably only 2/3rd that length or less)

Because the airplane picture is going to be overlayed on top of other graphics you have to eliminate any extraneous background clutter like clouds or stray pixels. Once you have done that copy the picture and paste it onto your template (in Section 1). It is easiest if you can paste it with a transparent (non-opaque) background but if the background comes with it just be sure to fill it in with the proper color of purple to match the rest of the template background. Do a ‘save as…’ with the name of the airplane.

At this stage the image may require some tweaking to remove any remaining stray pixels or resizing to get it to look ‘right.’ When you are happy with the large profile you can copy, paste and scale it down to about 40% of its original size to fit in the lower left hand section (Section 2) to form the smaller profile image.

Note that the large profile image (Section 1) often shows a large profile of the aircraft and another one or two small profiles to depict a squadron in flight.

On to the top-down images (beginning with Section 3). For Section 3 you may find a top down image of the airplane on the internet but keep in mind that most likely it will have to be scaled down rather severely to fit into a 34 x 34 space. I found that I ended up creating the topdown images myself (and not doing a great job of it). For the B-17E depicted here there was already a topdown image included in the game for the B-17D which I shamelessly copied and pasted. Unfortunately, I can’t be of much assistance in this regard – look at some of the topdown graphics for planes provided with CAW as a guide – you may even want to use some of them – 34 x 34 doesn’t offer much opportunity to make a highly detailed image.

For the large shadow (Section 4) it is a darkened silhouette of the topdown image. Its positioning is slightly offset down and to the right of the topdown image. In the game the topdown image is overlayed on top of the shadow so the shadow only appears below and to the right of the aircraft.

The small shadow (Section 5) is a very small and dark silhouette of the airplane. I find that it is about 50% as large as the topdown image. You do not need to position the small shadow precisely; just put it in the center of the section. The small shadow only appears during air attacks and moves along below and to the right of the topdown image to provide the impression that the plane is flying above the ships.

The ‘glow’ (Section 6) is a highlight that surrounds the top down image. I find it easiest to copy and paste the topdown image into this box and then trace around the outside of it. Make sure that the topdown image is positioned the same as in Section 3 or the ‘glow’ will end up in the wrong spot. Trace around the outside of the topdown image using white. The highlight will appear green in the game but use white for creating it here. Once you have your ‘glow’ erase the topdown image inside it returning it to the background purple color.

Finally, delete the lines that made up the template.

Save your file!!!

You are nearly finished creating your airplane resource file. All you have to do now is get it into CAW.

Now you should have something like the image below:


Image
Attachments
B17E.gif
B17E.gif (13.12 KiB) Viewed 782 times
Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

RE: Creating a new airplane resource file (.srf)

Post by Unhappy »

Part 4. Creating the .SRF file

Start CAW and go into the Editor.

Immediately select ‘Resources’ (Top left of screen, fifth button down)

Double-click on the ‘Planes’ folder in the file browser (Top left)

You are in the planes directory and scrolling through the file browser shows you all of the aircraft already modelled for the game.

Click on ‘Create Res File’ (Top of screen)

A window will pop up labelled ‘New Res File Name (.srf)’. Input a name for your airplane file. Make sure it is different from any of the existing names. Make sure you include the .srf file extension. Hit ‘OK’ and a window (‘Res File Created’) will pop up to tell you that you were successful. Click ‘OK’ to clear that window.

In the center browser box labelled ‘Resource Type’ select ‘Texture’.

Now you will see a screen that resembles the following (below). Don’t worry if some of the fields are already filled in or the text doesn’t match exactly – you are going to correct that in the following steps.


Image
Attachments
Capturecr..texture.jpg
Capturecr..texture.jpg (66.95 KiB) Viewed 780 times
Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

RE: Creating a new airplane resource file (.srf)

Post by Unhappy »

Part 5. Designating the texture

Designating the texture and sprites is a little tricky because you need to be precise. CAW uses naming conventions and if you mess them up then your resource file will not work.

In the ‘Texture Resource’ box (Right-hand side of screen) you need to type in the name of your airplane in the ‘Resource Name:’ field prefixed by the 3 characters ‘tex’ and NO space in between the prefix and the name (spaces within the name are ok).

For example: texflying fortress

Then click on the ‘Set Raw File’ button. A new window will pop up labelled ‘Select Texture File’. Navigate in this browser window to find your image file, select it and click ‘OK’.

You are returned to the primary window. The name of the raw file and its file size will appear in the ‘Texture Resource’ box.

Click on the ‘Add Resource’ button at the bottom of the ‘Texture Resource’ box. Several things happen. A window will pop up labelled ‘Success’ (which is very gratifying) – click ‘OK’ to clear the window. Also your composite airplane image will appear at the top of the screen. Finally, notice that in the ‘Resources’ browser on the left hand side of the screen that the resource name of your texture appears. For example in this case: ‘texflying fortress’.

You should see something like the following:


Image
Attachments
Capturete..created.jpg
Capturete..created.jpg (71.94 KiB) Viewed 777 times
Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

RE: Creating a new airplane resource file (.srf)

Post by Unhappy »

Part 6. Designating the sprites

Next you have to designate the sprites. There are 6 sprites each one corresponding to a section of your composite image. Each sprite uses a prefix AND a suffix that must be entered exactly when naming them. Also, for each sprite you need to include the coordinates that bound the sprite on the composite image (texture). Sounds tough but if you are careful you will have no trouble.

The same prefix is used for all six sprites, it is: spr

Each sprite uses a different suffix, the suffixes and the bounding coordinates of the corresponding sprite are indicated in the following chart:

**** NOTE: Ryan has put this into a much more legible format in the next message - sorry for my mess ****

Section Prefix Suffix Bounding Coordinates
1 spr profile 0, 1 to 512, 151
2 spr profilesingle 1, 151 to 214, 255
3 spr topdown 215, 152 to 249, 186
4 spr topdownshadowlarge 250, 152 to 284, 186
5 spr topdownshadowsmall 285, 152 to 319, 186
6 spr topdownglow 320, 152 to 354, 186

Note that there are no spaces included within the suffixes.

Alright. Time to designate the sprites.

In the ‘Resource Type’ box (center of the screen) select ‘Sprite’. The box on the right of the screen will change from the ‘Texture Resource’ box to the ‘Sprite Resource’ box. They are similar but the Sprite Resource box requires you to enter more information.

The same procedure is used for entering each of the sprites – just make sure you use the correct suffix and bounding coordinates. I’ll go over entering the profile sprite as an example.

In the ‘Resource Name:’ field type in the prefix, name of the airplane, and the suffix. Remember not to use spaces between the prefix and the name or the name and the suffix.

In the case of the profile sprite for this example it is: sprflying fortressprofile
Again, spaces within the name are ok. But NOT between the prefix and the name or the name and the suffix.

Next is the ‘Texture:’ field. Make sure it is the name of the texture you just created earlier; if it is not, type in the correct name of the texture. In this example the texture is: texflying fortress

Enter the bounding coordinates in the order: Left, Top then Right, Bottom. Use the chart for the coordinates – if you set up your template correctly then the coordinates are always the same.

In this example, for the profile sprite the coordinates are: Left: 0, Top: 1, Right: 512, Bottom: 151.

After you have entered the coordinates double check them then hit the ‘Add Resource’ button. Again several things will happen. A window will pop up labelled ‘Success’ click OK to clear that window. The large airplane profile (without the rest of the sections of the composite image) will appear at the top of the screen. If you have used the proper background color then you should not see the purple background, it has become transparent. Finally, again notice that your sprite has been added to the ‘Resources’ browser on the left hand side of the screen. You should be able to click and hold on your airplane profile and drive it around the screen noticing that it is the top layer graphic.

You should see something resembling the image attached.

You need to repeat this procedure five times to designate the remaining sprites. Follow the naming conventions! Use the information on the prefix, suffixes and bounding coordinates indicated above. Once you have entered the information for all six sprites you are done!!! The information is automatically saved. Leave this screen by clicking on the round button at the bottom left of the window. Have a beer!! (or your beverage of choice)


Image
Attachments
Capturepr..created.jpg
Capturepr..created.jpg (75.01 KiB) Viewed 779 times
User avatar
RyanCrierie
Posts: 1327
Joined: Fri Oct 14, 2005 7:15 am
Contact:

RE: Creating a new airplane resource file (.srf)

Post by RyanCrierie »

Easier Format:

spr profile

Left 0---------Right 512
Top 1---------Bottom 151

spr profilesingle

Left 1---------Right 214
Top 152---------Bottom 255

spr topdown

Left 215---------Right 249
Top 152---------Bottom 186

spr topdownshadowlarge

Left 250---------Right 284
Top 152---------Bottom 186

spr topdownshadowsmall

Left 285---------Right 319
Top 152---------Bottom 186

spr topdownglow

Left 320---------Right 354
Top 152---------Bottom 186
User avatar
RyanCrierie
Posts: 1327
Joined: Fri Oct 14, 2005 7:15 am
Contact:

RE: Creating a new airplane resource file (.srf)

Post by RyanCrierie »

I've created an AM-1 Mauler SRF, but I cannot get it to show up in the plane types section:

Here's the completed SRF


Image
Attachments
AM1Problem1.gif
AM1Problem1.gif (60.62 KiB) Viewed 783 times
User avatar
RyanCrierie
Posts: 1327
Joined: Fri Oct 14, 2005 7:15 am
Contact:

RE: Creating a new airplane resource file (.srf)

Post by RyanCrierie »

And here's the plane type screen:



Yet I cannot get it to show up

Image
Attachments
AM1Problem2.gif
AM1Problem2.gif (55.54 KiB) Viewed 782 times
Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

RE: Creating a new airplane resource file (.srf)

Post by Unhappy »

Ryan,

Thanks for putting the sprite data in a format that is easier to read - I intended for that mess to be a table put it didn't turn out right when I posted it.

As for why you are having trouble - you included a space between the "spr" and the name of your airplane. You must remove that space.

So for instance you should have "spram1 maulerprofile"

Fix the name of your sprites and it should work - don't forget to include the sprite topdownglow!!!!

P.S. - your Mauler looks great!
User avatar
RyanCrierie
Posts: 1327
Joined: Fri Oct 14, 2005 7:15 am
Contact:

RE: Creating a new airplane resource file (.srf)

Post by RyanCrierie »

Works now, but looks bad; I'm wondering if CAW allows for the use of alpha channels....
Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

RE: Creating a new airplane resource file (.srf)

Post by Unhappy »

Ryan, with that question you have jumped far beyond my knowledge of image files and image editors. What format did you use for the raw file (ex: .bmp, .jpg, .png)? I just stick with .bmp - the files are larger but they still seem to work ok.

How about a screenshot? Maybe you are just overly critical of your own work?
User avatar
RyanCrierie
Posts: 1327
Joined: Fri Oct 14, 2005 7:15 am
Contact:

RE: Creating a new airplane resource file (.srf)

Post by RyanCrierie »

YES! Figured out how to get transparencies working.

To do that, you will need a paint program which supports layers; like Photoshop or Paint Shop Pro; and place your artwork on a layer above the background layer. When you're done, simply delete the background layer; and then save it as a PNG with 16 million colors, and alpha channel transparency.

Image

That's what you want your final image to look like if you're using Paint Shop Pro before you save it as a PNG.
Attachments
FH1 Phantom.gif
FH1 Phantom.gif (26.76 KiB) Viewed 788 times
Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

RE: Creating a new airplane resource file (.srf)

Post by Unhappy »

Wow! I'm going to have to acquire and learn how to use some real image editing software. I've got GIMP but I have no idea how to use it. Maybe you can add your insights on using a multilayered image to create the raw image file on this thread or in a separate one - I'd be interested in reading it.

Thanks!
User avatar
RyanCrierie
Posts: 1327
Joined: Fri Oct 14, 2005 7:15 am
Contact:

RE: Creating a new airplane resource file (.srf)

Post by RyanCrierie »

And here we are!

Image
Attachments
FHIngame.gif
FHIngame.gif (89.7 KiB) Viewed 784 times
User avatar
RyanCrierie
Posts: 1327
Joined: Fri Oct 14, 2005 7:15 am
Contact:

RE: Creating a new airplane resource file (.srf)

Post by RyanCrierie »

ORIGINAL: Unhappy
I've got GIMP but I have no idea how to use it.

GIMP should be capable of doing this.
Maybe you can add your insights on using a multilayered image to create the raw image file on this thread or in a separate one - I'd be interested in reading it.

Kay, but it will take some time to do.
User avatar
RyanCrierie
Posts: 1327
Joined: Fri Oct 14, 2005 7:15 am
Contact:

RE: Creating a new airplane resource file (.srf)

Post by RyanCrierie »

Da da da doo daa da da

Image
Attachments
PhantomsCAW.gif
PhantomsCAW.gif (94.09 KiB) Viewed 783 times
Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

RE: Creating a new airplane resource file (.srf)

Post by Unhappy »

Ryan,

Now I'm just depressed...your images look far nicer than mine. I think we need a place to post .srf files so the 'community' will have access to these user created files (as long as people don't mind sharing). That way we could build up a large database of resource files and avoid replication of effort.
User avatar
RyanCrierie
Posts: 1327
Joined: Fri Oct 14, 2005 7:15 am
Contact:

RE: Creating a new airplane resource file (.srf)

Post by RyanCrierie »

Don't worry; I've had a LOT of experience with making graphics and related to game modding; I've done graphics for just about everything under the sun; and yes, we do need a SRF depository.
Post Reply

Return to “Mods and Scenarios”