All pastes #1293572 Raw Edit

RA2/YR Structures: What are they

public html v1 · immutable
#1293572 ·published 2008-12-25 19:45 UTC
rendered paste body
    <p align="center"><span class="txt_body3">RA2/YR Structures: What are they?<br>    </span><i>by MooMan65. Published: 2/15/03. Last update: 3/10/03.</i>	</p><p>This tutorial describes the basic use of structures in the game, what the formatting of the files are that they use, and most importantly, how to add them into your own game so you can use them. The INI code which supports these new structures is not included here, and is beyond the scope of this article.	</p><p>Structures                are anything in the game that can be built from                the <b>Buildings</b> or <b>Armory</b>                tabs from the sidebar (as well as the many unbuildable                  structures in-game like civilian buildings). They are always stationary                images which make up your base and most maps with an urban                  setting. Each structure                usually has a specific purpose in the game                whether it be to construct units, provide power, protect your                  base or simply to establish the appropriate atmosphere in a                  map. The classifications                  'structure' also covered overlay-based structures                like Walls and Pavement, they behave differently                in-game, but still have the basic ground rules                for every other structure.	</p><p>The                standard file format used by structures is the                almighty .SHP file. These are kind of like                archived of one or multiple .PCX images (not                compressed) contined within the one file. This is                very useful as, being a 2D game, Red Alert                2/Yuri's Revenge use a lot of standard images.                Structures can also use .VXL (or Voxel) and .HVA                files also, they are used for structures with                turrets like the Sentry Gun. Voxel files were                introduced in Tiberian Sun to somewhat add a                crude 3D element into a standard 2D game.	</p><p>Structures                usually use a standard naming configuration for                its .SHP files to make it both easy on modder and                player. If you have downloaded any structures now                and looked at their files you should see what                looks like at first glace a bunch of random                letters making up the name. Well actually there                is a reason why it's laid out like that. Here's                some examples below:	</p><p align="center">GACNST.SHP<br>NAMISL_A.SHP<br>YAPOWRMK.SHP	</p><p>Let's                color-code it so it's split up into the                categories that mean something, the first three                color codes are required by all filenames, but                some files also contain certain things after the                third colour:	</p><p align="center"><b><span class="txt_body1a"><font color="#ff0000">G</font><font color="#ff8000">A</font><font color="#ffff00">CNST</font><font color="#00ff00">??</font></span>.SHP</b>                </p><ul>                    <li><span class="txt_body1a"><b><font color="#ff0000">G</font></b></span> - This first                        letter tells you which side the structure                        is available to. You have a choice                        between:<br>                        G- Allies<br>                        N - Soviets<br>                        Y - Yuri<br>                        C - Civilian<br>                      <b>Note:</b> G                        and N are named the way they are from GDI                        and Nod from Tiberian Sun when they first                        introduced this naming convention,                        Westwood Pacific (later became EA                        Pacific), did not bother to remove those                        two and kept them for when they modified                        the Tiberian Sun engine into Red Alert 2.<br>&nbsp;                    </li>                    <li><span class="txt_body1a"><b><font color="#ff8000">A</font></b></span> - The second                        letter tells you what theater the .SHP                        file should be displayed in. By theater I                        mean the climate of the map you are                        playing, whether it be Temperate, Snow, Desert etc. The possible letters are below:<br>                      G                        - Default<span class="txt_body1a"><font color="#ff0000">*</font></span><br>                        T - Temperate<br>                        A - Snow (Artic)<br>                        U - Urban<br>                      <em>The                        following are for Yuri's Revenge only:<br>                        </em>D - Desert<br>                        N - NewUrban<br>                        L - Lunar<br>                        &nbsp;<br>                      <span class="txt_body1a"><font color="#ff0000">*</font></span>Default is used whenever a                        specific theater file is not found for                        the map. So for example if a structure                        includes GG and GA groups of images, it                        will use the GA ones specifically on Snow                        maps, and GG everywhere else since there                        are no specific images for them. Usually                        those two are the only types of theater                        names you need, as there normally is no                        difference in building appearance for the                        rest of the theaters (saves space as well                        on your Hard Drive). However some                        structures, especially civilian and tech                        buildings, leave rubble behind which that                        image is specific to the theater, and so                        you need all theater names covered.<p></p>                    </li>                    <li><span class="txt_body1a"><b><font color="#ffff00">CNST</font></b></span> - The last                        critical part of the filename is usually                        a four letter code that tells you what                        structure it is. This code is also used                        for the ARTMD.INI entry to tell the game                        that this entry are for these group of                        images. CNST in this case stands for                        Construction Yard. So from the current                        information we know that this file                        contains the Snow images for the Allied                        Construction Yard!<p></p>                    </li>                    <li><span class="txt_body1a"><b><font color="#00f000">??</font></b></span> - On some files                        as part of the structure package there                        are certain suffix's after the main code.                        While we know those three terms above                        will give you the structure information                        for every theater in the game, there                        still are other files involved in                        structures such as animations, bibs and                        buildups. This suffix tells you and the                        game what the file is used for, and then                        should be called in the ARTMD.INI file                        for that structure for it to be used                        in-game. The list of possible suffix's                        are below:<br>                      _?                        - Animations (the ? can be a latter                        usually from A to E but there are special                        cases which you can look for yourself.)<br>                        MK - Buildup (this is reserved for the                        buildup animation of the structure when                        it is placed down on the map.)<br>                        BB - Bib (some structures use bibs                        so parts of the structure are considered                        flat and can be moved across by units.                        This includes the Service Depot's Pad and                        Airforce Command HQ's pads.)<br>                        Of course these are simply the naming                        criteria used in the majority by                        Westwood/EA. You can actually do whatever                        suffix's you want, as long as you call                        them properly through the ARTMD.INI file.                        I tell you this as it's much easier for                        everyone to continue the trend. All my                        structure downloads here on MODDEN use                        this system, and most other people do to.                    </li>                </ul>    <p>I                said before that .SHP files are a collection of                one or multiple .PCX files, so why multiple?                Well, each .SHP file contains all the images                needed for a specific purpose, such as an                animation. Think of .SHP's as animated .GIF                files, although the game is sophisticated enough                to know when the .SHP file should be looping on                simply to display one of the images contained in                the .SHP on the screen. Overall there are three                kinds of .SHP files relating to structures.                </p><ul>                    <li><b>Animations:</b>                        Animation .SHP's are like animated                        .GIF's, they contain multiple images                        that, when looping, it looks like part of                        the structure is doing its 'stuff'. The                        ARTMD.INI file tells the game what image                        range to use inside the animation file                        for a specific animation of the                        structure. Meaning multiple animations                        can be read from the same .SHP file. This                        is most commonly done when the structure                        is at half health (the building becomes                        damaged). Usually an animation .SHP                        contains the images needed for the                        non-damages state of the structure,                        followed by the half-damaged, and finally                        the shadow frames for both sets of                        animations. The ARTMD.INI then tells the                        game which range of frames to use. eg.                        Animation A has 100 images inside it, 50                        of those imags are shadows and 50 are the                        animation itself. 25 out of the first 50                        are for the non-damaged animation, the                        next 25 for the damaged animation, the                        following 25 are the shadows for the                        non-damaged animation, and the last 25                        are shadows for the damaged animation.                        Shadows are called for automatically from                        the game, so the first 25 frames will                        automatically use the first 25 frames of                        shadows if you tell the game that the                        specific animation has shadows.<br>&nbsp;</li>                    <li><b>Object:</b>                        Next are object .SHP files. These include                        normal structure images and bibs. Object                        files only tell the game to display one                        frame of itself at a certain point in                        time, it is not meant to be an animation.                        Again there is an order to which the                        frames should be in so the game displays                        the correct image at the right time.<br>                      Frame                        1 - Normal Image (this image is displayed                        as the standard non-damages structure                        image when you first build it.)<br>                        Frame 2 - Damages Image (contains the                        image of the same structure when damaged                        at half strength.)<br>                      Frame 3<span class="txt_body1a"><font color="#ff0000">*</font></span> - Garrison                        Image                        (Frame 3 is used for when the structure                        is garrisoned by infantry units. However                        for structures that don't normally allow                        garrisonning, like player structures,                        usually have a duplicated Frame 2 in this                        frame.)<br>                      Frame 4<span class="txt_body1a"><font color="#ff0000">**</font></span> -                        Debris Image (If the structure is                        designed to leave behind debris this is                        the frame that the graphics go in.                        Structures that don't leave debris omit                        this frame entirely.)<br>                        Finally, the last 3 or 4 frames                        (depending on if you have a Frame 4 or                        not) contains the shadows for each stage.                        Frame 1 uses the first shadow image while                        Frame 2 uses the second and so forth.<br>&nbsp;<br>                      <span class="txt_body1a"><font color="#ff0000">*</font></span>Bib object images do not                        contain this frame at all.<br>                      <span class="txt_body1a"><font color="#ff0000">**</font></span>You should notice that the                        debris frame is usually a mess of strange                        colours, that is because the image is in                        a different palette to the standard                        structure one. It is in the palette of                        the specific theater, hence why                        structures with debris need every single                        theater file called for, and not simply                        to use the global G one.<br>&nbsp;</li>                    <li><strong>Overlay:</strong>                        Finally we have Overlay .SHP's, which                        include Walls. Since Pavement does not                        exist in RA2/YR I will only cover walls                        in this section. There actually are not                        too many third-party downloads of extra                        overlay .SHP's so you may not have to                        deal with these much. Overlay files are                        somewhat a mixture between the two above,                        it contains multiple images like the                        Animation, but only displaying one                        normally like an Object. The best way to                        look at these is to use examine an                        existing wall .SHP image. It contains                        images for every possible corner and                        straight piece for it as well as damages                        and shadow frames as normal. Overlays are                        a bit tricky to add, since they involve ToOverlay= art logic, so I won't be                        covering them with this tutorial.</li>                </ul>    <p>You                should now be completly familiar with the layout                and reasons behind what structures are and what                files and graphics make them what they are. I'm                sure advanced modders knew all about this from                the beginning, but basic tutorials are that get                new modders to work hard.	</p>