The current URL is datacrystal.tcrf.net.
Mother 3/RAS block: Difference between revisions
(Created page with "==Overview== RAS is a block that's only used for the battle background data and entry tabl...") |
No edit summary |
||
Line 46: | Line 46: | ||
70 | <- ? ] {{color2|#000000|#F08080|[ H ]}} {{color2|#000000|#FFA07A|[ I ]}} [ ? ] {{color2|#000000|#ADD8E6|[ J ]}} {{color2|#FFFFFF|#00008B|[ K ]}} | 70 | <- ? ] {{color2|#000000|#F08080|[ H ]}} {{color2|#000000|#FFA07A|[ I ]}} [ ? ] {{color2|#000000|#ADD8E6|[ J ]}} {{color2|#FFFFFF|#00008B|[ K ]}} | ||
80 | {{color2|#FFFFFF|#006400|[ L ]}} {{color2|#FFFFFF|#8B0000|[ M ]}} {{color2|#FFFFFF|#B8860B|[ N ]}} {{color2|#FFFFFF|#483D8B|[ O ]}} [ ? ] | 80 | {{color2|#FFFFFF|#006400|[ L ]}} {{color2|#FFFFFF|#8B0000|[ M ]}} {{color2|#FFFFFF|#B8860B|[ N ]}} {{color2|#FFFFFF|#483D8B|[ O ]}} [ ? ] | ||
===Graphics/arrangement entries=== | |||
These values correspond to indices in the [[MOTHER_3:Battle_background_data_table|battle background data table]]. | |||
===Palettes=== | |||
Each layer has two palettes. Any references to higher palette numbers in the arrangement data should be ignored (binary-AND the palette number with 0x1). | |||
====Palette rotation==== | |||
The battle backgrounds have a feature which allows the palettes to cycle through colors. There are four known parameters: direction, start, end, and speed. | |||
The direction value isn't fully known. Known values are: | |||
{| | |||
|- | |||
| <tt>00</tt> = No rotation | |||
|- | |||
| <tt>01</tt> = Backwards | |||
|- | |||
| <tt>02</tt> = Forwards | |||
|- | |||
| <tt>03</tt> = Backwards | |||
|- | |||
| <tt>04</tt> = Backwards | |||
|- | |||
| <tt>05</tt> = No rotation | |||
|} | |||
The start and end values denote the range of cycled colors. Both values are inclusive. | |||
The delay value denotes how many frames of delay are in between each cycle. 0x01 means the shortest delay (0x00 will yield no apparent motion), and 0xFF means the longest delay. | |||
===Distortion paramters=== | |||
Each layer also has a number of distortion parameters to achieve various visual effects. One can calculate the horizontal and vertical offset of each scanline using the following approximate formula: | |||
Offset = (Velocity * Time / 256) + Amplitude * sin(360 * Wavenumber * ([Frequency * Time / 65536] + [Y / 256]) | |||
Where: | |||
* <tt>Offset</tt> is in pixels | |||
* <tt>Time</tt> is in frames | |||
* <tt>Y</tt> is the scanline number | |||
* <tt>sin</tt> is using degrees | |||
====Velocity==== | |||
Velocity controls how fast the layer moves in the X or Y direction. This value is signed: a positive value means right (for horizontal) or down (for vertical). | |||
====Amplitude==== | |||
Amplitude controls how far the distortion travels in the X or Y direction. This value is signed. | |||
====Wavenumber==== | |||
Wavenumber controls the spacial frequency of distortion. This value is signed. | |||
====Frequency==== | |||
Frequency controls how fast the distortion occurs over time. This value is signed. |
Revision as of 22:32, 15 July 2013
Overview
RAS is a block that's only used for the battle background data and entry tables. For consistency with the other named data structures, the format is explained on this page, rather than on the battle data pages.
Format
- 00-03 (04) = "ras " header
- 04-05 (02) = Number of layer entries
- 06-07 (02) = Number of master entries
- 08-.. (..) = Layer entries
- ..-.. (..) = Master entries
- ..-.. (04) = "~ras" footer
Layer entries
The layer entries immediately follow the 8-byte header. In the battle background data table, there are 0x222 layer entries. Each entry uses 144 (0x90) bytes. Each entry contains animation information for its associated battle background layer.
Layer entry format
- 00-01 (02) = [ A ] Graphics entry
- 02-03 (02) = [ B ] Arrangement entry
- 04-43 (40) = [ C ] Palettes (2)
- 44-45 (02) = [ D ] Palette rotation: direction
- 46-47 (02) = Unclassified data
- 48-49 (02) = [ E ] Palette rotation: starting index
- 4A-4B (02) = [ F ] Palette rotation: ending index
- 4C-4D (02) = [ G ] Palette rotation: iteration delay
- 4E-73 (26) = Unclassified data
- 74-75 (02) = [ H ] Horizontal velocity
- 76-77 (02) = [ I ] Vertical velocity
- 78-7B (04) = Unclassified data
- 7C-7D (02) = [ J ] Horizontal amplitude
- 7E-7F (02) = [ K ] Vertical amplitude
- 80-81 (02) = [ L ] Horizontal wavenumber
- 82-83 (02) = [ M ] Vertical wavenumber
- 84-85 (02) = [ N ] Horizontal frequency
- 86-87 (02) = [ O ] Vertical frequency
- 88-8F (08) = Unclassified data
Table view
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F +-------------------------------------------------------------------------------- 00 | [ A ] [ B ] [ C -> 10 | <- C -> 20 | <- C -> 30 | <- C -> 40 | <- C ] [ D ] [ ? ] [ E ] [ F ] [ G ] [ ? -> 50 | <- ? -> 60 | <- ? -> 70 | <- ? ] [ H ] [ I ] [ ? ] [ J ] [ K ] 80 | [ L ] [ M ] [ N ] [ O ] [ ? ]
Graphics/arrangement entries
These values correspond to indices in the battle background data table.
Palettes
Each layer has two palettes. Any references to higher palette numbers in the arrangement data should be ignored (binary-AND the palette number with 0x1).
Palette rotation
The battle backgrounds have a feature which allows the palettes to cycle through colors. There are four known parameters: direction, start, end, and speed.
The direction value isn't fully known. Known values are:
00 = No rotation |
01 = Backwards |
02 = Forwards |
03 = Backwards |
04 = Backwards |
05 = No rotation |
The start and end values denote the range of cycled colors. Both values are inclusive.
The delay value denotes how many frames of delay are in between each cycle. 0x01 means the shortest delay (0x00 will yield no apparent motion), and 0xFF means the longest delay.
Distortion paramters
Each layer also has a number of distortion parameters to achieve various visual effects. One can calculate the horizontal and vertical offset of each scanline using the following approximate formula:
Offset = (Velocity * Time / 256) + Amplitude * sin(360 * Wavenumber * ([Frequency * Time / 65536] + [Y / 256])
Where:
- Offset is in pixels
- Time is in frames
- Y is the scanline number
- sin is using degrees
Velocity
Velocity controls how fast the layer moves in the X or Y direction. This value is signed: a positive value means right (for horizontal) or down (for vertical).
Amplitude
Amplitude controls how far the distortion travels in the X or Y direction. This value is signed.
Wavenumber
Wavenumber controls the spacial frequency of distortion. This value is signed.
Frequency
Frequency controls how fast the distortion occurs over time. This value is signed.