User Tools

Site Tools


sm:technical_information:room_data_format

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sm:technical_information:room_data_format [2024/11/14 22:01] felixwrightsm:technical_information:room_data_format [2024/11/14 22:03] (current) felixwright
Line 1: Line 1:
-Room associated data and it's format+====== Room associated data and it's format ======
  
-Room Header+===== Room Header =====
  
 The room header is a long string of hex values which contains all of the data required for rooms to be displayed and function properly within the game and, likewise, SMILE. This page will aim to show you how the data is structured and how to make additional pointers and room headers (though in a less direct manner). You'll need some basic understanding of how to use a hex editor and remember that any and all addresses in this document will be in an unheadered ROM. Also of note, I will also be using SMILE 2.5 while writing this. The room header is a long string of hex values which contains all of the data required for rooms to be displayed and function properly within the game and, likewise, SMILE. This page will aim to show you how the data is structured and how to make additional pointers and room headers (though in a less direct manner). You'll need some basic understanding of how to use a hex editor and remember that any and all addresses in this document will be in an unheadered ROM. Also of note, I will also be using SMILE 2.5 while writing this.
Line 39: Line 39:
 This first 9 bytes (05 00 26 00 08 06 90 A0 00) are known as the room's properties and can be edited in SMILE 2.5 by going to “Edit > Room Properties.” E6 E5 tells the game which data to use for what roomstate. In our current example, this room only has one state and that's what we'll work with for now (I'll get to multi-state rooms later). The “tileset used, Music: Collection,” and “Music: Play” can all be edited directly in the main SMILE window off to the right under the “Other” tab (also located under where you'd select rooms). “Layers 2 Scrolling” is editable in Tools > Background Editor > BG Layer 2/SCROLLING. Everything else is editable via the pointers window (Edit > Pointers). This first 9 bytes (05 00 26 00 08 06 90 A0 00) are known as the room's properties and can be edited in SMILE 2.5 by going to “Edit > Room Properties.” E6 E5 tells the game which data to use for what roomstate. In our current example, this room only has one state and that's what we'll work with for now (I'll get to multi-state rooms later). The “tileset used, Music: Collection,” and “Music: Play” can all be edited directly in the main SMILE window off to the right under the “Other” tab (also located under where you'd select rooms). “Layers 2 Scrolling” is editable in Tools > Background Editor > BG Layer 2/SCROLLING. Everything else is editable via the pointers window (Edit > Pointers).
  
-Room Properties+===== Room Properties =====
  
 Room properties define the physical characteristics of a room. Their area sub-map, width and height, and location on the mini-map are the major values that typically get edited. Additional, less impactful values are the up and down scroller, room index, and special graphics bitflag. *All* of these specific values can be edited in the Room Properties menu in SMILE rather than having to change them in hex. Room properties define the physical characteristics of a room. Their area sub-map, width and height, and location on the mini-map are the major values that typically get edited. Additional, less impactful values are the up and down scroller, room index, and special graphics bitflag. *All* of these specific values can be edited in the Room Properties menu in SMILE rather than having to change them in hex.
Line 53: Line 53:
   00 - Special graphics bitflag   00 - Special graphics bitflag
  
-Room Index+==== Room Index ====
  
 This is simply the number a room is given inside the game and and doesn't have any major effect on the room itself. Think “Crateria room #1, Crateria room #2, Crateria room #3, etc.” However, certain numbers in certain areas can have an affect on the footstep effects for the room (like the splashes Samus leaves when walking above water in specific rooms). This is simply the number a room is given inside the game and and doesn't have any major effect on the room itself. Think “Crateria room #1, Crateria room #2, Crateria room #3, etc.” However, certain numbers in certain areas can have an affect on the footstep effects for the room (like the splashes Samus leaves when walking above water in specific rooms).
  
-Room Area+==== Room Area ====
  
 Tells the game which sub-map/area the room is to be located in. This determines various FX that can be used in the room depending on the area such as the heat bit (which causes heat damage without Varia Suit) only being able to be set in Norfair and Tourian (where it is unused by default). A list of values pertaining to each area are found below. Tells the game which sub-map/area the room is to be located in. This determines various FX that can be used in the room depending on the area such as the heat bit (which causes heat damage without Varia Suit) only being able to be set in Norfair and Tourian (where it is unused by default). A list of values pertaining to each area are found below.
Line 70: Line 70:
   07 - DEBUG   07 - DEBUG
  
-X/Y-Position on Minimap+==== X/Y-Position on Minimap ====
  
 The x-position and y-position of the room's boundaries as displayed on the mini-map. Due to the way the mini-map works, the top row you see in SMILE's map editor is not recorded as the topmost row. The row below is however. Our example room is located at the coordinates “26,0” on the mini-map. The x-position and y-position of the room's boundaries as displayed on the mini-map. Due to the way the mini-map works, the top row you see in SMILE's map editor is not recorded as the topmost row. The row below is however. Our example room is located at the coordinates “26,0” on the mini-map.
Line 80: Line 80:
  
 There are two limitations here however! A room cannot have a total area of more then 50 screens (area = width x height) and neither dimension can be expanded beyond “0F” (16) screens in size (but remember “0F” is actually “15” in hex, yet we have to count “00” as “1” in this case). This means a room of 16×3 (0F,03) is acceptable while something like 16×4 is not. For reference, the largest possible room in Super Metroid (and the largest the engine can handle) can be found as room 79D19. There are two limitations here however! A room cannot have a total area of more then 50 screens (area = width x height) and neither dimension can be expanded beyond “0F” (16) screens in size (but remember “0F” is actually “15” in hex, yet we have to count “00” as “1” in this case). This means a room of 16×3 (0F,03) is acceptable while something like 16×4 is not. For reference, the largest possible room in Super Metroid (and the largest the engine can handle) can be found as room 79D19.
-Up/Down Scrollers+ 
 +==== Up/Down Scrollers ====
  
 To be completely honest, I'm unsure exactly what these do. I recall hearing that they have a very, very minute affect on the camera while moving through a room. You will be able to get by just fine without editing them or even setting them to 00,00. To be completely honest, I'm unsure exactly what these do. I recall hearing that they have a very, very minute affect on the camera while moving through a room. You will be able to get by just fine without editing them or even setting them to 00,00.
  
-Special Graphics Bitflag+==== Special Graphics Bitflag ====
  
 The “special graphics bitflag” handles specific cases where parts of the CRE (Common Room Elements) are to be overwritten or refreshed/reloaded due to additional graphics being loaded. By clicking on the box next to it's input field in SMILE, you'll get a list of values that are common. Listed below are any special cases for each value along with a description. The “special graphics bitflag” handles specific cases where parts of the CRE (Common Room Elements) are to be overwritten or refreshed/reloaded due to additional graphics being loaded. By clicking on the box next to it's input field in SMILE, you'll get a list of values that are common. Listed below are any special cases for each value along with a description.
Line 93: Line 94:
   05 - used in Ceres elevator, Ceres Ridley's, and Kraid's rooms.   05 - used in Ceres elevator, Ceres Ridley's, and Kraid's rooms.
  
-Tileset and Music+===== Tileset and Music =====
  
 The tileset defines the set of graphics the current room will be built with and is selectable on the right side of the main SMILE window via a drop-down box with selections between 1 and 29. For a list of tilesets, refer to this page. Likewise, music determines what song to play in the room and is also selectable on the right side of the main SMILE window, though under the “Other” tab. You can find a full list of music selections over here. Both tilesets and music selections are chosen per room being unique to it's room header, not shared between them (unlike pointers which can be). The tileset defines the set of graphics the current room will be built with and is selectable on the right side of the main SMILE window via a drop-down box with selections between 1 and 29. For a list of tilesets, refer to this page. Likewise, music determines what song to play in the room and is also selectable on the right side of the main SMILE window, though under the “Other” tab. You can find a full list of music selections over here. Both tilesets and music selections are chosen per room being unique to it's room header, not shared between them (unlike pointers which can be).
-Layer 2 Scrolling+ 
 +===== Layer 2 Scrolling =====
  
 These two bytes of information give the game important information about the room's background. This can be viewed by going into the Layer 2 scrolling window in SMILE 2.5 by going to “Tools > Background Editor > BG/Layer2 SCROLLING.” These affect what kind of background to use and how it “follows” the camera while the player moves around the room. It a bit hard to explain, and the room we've picked apart isn't a good example of this at all (since the scrolling sky is something else on its own), so you're best off to find another room a play with values there. These two bytes of information give the game important information about the room's background. This can be viewed by going into the Layer 2 scrolling window in SMILE 2.5 by going to “Tools > Background Editor > BG/Layer2 SCROLLING.” These affect what kind of background to use and how it “follows” the camera while the player moves around the room. It a bit hard to explain, and the room we've picked apart isn't a good example of this at all (since the scrolling sky is something else on its own), so you're best off to find another room a play with values there.
Line 103: Line 105:
  
 The first byte is for the y-axis scrolling and the second is for the x-axis scrolling. Each byte ending with a 1 tells the game to use the BG_Data pointer in the pointers window. If there room were set to use a “Layer 2 background (Custom),” the bytes would end in 0, thus making our current example look like 80 00. Again, I suggest playing around in another room other than 791F8, 793FE, and 7968F (as all of these use the scrolling sky) to see the true effect. The first byte is for the y-axis scrolling and the second is for the x-axis scrolling. Each byte ending with a 1 tells the game to use the BG_Data pointer in the pointers window. If there room were set to use a “Layer 2 background (Custom),” the bytes would end in 0, thus making our current example look like 80 00. Again, I suggest playing around in another room other than 791F8, 793FE, and 7968F (as all of these use the scrolling sky) to see the true effect.
-Pointers+ 
 +===== Pointers =====
  
 Pointers point to specific locations in the game where data is stored. A good handful of these are vital to a room's function and as such, they will also be broken down and explained in their appropriate sections below. Pointers point to specific locations in the game where data is stored. A good handful of these are vital to a room's function and as such, they will also be broken down and explained in their appropriate sections below.
  
-Level Data+==== Level Data ====
  
 This is the almighty important pointer. As the name suggests, this is the data for the level, or room. This contains the layout of tiles on both layer 1 and 2 and the block properties of every tile within the room. While you could write all the data of one of these pointers out in hex, it's highly, highly unrecommended. Not only does this tend to be an extremely large chunk of data, it is also compressed to reduce its size. This is the almighty important pointer. As the name suggests, this is the data for the level, or room. This contains the layout of tiles on both layer 1 and 2 and the block properties of every tile within the room. While you could write all the data of one of these pointers out in hex, it's highly, highly unrecommended. Not only does this tend to be an extremely large chunk of data, it is also compressed to reduce its size.
Line 122: Line 125:
 This is just a quick overview of how level data works and how it can be expanded on. For much more in-depth and hands on explanation, go read the room expansion guide. This is just a quick overview of how level data works and how it can be expanded on. For much more in-depth and hands on explanation, go read the room expansion guide.
  
-FX1+==== FX1 ====
  
 Work in progress, more to be written. ~person701  Work in progress, more to be written. ~person701 
sm/technical_information/room_data_format.1731621698.txt.gz · Last modified: by felixwright