Difference between revisions of "BLO file"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(Added info about how scrnblo2 works)
 
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
 
== Types of BLO ==
 
== Types of BLO ==
A blo file is used by several nintendo games such as Pikmin, Pikmin 2, Super Mario Sunshine, and Wind Waker to control screen data, such as which sprites appear and where. The main issue though, is that there are 3 types of blo, scrnblo1 (which Sunshine and Wind Waker use), scrnblo2 (which Pikmin 2 uses), and another format used by pikmin 1, sometimes called scrnblo0. There are several differences between them and they cant just be swapped. This page will focus on scrnblo2, so information here wont apply much for other blo types.
+
The <code>BLO</code> filetype is used by several Nintendo games such as ''Pikmin'', ''Pikmin 2'', ''Super Mario Sunshine'', and ''The Legend of Zelda: The Wind Waker'' to control screen data, such as which sprites appear and where. There are 3 main types of a blo file, <code>scrnblo1</code> (which ''Sunshine'' and ''Wind Waker'' use), <code>scrnblo2</code> (which ''Pikmin 2'' uses), and the format ''Pikmin'' uses, sometimes called <code>scrnblo0</code>. There are several differences between them and they are not interchangeable. This page will focus on <code>scrnblo2</code>, the flavour ''Pikmin 2'' uses.
  
 
== TEX1 ==
 
== TEX1 ==
Ther first main segment of a blo2 file, this is where the game loads bti textures in the "timg" folder of the screen data. You can change these names, and possibly add or remove entries. at 0x11 from the start of TEX1, is the number of textures to load, so remember that if you try it.
+
The first main segment of a <code>scrnblo2</code> file, this is where the game loads BTI textures in <code>/new_screen/*language*/*screen szs*/timg</code>. You can change the filenames of the textures to be loaded, and possibly add or remove entries. The number of textures to load is defined in a BE 32 bit integer 0x08 away from the sections magic <code>TEX1</code>.
  
 
== FNT1 ==
 
== FNT1 ==
This is very similar to the last segment, but for loading fonts. In Pikmin 2, this only ever loads piki2_font00.bfn which is strange as that is not the file name of the used font. I'm not exactly sure how this all works, but you shouldnt have to mess with it.
+
This section is dedicated to loading fonts, hence the name <code>FNT1</code>. In ''Pikmin 2'', this only ever loads <code>piki2_font00.bfn</code>.
  
 
== MAT1 ==
 
== MAT1 ==
This segment creates screen "objects" with internal names that the game uses to control them. Its by far the biggest segment of the blo, but most of it seems to be some sort of padding.The important part is where the names of the materials are listed. They always follow the naming convention of mat_name_v. Unfortunately, the developers didn't make the names easy to identify.
+
This section creates screen "objects" with internal names that the game uses to control them. Its by far the biggest segment of the <code>BLO</code>. The important part is where the names of the materials are listed. They always follow the naming convention of <code>mat_name_v</code>. The main makeup of this section is padding.
 +
 
 +
== PAN2 ==
 +
This section acts like a group, it holds many <code>PIC2</code> and <code>TBX2</code> segments together so you can easily move a whole object as one piece. There is always a <code>PAN2</code> section called <code>ROOT</code> in every <code>scrnblo2</code>, and sometimes more.
  
 +
* <code>0x12</code>: The name of the material.
 +
* <code>0x20</code>: 2 floats representing x and y size coordinates. Does nothing in PAN2.
 +
* <code>0x28</code>: 2 floats representing x and y scale. Often 1.
 +
* <code>0x3C</code>: 2 floats representing x and y coordinates, relative to parent PAN2.
  
== PAN2 ==
+
A PAN2 is like an opening curly bracket, everything after it will be a child of it, until you reach and "END1" command, which acts like the closing bracket. You can have PAN2 objects nested in other PAN2s as well.
This segment acts like a group, it holds many pic2and tbx2 segments together so you can easily move a whole object as one piece. There is always one called ROOT in every blo, and usually some more. Every PIC2 segment has "pan2" in it, so dont get confused by that. Here are offsets for stuff you can do with a PAN2 group.
 
<br />0x12 The name of the material being controlled.
 
<br />0x20 2 floats representing x and y something. Dont seems to do anything.
 
<br />0x28 2 floats representing x and y scale. Usually 1.
 
<br />0x3C 2 floats representing x and y coordinates relative to root.
 
<br />They seem to always end with a BGN1, but I'm not sure what its for.
 
  
 
== PIC2 ==
 
== PIC2 ==
This is very similar to the last segment, but for an individual sprite object. They are notably longer than PAN2 segments. You probably shouldn't change their parameters if you have the option to edit their whole PAN2 segment instead. Heres some info about them:
+
This is very similar to the last segment, but for an individual sprite object. They are notably longer than <code>PAN2</code> segments. You probably shouldn't change their parameters if you have the option to edit their whole <code>PAN2</code> segment instead. Here's some info about them:
<br />0x07 string for pan2, could be what connects the single pic2 to a pan2.
+
 
<br />0x19 Name of material being edited, its likes to have "RE" before it, but thats not part of the name.
+
* <code>0x07</code>: string saying <code>pan2</code>
<br />0x28 2 more floats, again not sure what they do.
+
* <code>0x19</code>: Name of material, it likes to have <code>RE</code> before it for some reason, but that's not part of the name.
<br />0x30 x and y scale
+
* <code>0x28</code>: x and y pixel dimensions.
<br />0x45 x and y coordinates relative to PAN2 entry
+
* <code>0x30</code>: x and y scale.
<br />After that is some data I dont get then a whole row of FFs.
+
* <code>0x45</code>: x and y coordinates relative to parent <code>PAN2</code> entry.
  
 +
After that is a whole row for the RGBA gradient colors for each corner of the sprite.
  
 
== TBX2 ==
 
== TBX2 ==
These are a lot like PIC2, and are also part of a PAN2. The difference is they write text using the loaded font.
+
These are a lot like <code>PIC2</code>, and are also part of a <code>PAN2</code>. The difference is they write text using the loaded font.
<br />0x07 string for pan2, could be what connects the single tbx2 to a pan2.
+
* <code>0x07</code>: string for <code>pan2</code>, could be what connects the single <code>tbx2</code> to a <code>pan2</code>.
<br />0x1A internal name of material being used.
+
* <code>0x1A</code>: internal name of material being used.
<br />0x21 text ID used. The developers like to put placeholder text IDs here when the screen could show multiple messages, so its only really works for fully static text.
+
* <code>0x21</code>: text ID used. The developers like to put placeholder text IDs here when the screen could show multiple messages, so it only really works for fully static text.
<br />0x27 x and y coordinates?
+
* <code>0x27</code>: x and y dimensions of containing box
<br />0x30 x and y scale
+
* <code>0x30</code>: x and y scale.
<br />0x43 more x and y stuff.
+
* <code>0x43</code>: x and y offset to parent.
<br />After that is some random data, followed by the text itself, in an early version where things like color and size change and text box terminators are called by their internal names. Can show early scripts of the games text in some areas.
+
 
 +
After that is some random data, followed by the text itself, in an early version where things like color and size change and text box terminators are called by their internal names. Can show early scripts of the games text in some areas.
 +
 
 +
== Colors ==
 +
{{todo|Cleanup. Also, what JSON is this referring to?}}
 +
There are three BLO colors for a single object, TevColors, MatColors and Color1 and Color2
 +
 
 +
TevColors are shown like this in the json:
 +
  "tevcolors": [
 +
    "00000000008c0000",
 +
    "00000000008c00ff",
 +
    "0000000000000000",
 +
    "0000000000000000"
 +
Colors here are Hex values, and each RGBA value has a "00" before each value, so "00ff00ff00ff00ff" is white. this colors the entire bti.
  
 +
MatColors are shown like this:
 +
  "matcolors": [
 +
    [
 +
      255,
 +
      255,
 +
      255,
 +
      2
 +
    ],
 +
    [
 +
      255,
 +
      255,
 +
      255,
 +
      255
 +
    ]
 +
I rarely see vanilla blo files use this aside from alpha values most of the time. Because I have rarely seen them, I assume this is for coloring the top and bottom of the bti respectfully.
  
== Ending ==
+
Color1 and Color2 are shown like this, and are located in the Pane section of an object, rather than the material section, unlike MatColors and TevColors
 +
  "color1": {
 +
      "unk1": 812,
 +
      "unk2": 813,
 +
      "unknowns": [
 +
        0,
 +
        0,
 +
        256,
 +
        0
 +
    ],
 +
      "col1": [
 +
        255,
 +
        255,
 +
        255,
 +
        255
 +
    ],
 +
      "col2": [
 +
        255,
 +
        255,
 +
        255,
 +
        255
 +
    ]
 +
  },
 +
  "color2": {
 +
      "unk1": 814,
 +
      "unk2": 815,
 +
      "unknowns": [
 +
        0,
 +
        256,
 +
        256,
 +
        256
 +
  ],
 +
      "col1": [
 +
        255,
 +
        255,
 +
        255,
 +
        255
 +
  ],
 +
      "col2": [
 +
        255,
 +
        255,
 +
        255,
 +
        255
 +
  ]
 +
These values color the top and bottom corners of the bti/object. col1 is for the left corners, and col2 is for the right corners, color1 is for the top corners, color2 is for the bottom corners
  
After the last PIC2 or TBX2 is multiple END1 and an EXT1 with padding to align it. If theres anything i need to correct, let me know on the Discord. Thanks for Reading! PikHacker
+
[[Category:File formats]]
 +
[[Category:Pikmin 2]]

Latest revision as of 17:32, 9 June 2024

Types of BLO[edit]

The BLO filetype is used by several Nintendo games such as Pikmin, Pikmin 2, Super Mario Sunshine, and The Legend of Zelda: The Wind Waker to control screen data, such as which sprites appear and where. There are 3 main types of a blo file, scrnblo1 (which Sunshine and Wind Waker use), scrnblo2 (which Pikmin 2 uses), and the format Pikmin uses, sometimes called scrnblo0. There are several differences between them and they are not interchangeable. This page will focus on scrnblo2, the flavour Pikmin 2 uses.

TEX1[edit]

The first main segment of a scrnblo2 file, this is where the game loads BTI textures in /new_screen/*language*/*screen szs*/timg. You can change the filenames of the textures to be loaded, and possibly add or remove entries. The number of textures to load is defined in a BE 32 bit integer 0x08 away from the sections magic TEX1.

FNT1[edit]

This section is dedicated to loading fonts, hence the name FNT1. In Pikmin 2, this only ever loads piki2_font00.bfn.

MAT1[edit]

This section creates screen "objects" with internal names that the game uses to control them. Its by far the biggest segment of the BLO. The important part is where the names of the materials are listed. They always follow the naming convention of mat_name_v. The main makeup of this section is padding.

PAN2[edit]

This section acts like a group, it holds many PIC2 and TBX2 segments together so you can easily move a whole object as one piece. There is always a PAN2 section called ROOT in every scrnblo2, and sometimes more.

  • 0x12: The name of the material.
  • 0x20: 2 floats representing x and y size coordinates. Does nothing in PAN2.
  • 0x28: 2 floats representing x and y scale. Often 1.
  • 0x3C: 2 floats representing x and y coordinates, relative to parent PAN2.

A PAN2 is like an opening curly bracket, everything after it will be a child of it, until you reach and "END1" command, which acts like the closing bracket. You can have PAN2 objects nested in other PAN2s as well.

PIC2[edit]

This is very similar to the last segment, but for an individual sprite object. They are notably longer than PAN2 segments. You probably shouldn't change their parameters if you have the option to edit their whole PAN2 segment instead. Here's some info about them:

  • 0x07: string saying pan2
  • 0x19: Name of material, it likes to have RE before it for some reason, but that's not part of the name.
  • 0x28: x and y pixel dimensions.
  • 0x30: x and y scale.
  • 0x45: x and y coordinates relative to parent PAN2 entry.

After that is a whole row for the RGBA gradient colors for each corner of the sprite.

TBX2[edit]

These are a lot like PIC2, and are also part of a PAN2. The difference is they write text using the loaded font.

  • 0x07: string for pan2, could be what connects the single tbx2 to a pan2.
  • 0x1A: internal name of material being used.
  • 0x21: text ID used. The developers like to put placeholder text IDs here when the screen could show multiple messages, so it only really works for fully static text.
  • 0x27: x and y dimensions of containing box
  • 0x30: x and y scale.
  • 0x43: x and y offset to parent.

After that is some random data, followed by the text itself, in an early version where things like color and size change and text box terminators are called by their internal names. Can show early scripts of the games text in some areas.

Colors[edit]

To do: Cleanup. Also, what JSON is this referring to?

There are three BLO colors for a single object, TevColors, MatColors and Color1 and Color2

TevColors are shown like this in the json:

 "tevcolors": [
   "00000000008c0000",
   "00000000008c00ff",
   "0000000000000000",
   "0000000000000000"

Colors here are Hex values, and each RGBA value has a "00" before each value, so "00ff00ff00ff00ff" is white. this colors the entire bti.

MatColors are shown like this:

 "matcolors": [
   [
     255,
     255,
     255,
     2
   ],
   [
     255,
     255,
     255,
     255
   ]

I rarely see vanilla blo files use this aside from alpha values most of the time. Because I have rarely seen them, I assume this is for coloring the top and bottom of the bti respectfully.

Color1 and Color2 are shown like this, and are located in the Pane section of an object, rather than the material section, unlike MatColors and TevColors

 "color1": {
     "unk1": 812,
     "unk2": 813,
     "unknowns": [
       0,
       0,
       256,
       0
   ],
     "col1": [
       255,
       255,
       255,
       255
   ],
     "col2": [
       255,
       255,
       255,
       255
   ]
 },
 "color2": {
     "unk1": 814,
     "unk2": 815,
     "unknowns": [
       0,
       256,
       256,
       256
 ],
     "col1": [
       255,
       255,
       255,
       255
 ],
     "col2": [
       255,
       255,
       255,
       255
 ]

These values color the top and bottom corners of the bti/object. col1 is for the left corners, and col2 is for the right corners, color1 is for the top corners, color2 is for the bottom corners