Brlan RLTP

From WADder Wiki

Jump to: navigation, search

Contents

Introduction

If you're not familar with brlan/brlyt and xmlan/xmlyt then it is worth reading Editing_Banners_with_Benzin. RLTP tags within a xmlan file allows more traditional animation where multiple images are quickly displayed in succession creating the impression of animation. The following was discovered through inspection of the Crystal Defenders banner.

RLTP xmlan Example

The following xmlan file achieves this and is marked up with comments denoted by #

<?xml version="1.0"?>
   <xmlan version="1.1.317BETA" framesize="460" flags="01">
       <timg name="AnimFrame0000.tpl" /> #only the first frame is referenced in the brlyt, it is also listed here with the rest.
       <timg name="AnimFrame0001.tpl" /> #they do not need numbers at the end, but clearly this makes it easier
       <timg name="AnimFrame0002.tpl" /> #while it's not explicit in the xmlan each of these has been given a reference number
       <timg name="AnimFrame0003.tpl" /> #the number is in hex, starting at 0, i.e. 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,11,...
       <timg name="AnimFrame0004.tpl" />
       <timg name="AnimFrame0005.tpl" />
       <timg name="AnimFrame0006.tpl" />
       <timg name="AnimFrame0007.tpl" />
       <timg name="AnimFrame0008.tpl" />
       <timg name="AnimFrame0009.tpl" />
       <timg name="AnimFrame000A.tpl" />
       <timg name="AnimFrame000B.tpl" />
       <pane name="AnimPicture" type="0">
           <tag type="RLVI">                              #this tag states whether to display / hide this animation.  It is hidden by default so this must be used and set to 0001 to show it at all.
               <entry type="X Translation">
                   <pair>
                       <data1>0.000000000000000</data1>   #at frame 0
                       <data2>0000</data2>                #hide the animation, 0=hide, 1=show
                       <padding>0000</padding>            #unknown purpose? always 0?
                   </pair>
                   <pair>
                       <data1>200.000000000000000</data1> #at frame 200
                       <data2>0001</data2>                #show the animation
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       <data1>260.000000000000000</data1> #at frame 260
                       <data2>0000</data2>                #hide the animation
                       <padding>0000</padding>
                   </pair>
               </entry>
           </tag>
       </pane>
       <pane name="AnimMaterial" type="1">
           <tag type="RLTP">                              #this tag cycles through the images
               <entry type="X Translation">               #this description is inaccurate in benzin but it does not cause an issue
                   <pair>
                       <data1>200.000000000000000</data1> #Frame Number.  Means... at frame 200
                       <data2>0000</data2>                #Image Index Number.  Means... show the first image from the list at the top (it has internal reference 0000, this is - AnimFrame0000.tpl
                       <padding>0000</padding>            #(not from file name, from referencing implicit in the xmlan)
                   </pair>
                   <pair>
                       <data1>205.000000000000000</data1> #at frame 205
                       <data2>0001</data2>                #Image Index Number.  Means... show the second image from the list at the top (it has internal reference 0001, this is - AnimFrame0001.tpl
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       <data1>210.000000000000000</data1>
                       <data2>0002</data2>
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       <data1>215.000000000000000</data1>
                       <data2>0003</data2>
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       <data1>220.000000000000000</data1>
                       <data2>0004</data2>
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       <data1>225.000000000000000</data1>
                       <data2>0005</data2>
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       <data1>230.000000000000000</data1>
                       <data2>0006</data2>
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       <data1>235.000000000000000</data1>
                       <data2>0007</data2>
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       <data1>240.000000000000000</data1>
                       <data2>0008</data2>
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       <data1>245.000000000000000</data1>
                       <data2>0009</data2>
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       <data1>250.000000000000000</data1>
                       <data2>000a</data2>
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       <data1>255.000000000000000</data1>
                       <data2>000b</data2>
                       <padding>0000</padding>
                   </pair>
               </entry>
           </tag>
       </pane>
   </xmlan>

Updates for Benzin

These updates are for the Benzin team if they are reading. Alsom a big thank you for your excellent work.

       <pane name="AnimMaterial" type="1">
           <tag type="RLTP">
               <entry type="X Translation">
                   <pair>
                       <data1>220.000000000000000</data1>
                       <data2>0004</data2>
                       <padding>0000</padding>
                   </pair>
  • "X Translation" is not the correct description in this instance. The information within the tags describes animated frames.
  • <data1> should be <frame>
  • <data2> should be something like <image number> or <image index>


       <pane name="AnimPicture" type="0">
           <tag type="RLVI">                              
               <entry type="X Translation">
                   <pair>
                       <data1>0.000000000000000</data1>   
                       <data2>0000</data2>                #hide the animation, 0=hide, 1=show
                       <padding>0000</padding>
                   </pair>
  • "X Translation" is not the correct description in this instance. The information within the tags describes whether to show or hide a picture.
  • <data1> should be <frame>
  • <data2> should be something like <show>. 1 is show, 0 is hide

Matching xmlyt example

The correspond brlyt is:

<?xml version="1.0"?>
   <xmlyt version="1.1.317BETA">
       <tag type="lyt1">
           <a>01</a>
           <size>
               <width>832.000000</width>
               <height>456.000000</height>
           </size>
       </tag>
       <tag type="txl1">
           <entries>
               <name>AnimFrame0000.tpl</name>
           </entries>
       </tag>
       <tag type="mat1">
           <entries name="AnimMaterial">
               <colors>
                   <forecolor>0</forecolor>
                   <forecolor>0</forecolor>
                   <forecolor>0</forecolor>
                   <forecolor>0</forecolor>
                   <backcolor>255</backcolor>
                   <backcolor>255</backcolor>
                   <backcolor>255</backcolor>
                   <backcolor>255</backcolor>
                   <unk2>255</unk2>
                   <unk2>255</unk2>
                   <unk2>255</unk2>
                   <unk2>255</unk2>
                   <tev_k>0xffffffff</tev_k>
                   <tev_k>0xffffffff</tev_k>
                   <tev_k>0xffffffff</tev_k>
                   <tev_k>0xffffffff</tev_k>
               </colors>
               <flags>00000111</flags>
               <texture name="AnimFrame0000.tpl">
                   <wrap_s>00</wrap_s>
                   <wrap_t>00</wrap_t></texture>
               <tex_coords>
                   <x1>0.0000000000</x1>
                   <y1>0.0000000000</y1>
                   <angle>0.0000000000</angle>
                   <x2>1.0000000000</x2>
                   <y2>1.0000000000</y2></tex_coords>
               <ua3>
                   <data>01</data>
                   <data>04</data>
                   <data>1e</data>
                   <data>00</data>
               </ua3>
           </entries>
       </tag>
       <tag type="pan1" name="RootPane">
           <flags>01-04</flags>
           <alpha>ff-00</alpha>
           <coords>
               <x>0.00000000000000000000</x>
               <y>0.00000000000000000000</y>
               <z>0.00000000000000000000</z>
           </coords>
           <flip>
               <x>0.00000000000000000000</x>
               <y>0.00000000000000000000</y>
           </flip>
           <rotate>0.00000000000000000000</rotate>
           <zoom>
               <x>1.0000000000</x>
               <y>1.0000000000</y>
           </zoom>
           <size>
               <width>832.000000</width>
               <height>456.000000</height>
           </size>
       </tag>
       <tag type="pas1" />
       <tag type="pic1" name="AnimPicture">
           <flags>00-04</flags>
           <alpha>ff-00</alpha>
           <coords>
               <x>0.00000000000000000000</x>
               <y>50.00000000000000000000</y>
               <z>0.00000000000000000000</z>
           </coords>
           <flip>
               <x>0.000000</x>
               <y>0.000000</y>
           </flip>
           <rotate>0.000000</rotate>
           <zoom>
               <x>1.0000000000</x>
               <y>1.0000000000</y>
           </zoom>
           <size>
               <width>128.000000</width>
               <height>128.000000</height>
           </size>
           <material name="AnimMaterial" />
           <colors>
               <vtx>0XFFFFFFFF</vtx>
               <vtx>0XFFFFFFFF</vtx>
               <vtx>0XFFFFFFFF</vtx>
               <vtx>0XFFFFFFFF</vtx>
           </colors>
           <coordinates>
               <set>
                   <coord>0.000000</coord>
                   <coord>0.000000</coord>
                   <coord>1.000000</coord>
                   <coord>0.000000</coord>
                   <coord>0.000000</coord>
                   <coord>1.000000</coord>
                   <coord>1.000000</coord>
                   <coord>1.000000</coord></set></coordinates>
       </tag>
       <tag type="pae1" />
       <tag type="grp1" name="RootGroup" />
   </xmlyt>

Applying this to other base wads

Given this it should be a relative simple process to take an image in any other wad and add frames to it. If the other tags in the base wad xmlyt are left alone then the image will still move around as before, just it will cycle through the frames. It should be a case of:

  • No change to the brlyt
  • Listing the images near the top of the xmlan file, in the form: <timg name="ImageName.tpl" />
One of these must be the image that is already in the brlyt
  • Adding the following:
       <pane name="AnimMaterial" type="1">
           <tag type="RLTP">                             
               <entry type="X Translation">
                   <pair>
                       <data1>200.000000000000000</data1>
                       <data2>0000</data2> 
                       <padding>0000</padding>
                   </pair>
                   <pair>
                       # repeat lots of pairs here, data1 = frame number, data2 = image index.  I recommend having a new pair every 5 frames and data1 should start at 0 and got the end (end = framesize specified at the top of the xmlan)
                   </pair>
               </entry>
           </tag>
       </pane>
*<pane name="AnimMaterial" type="1"> needs to match the relevant material name already in the brlyt. In the xmlyt it will look something like: <material name="AnimMaterial" /> and will be within <pic1> tags
*Clearly there will need to be more "pairs" which specify the other image index numbers (in hex) and the frame number at which that image index will be displayed
  • need to pack the new images into the wad alongside the old ones, dimensions should be the same as the original image.
*The "framesize" data at the top of the xmlan will need careful consideration to make this work. It may be necessary to repeat the data within the RLTP tags to ensure that the image keeps cycle for the duration of the animation loop. For example if the framesize is 240, but it only takes 60 frames to cycles through the images it will be necessary to repeat the RLTP pairs 4 times in order to fill up the space.

Sample WAD

Pending, previous one got deleted :(

Excel Animation Calculator - Aniimator

Excel spreadsheet to help write the cell animation part of the XMLAN. You need to understand this part of the XMLAN before this is useful, but after that it will save hours.

http://spreadsheets.google.com/ccc?key=r3EQA6W69jlbqfea-g2blcg (This is editable to make it useable, please don't trash it! Improvements and instructions are welcome!)

Personal tools