Rewrote from a different post:
To provide you with useful data sets to help you build your own Chrono Trigger TileMap editor, we will cover a few of the key data structures relevant to the game's tilemaps. These data sets include the tile graphics, map data, and other key elements. Keep in mind that some of the information I share is based on general knowledge of the game and how it stores data, but actual data offsets and formats may require more in-depth exploration and reverse-engineering.
### 1. **Tile Data**:
Tile data is used to define the actual graphical tiles that appear in the game world. Each tile is a small image, typically 8x8 pixels. In Chrono Trigger, the tile graphics are stored in specific parts of the ROM in a compressed or encoded format.
- **Tile Graphics Offset**: The tile data is stored in the ROM starting at offset `0x20000` (this is approximate and may vary depending on the specific version of the ROM). The tiles are arranged in a sequence, and the graphics are typically stored in a compressed form (e.g., using LZ compression).
- **Tile Layout**: The graphical tiles are stored as a set of 8x8 or 16x16 blocks in the ROM. The layout is such that each tile's index corresponds to a unique graphic in the game's world.
### 2. **TileMap Data**:
The map data defines how tiles are arranged in the world, and it is usually stored in a different section of the ROM. Each map is a 2D array of tile indices, where each index corresponds to a tile in the graphics data. These indices tell the game which tiles to place in each position on the map.
- **Map Data Offset**: In Chrono Trigger, map data is stored in several locations, often beginning at offset `0x30000` (again, this is approximate). Each map has its own set of map data, and the game uses references to tile indices from the tile graphics section to assemble the map.
- **Map Structure**:
- **Map Size**: The map data is organized into 2D grids (usually 32x32 or 64x64 tiles, depending on the area).
- **Tile Indices**: The map data consists of tile indices, which are numbers that point to the corresponding tile graphic in the tile set. These indices may also be offset by specific values.
- **Layer Data**: Some maps may have multiple layers (e.g., foreground and background), and each layer will have its own map data.
### 3. **Palette Data**:
In addition to tile and map data, each tile can have its own palette (set of colors) that is used for rendering. Palette data defines how the game colors each tile based on a set of 15 colors.
- **Palette Data Offset**: Palette data for map tiles is typically stored around `0x50000` in the ROM. This palette data is referenced by the map data and determines the colors used for each tile.
### 4. **Tile Animation**:
Some tiles in Chrono Trigger (such as water tiles or animated tiles) are animated. These animations are stored as part of the map data or in separate animation data structures.
- **Animation Data**: Animation data is often stored separately in the ROM, with each animated tile referencing a set of tiles that are displayed in sequence to create the animation. The animation frames are typically stored as separate tile indices and are referenced by a special animation table in the map data.
### 5. **Map-Specific Information**:
Each map has additional metadata that helps the game load it correctly. This includes things like object positioning, collision data, and event data.
- **Event Data**: Chrono Trigger uses event flags and object data for interactive elements within the map, such as NPCs or items. These are often stored in the same section as the map data or in a separate structure. Event data is vital for editing maps with TemporalFlux, as it determines how interactive elements function on the map.
- **Collision Data**: Each map has collision information that determines whether the player can walk on certain tiles. This data is stored alongside the map data and must be edited carefully to prevent breaking the game’s logic.
### Known Data Structures (Approximate Offsets):
Here’s a summary of where to find key data in the ROM. Please note these are rough estimates and may vary by ROM version or localization.
| Data Type | Approximate Offset | Description |
|------------------------|--------------------|-------------|
| **Tile Graphics** | `0x20000` | Graphics data for tiles. Often compressed. |
| **Map Data** | `0x30000` | Layout of tiles, including indices for the tiles used. |
| **Palette Data** | `0x50000` | Color palettes for tiles. |
| **Event Data** | Varies by map | Event flags and object data that define interactions. |
| **Animation Data** | Varies | Data for animated tiles (e.g., water, animated objects). |
| **Collision Data** | Varies | Information about where the player can walk (collision data). |
### Tools You Can Use:
1. **Tile Layer Pro** or **YY-CHR**: These are excellent tools for inspecting tile graphics directly in the ROM. You can view the individual 8x8 or 16x16 tiles and modify them as needed.
2. **TemporalFlux**: TemporalFlux will help you manage map data, event data, and tiles in a more user-friendly way. While it abstracts away some of the complexity, understanding how the data is structured at a low level will still be important.
3. **Hex Editors**: A hex editor like **HxD** or **010 Editor** will allow you to manually examine the raw data of the ROM and find the offsets where tiles, maps, and other data are stored.
### Final Notes:
- **Compression**: Chrono Trigger uses a form of compression for storing its tile data, so when extracting or editing the ROM, you might need to decompress or re-compress the data. A popular method for this is LZ77 compression, but the exact method used by Chrono Trigger might be slightly different.
- **ROM Version**: Be aware that the ROM version may vary (for example, the Japanese version vs the English version). The exact offsets and data layout might be slightly different across versions, so you should verify the offsets with the ROM you're working with.
Once you identify and understand the data structures, you can start modifying them using TemporalFlux or create your own editor by reading and writing the map and tile data back into the ROM.
If you want further help with reverse-engineering specific sections or creating tools for this, let me know!
/ChatGPT
Z: "We need more information...because some of the graphics have animated tilesets, for instance, Heckran Caverns has a water graphic animation, can you provide more details?"
Quote
You're absolutely right! Some locations in *Chrono Trigger*, like Heckran Caverns, feature animated tiles, and these tiles are handled differently from static ones. This requires a deeper dive into how animated tiles are stored, managed, and referenced in the ROM. Let's break this down further and explore how animated tiles work and where they might be stored.
### Animated Tiles in Chrono Trigger:
Animated tiles in *Chrono Trigger* (such as the flowing water in Heckran Caverns) are tiles that consist of multiple frames and are displayed in sequence to create the illusion of animation. For instance, water tiles might cycle through several different graphical states to simulate movement.
These animated tiles require special handling, both in terms of graphics and map data.
---
### **1. Structure of Animated Tiles**:
Animated tiles in *Chrono Trigger* are stored in a way that allows for multiple frames to be shown in sequence. This is done by referencing a set of tiles and updating the map data at specific intervals.
Here’s how this works in terms of data structures:
- **Tile Sets**: As with regular tiles, animated tiles are stored in the tile set (usually 8x8 or 16x16 pixel blocks). Each frame of an animated tile is simply a reference to a different tile within the set.
- **Tile Animation Data**: The animation is controlled by a table or array that holds the tile indices for each frame of the animation. This table tells the game how to switch between different tiles to create the animation effect.
---
### **2. Offsets for Animated Tile Data**:
While Chrono Trigger’s exact structure for animated tiles is complex and depends on the version of the ROM, we can make some general observations based on how other SNES games store animation data:
- **Animation Table**: This table stores how tiles should change over time. It tells the game which tile index to display at each frame. For example, if a tile is animated in four frames, the animation table will store the indices for these four tiles.
- The **animation table** is typically stored in the same general area as the map data but is located after the static tile indices for normal tiles.
- **Tile Indices for Animation**: The game will reference these tiles from the **tile set** (where the graphical tiles are stored), and each frame of animation corresponds to a different tile. The tile indices are stored in an array, which is updated at regular intervals to change the tile displayed on the screen.
- **Timing Data**: In addition to the animation frames, the game needs to know how long each frame should be displayed before moving on to the next one. This timing data could be embedded in the same table as the tile indices or in a separate structure.
---
### **3. Animation Handling for Specific Areas (e.g., Heckran Caverns)**:
Let’s use Heckran Caverns as an example, where water flows in an animated fashion. The animation is composed of a few key elements:
1. **Water Tile Set**: The tiles for water might be stored in a specific area of the ROM. These could be separate tiles that form a "water" tile set (or graphic sheet) in the tile data.
2. **Map Data**: The map data in the Heckran Caverns will reference these water tiles at specific locations in the map. Each map location that has a water tile will reference the animated tile index rather than a static one.
3. **Animation Frames**: The animated water will be composed of several frames that cycle over time, providing the effect of flowing water. These frames will all point to different tile indices, such as:
- **Frame 1**: A specific tile representing still water.
- **Frame 2**: A slightly more rippled version of water.
- **Frame 3**: A more aggressive ripple.
- **Frame 4**: Water splashing, etc.
4. **Animation Timing**: The game logic will update the map or tile data at certain intervals to switch between the frames. Each frame might be displayed for a certain number of cycles (e.g., 1/4th of a second) before moving on to the next frame in the animation.
---
### **4. Offsets and Location of Animated Tile Data**:
Unfortunately, the exact offsets for animated tiles vary depending on the version and localization of the ROM you're working with. However, we can provide more guidance on how to locate and manipulate this data:
- **General ROM Layout**:
- **Tile Data**: Generally starts around `0x20000` as previously discussed. This is where you can find the raw graphical tiles.
- **Map Data**: Starts at around `0x30000` and stores the layout of how tiles are arranged on the map.
- **Animation Data**: Animation tables for specific tiles are often stored after the map data or in a separate section. These may start around the range of `0x40000` or `0x50000`, but you will need to verify these locations using tools like a hex editor or ROM disassembler.
- **Identifying Animated Tiles**:
- Use **Tile Layer Pro** or **YY-CHR** to inspect the tile set around the areas where you know animation occurs (such as water tiles). You should see that there are several tiles that look like they could be animated (e.g., slightly different water ripples).
- Once you've identified the animated tiles in the tile set, you can cross-reference them with the map data at the relevant offset (such as in Heckran Caverns) to see which tiles are being referenced in the animation.
- **Tracking Animation Tables**:
- If you know the general range of the map data and tile sets, you can search for data tables or arrays that contain multiple references to tile indices. These arrays often contain the animation frames for a specific tile or object.
- Look for references that are not sequential—this can indicate an animation table where tiles are being cycled between rather than just referenced linearly.
---
### **5. Tools for Managing Animated Tiles**:
- **TemporalFlux**: TemporalFlux has support for editing animated tiles, but you may need to dive deeper into its tools to fully understand how to handle the animation timing and frame data. It should allow you to manipulate animated tiles at the map level, but for a more granular look, you’ll need to explore how it handles the raw tile indices.
- **Tile Layer Pro** or **YY-CHR**: These are invaluable for manually inspecting and editing tile graphics. You can view and modify the tile data and make changes to how animated tiles are displayed.
- **Hex Editors**: For more advanced manipulation, you can use a hex editor (like **HxD**) to locate the raw tile data and animation tables in the ROM.
---
### **Final Thoughts**:
Understanding how Chrono Trigger handles animated tiles requires a combination of graphics exploration, map data examination, and understanding how the game cycles between tiles. With animated tiles, the core idea is that multiple tiles (each representing a frame) are displayed in sequence to create the animation.
You can:
- Start by identifying the water tiles and animation data in Heckran Caverns or similar areas.
- Explore the animation tables and frame timing data to control the flow of animation.
- Use tools like **Tile Layer Pro**, **YY-CHR**, and **TemporalFlux** to manage this data.
If you are able to locate the specific areas in the ROM that deal with animation (tile index references, animation tables, timing data), you can modify and extend them to create your own custom animations.
Let me know if you need help diving into specific sections of the ROM or additional examples!
Z: "We need hex values from the ROM"
Quote
To provide specific **hex values** and offsets for animated tile data (such as the water tiles in **Heckran Caverns**) in *Chrono Trigger*, I would normally recommend using a **hex editor** or a specialized tool to explore the ROM data directly. Unfortunately, I cannot provide exact hex values directly from the ROM, but I can guide you through how to extract and explore this data using tools and resources.
### General Approach to Finding Animated Tiles in Chrono Trigger's ROM:
#### 1. **Finding the Water Tiles (Example: Heckran Caverns)**:
The process of finding the animated water tiles in the ROM involves several steps. Here’s how you can proceed:
1. **Identify Tile Set Data**:
- Start by opening the ROM with a hex editor like **HxD** or **010 Editor**. The tile graphics, including animated tiles like water, are stored starting around `0x20000` in the ROM. This location is where graphical tiles are usually kept.
- **Look for tile patterns**: By inspecting the data, look for patterns that resemble the graphical representation of water. Water tiles in Heckran Caverns typically look different from normal tiles and may have several variations (such as waves or ripples).
2. **Examine Animated Tiles**:
- **Water Tiles**: The animated water tiles will likely be sequential in this area of the ROM. If water has multiple frames (such as flowing or rippling), you should see different tile data that slightly changes for each "frame" of the animation. For example, a water ripple effect might have four distinct graphical states.
- You may notice that each of these variations has a distinct **tile index** (e.g., `0x1234`, `0x1235`, `0x1236`, etc.), and these are referenced in the **map data** to form the animation.
3. **Locate Map Data**:
- Map data generally begins around `0x30000` in the ROM (this can vary). The map data tells the game how to lay out the tiles on the screen by referencing tile indices from the tile set.
- In the case of animated tiles, you’ll see that the map data references **multiple tiles** in sequence for each animated tile. For example, if an animated water tile consists of four frames, you might see four sequential tile indices in the map data that correspond to these frames.
4. **Find Animation Tables**:
- In addition to the tile indices, there is an **animation table** that controls the timing of the frame changes. The game needs to know how long to display each tile before switching to the next one. This is usually stored after the map data.
- **Search for animation table**: The animation table is an array or list that defines the sequence of tile indices for the animation. The table will reference each animated tile’s frame, and you can edit the timing here (though the format may differ by ROM version).
---
### Hex Values You Might Encounter:
Since you’re working with specific data for **animated water tiles**, here’s a hypothetical breakdown of the kinds of values you might see. This is just a general idea of how the data might be structured and is meant for reference. You’ll need to examine the actual ROM to see the values.
#### Example (Heckran Caverns Animated Water Tiles):
- **Tile Set Data (0x20000 - 0x22000)**:
- This range might contain graphical data for tiles, including water. Each 8x8 tile or 16x16 tile will have its own sequence of bytes representing the pixel data in a compressed or raw format.
**Example (Water Tile Indices)**:
- `0x1234` – Frame 1 of water (still water).
- `0x1235` – Frame 2 of water (slightly rippled).
- `0x1236` – Frame 3 of water (strong ripples).
- `0x1237` – Frame 4 of water (splashing water).
The sequence of values might vary, but each tile index points to a unique graphical frame for the animation.
- **Map Data (0x30000 - 0x32000)**:
- This section stores the actual layout of the tiles, referencing the tile indices defined earlier.
**Example (Map Data referencing Animated Tiles)**:
- `0x1234` – Water tile (Frame 1).
- `0x1235` – Water tile (Frame 2).
- `0x1236` – Water tile (Frame 3).
- `0x1237` – Water tile (Frame 4).
The map data is structured as a grid of tile indices. For animated tiles, you might see a similar series of indices placed together in the map data.
- **Animation Table (0x40000 - 0x42000)**:
- If there’s a dedicated animation table for Heckran Caverns’ water, you may find entries like:
**Example (Animation Table)**:
- `0x1234` – Frame 1 of water.
- `0x1235` – Frame 2 of water.
- `0x1236` – Frame 3 of water.
- `0x1237` – Frame 4 of water.
Each frame corresponds to one of the previously mentioned tile indices. The timing of these frames will likely be specified by additional timing values in the animation table.
---
### Using Tools to Extract Data:
#### **Hex Editor (HxD or 010 Editor)**:
- Open the ROM in the hex editor and navigate to the relevant offset, such as `0x20000` for tile graphics.
- Search for repeating patterns or familiar tile data to find where animated tiles are stored.
- Once you identify the water tiles, cross-reference them with the map data at `0x30000` or similar areas.
#### **Tile Editing Tools**:
- **Tile Layer Pro** and **YY-CHR** can be used to visually inspect and modify the tile graphics. They allow you to easily view the 8x8 or 16x16 tiles and spot which ones belong to the animated sequences.
#### **TemporalFlux**:
- TemporalFlux will handle the map layout and animation data more easily, especially if you use it to modify the game’s data directly. Check TemporalFlux’s documentation for specific support related to animated tiles.
---
### How to Edit and Test:
1. **Extract Data**: Use a hex editor or tile editing tool to locate the animated tiles (such as the water tiles) and their corresponding tile indices.
2. **Modify Animation Frames**: If you're adding or modifying animation, update the sequence of tile indices that represent the animation.
3. **Update Map Data**: If necessary, update the map data to reference the new or modified animated tiles.
4. **Test in Game**: Once you've made changes to the ROM, load it in an emulator (such as **SNES9x**) to test and verify that the animation is working as expected.
---
### Final Notes:
- **Compression**: Some of the tile data may be compressed, so you might need to decompress it before editing. This is common in SNES games. You can use decompression tools or write custom scripts if you're comfortable with reverse engineering.
- **Offsets**: The exact values for offsets and data structures can vary slightly depending on the version or localization of the ROM. You'll need to cross-check with your specific ROM to find precise locations for tile sets, map data, and animation tables.
---
If you need further assistance with identifying the exact byte values or offsets in your ROM, I recommend using a combination of tools like **HxD**, **Tile Layer Pro**, and **TemporalFlux**, and testing with a debugger to pinpoint the exact locations of animated tiles.
/ChatGPT
This might be useful...
~Z