Skip to content

Commit

Permalink
Extra stuff, add readmes for some folders
Browse files Browse the repository at this point in the history
  • Loading branch information
DexrnZacAttack committed Jan 3, 2025
1 parent 20189c8 commit 26e226d
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 73 deletions.
14 changes: 14 additions & 0 deletions LCE/File Types/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# LCE File Formats
Documentation on various LCE file formats.

### Table of contents
1. [Saves](../Saving/) - The save format
2. [ARC](./ARC.md) - Used for storing game assets
3. [COL](./COL.md) - Used for storing colors used in-game (e.g biome colors)
4. [MSSCMP](./MSSCMP.md) - Used for storing BINK audio files
5. [THUMB](./THUMB.md) - Contains the world image, along with metadata such as the Seed
6. [Options](./Options.md) - Game settings
7. [GRF](./GRF.md)

# Contributors
List of contributors can be found under [Team.md#Documentation](/Team.md#Documentation)
12 changes: 12 additions & 0 deletions LCE/Game/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# LCE Game Mechanics/Misc
Documentation on game mechanics and other stuff that doesn't fit anywhere else. (e.g Strings, Biome IDs, etc)

### Table of contents

1. [Biome IDs](BiomeIDs.md) - All biomes in the game (as of Wii U Edition v688, uses "flattened" IDs)
2. [Colors](Colors.md) - Colors for biomes, textures, water, fog, etc.
3. [LimitStrings](LimitStrings.md) - Strings based around `The maximum number of X in a world has been reached.`
4. [BattleMapLocations](BattleMapLocations.md)

# Contributors
List of contributors can be found under [Team.md#Documentation](/Team.md#Documentation)
55 changes: 30 additions & 25 deletions LCE/Level/RegionFile.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
### MCR Structure
# MCR Structure
The following Table gives you Important information the structure of a legacy edition mcr file:
| Name | Size (in bytes) | Description |
| :-:|:-:|:-:|
| [Locations](#locations) | 0x1000 (1024 ints) | Offsets of the chunks within the region file, as well as X,Y positioning
| Timestamps | 0x1000 (1024 ints) | Timestamps for the chunks found within the previous sector
| Chunks | variable | Chunks themselves, compressed with a different format per-console.

### Locations
| Name | Size (in bytes) | Description |
|--------------------------|:------------------:|---------------------------------------------------------------------------|
| [Locations](#locations) | 0x1000 (1024 ints) | Offsets of the chunks within the region file, as well as X,Y positioning |
| Timestamps | 0x1000 (1024 ints) | Timestamps for the chunks found within the previous sector |
| Chunks | variable | Chunks themselves, compressed with a different format per-console. |

## Locations
The locations in LCE seem to use a different format per endianness...

#### Big Endian
Equivalent to JE Regions
| Name | Size (in bytes) | Description |
| :-:|:-:|:-:|
| Offset | 0x03 (int24) | Offset of the chunk, to get the true offset you need to multiply by 4096.
| Size | 0x01 (byte) | Size of the chunk in 4096-byte sectors

| Name | Size (in bytes) | Description |
|--------|:---------------:|---------------------------------------------------------------------------|
| Offset | 0x03 (int24) | Offset of the chunk, to get the true offset you need to multiply by 4096. |
| Size | 0x01 (byte) | Size of the chunk in 4096-byte sectors |

#### Little Endian
| Name | Size (in bytes) | Description |
| :-:|:-:|:-:|
| Size | 0x01 (byte) | Size of the chunk in 4096-byte sectors
| Offset | 0x03 (int24) | Offset of the chunk, to get the true offset you need to multiply by 4096.

### Compressed chunk
Within the chunk header lies a 4-byte portion of data that dictates 2 flags and the compressed chunk size.
| Name | Size (in bits) | Description |
| :-:|:-:|:-:|
| RLE Flag | 1 | Flag for if to use RLE
| Unknown Flag | 1 | It is unknown what this flag is
| Compressed Size | 30 | Compressed chunk size, to get the actual size, you must AND it by `0x3FFFFFFF`
| Decompressed Size | 32 (4 bytes, uint) | Decompressed chunk size
| Compressed chunk | Variable (Compressed Size) | The rest of the chunk |

| Name | Size (in bytes) | Description |
|--------|:---------------:|---------------------------------------------------------------------------|
| Size | 0x01 (byte) | Size of the chunk in 4096-byte sectors |
| Offset | 0x03 (int24) | Offset of the chunk, to get the true offset you need to multiply by 4096. |

## Compressed Chunk
Chunks in LCE are double compressed, usually with the console's compression format + chunk specific RLE.

| Name | Size (in bits) | Description |
|-------------------|:--------------------------:|--------------------------------------------------------------------------------|
| RLE Flag | 1 | Flag for if to use RLE |
| Unknown Flag | 1 | It is unknown what this flag is |
| Compressed Size | 30 | Compressed chunk size, to get the actual size, you must AND it by `0x3FFFFFFF` |
| Decompressed Size | 32 (u32) | Decompressed chunk size |
| Compressed chunk | Variable (Compressed Size) | The rest of the chunk |
36 changes: 18 additions & 18 deletions LCE/Saving/LCE Save File Versions.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
### Save Versions
| TU(s) | Minimum Version | Current Version |
| :-:|:-:|:-:|
| 0033-0035 | 0 | 1 |
| 0054-TU4 | 0 | 2 |
| TU5-TU8 | 0 | 3 |
| TU9-TU13 | 5 | 5 |
| TU14-TU16 | 6 | 6 |
| TU17-TU18 | 8 | 8 |
| TU19-TU35 | 9 | 9 |
| TU36-TU68 | 10 | 10 |
| TU69-1.95(PS4) | 11 | 11 |
| TU(s) | Minimum Version | Current Version |
|:--------------:|:---------------:|:---------------:|
| 0033-0035 | 0 | 1 |
| 0054-TU4 | 0 | 2 |
| TU5-TU8 | 0 | 3 |
| TU9-TU13 | 5 | 5 |
| TU14-TU16 | 6 | 6 |
| TU17-TU18 | 8 | 8 |
| TU19-TU35 | 9 | 9 |
| TU36-TU68 | 10 | 10 |
| TU69-1.95(PS4) | 11 | 11 |

### Notes
| TU(s) | Notes |
| :-:|:-:|
| 0033-0035 | This format differs from the one we see today, it has been documented [here](./Pre-Release%20Save%20Format.md) |
| 0054 | First version to have the same savegame format used in the latest version (as of the writing of this documentation) |
| TU9 | First version to have a "minimum version" that isn't 0, as well as skipping a number. (3-->5) |
| TU17 | Skips a number. (6-->8) |
| TU54 | Can no longer load version 1 saves, instead it generates a new world. |
| TU(s) | Notes |
|:----------:|---------------------------------------------------------------------------------------------------------------------|
| 0033-0035 | This format differs from the one we see today, it has been documented [here](./Pre-Release%20Save%20Format.md) |
| 0054 | First version to have the same savegame format used in the latest version (as of the writing of this documentation) |
| TU9 | First version to have a "minimum version" that isn't 0, as well as skipping a number. (3-->5) |
| TU17 | Skips a number. (6-->8) |
| TU54 | Can no longer load version 1 saves, instead it generates a new world. |

> [!NOTE]
> These tests were performed with an emulator, with one world generated per version, versions were sourced from Omniarchive, due to me using Codex-IPSA for this.
Expand Down
27 changes: 13 additions & 14 deletions LCE/Saving/Pre-Release Save Format.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,25 @@
- When upgraded, the timestamps of all the files are set to 0L.

### Save file structure
| Name | Size (in bytes) | Description |
|------|-----------------|-------------|
| Offset | 0x04 (uint) | Offset of [File Index](./Pre-Release%20Save%20Format.md#File-Index)
| Index Size | 0x04 (uint) | Size of File Index in bytes
| Minimum Version | 0x02 (ushort) | Minimum file version the LCE client has to support to load the save (might not be used in-game)
| Current Version | 0x02 (ushort) | Current version of the save file
| File Data | variable | bytes of each file contained inside the save
| [File Index](./Pre-Release%20Save%20Format.md#File-Index) | variable | Filenames, offsets within save, and size in bytes of files.
| Name | Size (in bytes) | Description |
|-----------------------------------------------------------|:---------------:|-------------------------------------------------------------------------------------------------|
| Offset | 0x04 (uint) | Offset of [File Index](./Pre-Release%20Save%20Format.md#File-Index) |
| Index Size | 0x04 (uint) | Size of File Index in bytes |
| Minimum Version | 0x02 (ushort) | Minimum file version the LCE client has to support to load the save (might not be used in-game) |
| Current Version | 0x02 (ushort) | Current version of the save file |
| File Data | variable | bytes of each file contained inside the save |
| [File Index](./Pre-Release%20Save%20Format.md#File-Index) | variable | Filenames, offsets within save, and size in bytes of files. |


> [!TIP]
> You can get the file count by dividing the Index Size by 136 (e.g $`1360 / 136`$)
<!-- I don't think the file name is actually endian reverse... -->
### File Index
| Name | Size (in bytes) | Description |
|------|-----------------|-------------|
| File Name | 0x80 | UTF16 UNIX-style path string to dictate the path of the file
| File Size | 0x04 (uint) | Size of file in bytes
| File Offset | 0x04 (uint) | Offset of file in bytes
| Name | Size (in bytes) | Description |
|-------------|:---------------:|--------------------------------------------------------------|
| File Name | 0x80 | UTF16 UNIX-style path string to dictate the path of the file |
| File Size | 0x04 (uint) | Size of file in bytes |
| File Offset | 0x04 (uint) | Offset of file in bytes |

> [!WARNING]
> There may be index data [at the end of NBT file data](https://github.com/user-attachments/assets/e44eea94-41a9-42cf-8386-f84ac9565cff)
Expand Down
8 changes: 4 additions & 4 deletions LCE/Saving/Split Saves.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Not much seems to be known about split saves, so some info may be inaccurate.
Thanks to [UtterEvergreen1](https://github.com/UtterEvergreen1) for helping out and explaining this.

### Format
| Name | Size (in bytes) | Description |
| :-:|:-:|:-:|
| Decompressed Size | 0x04 (uint) | |
| Compressed Region | Variable | Compressed with what seems to be a special RLE that is only used for split saves. |
| Name | Size (in bytes) | Description |
|-------------------|:---------------:|-----------------------------------------------------------------------------------|
| Decompressed Size | 0x04 (uint) | |
| Compressed Region | Variable | Compressed with what seems to be a special RLE that is only used for split saves. |
20 changes: 10 additions & 10 deletions LCE/Saving/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ If you're on a newer-gen console, specifically PS4, Xbox One, and Nintendo Switc
Check out the Menu/Sidebar for other stuff not mentioned here.

### Save file names
| Console | Name | Example (if needed) |
|------|----|------|
| Xbox 360 (dat) | `savegame.dat` | |
| Xbox 360 (bin) | `Save{YYYY-MM-DD-HH-MM-SS}.bin` | `Save20230524072953.bin` |
| PS3 | `GAMEDATA` | |
| PS Vita | `GAMEDATA.bin` | |
| Wii U | `{numbers}` | `221122091644` |
| Xbox One | `GAMEDATA` | |
| PS4 | `GAMEDATA` | |
| Nintendo Switch | `{numbers}.dat` | `240408080958.dat` |
| Console | Name | Example (if needed) |
|-----------------|---------------------------------|--------------------------|
| Xbox 360 (dat) | `savegame.dat` | |
| Xbox 360 (bin) | `Save{YYYY-MM-DD-HH-MM-SS}.bin` | `Save20230524072953.bin` |
| PS3 | `GAMEDATA` | |
| PS Vita | `GAMEDATA.bin` | |
| Wii U | `{numbers}` | `221122091644` |
| Xbox One | `GAMEDATA` | |
| PS4 | `GAMEDATA` | |
| Nintendo Switch | `{numbers}.dat` | `240408080958.dat` |
4 changes: 2 additions & 2 deletions LCE/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Documentation about Minecraft: Legacy Console Edition related stuff.
### Table of contents
1. [Basic Information](./Basic%20Info.md) - Compression, endianness
2. [Saving](./Saving/) - Save file format, split saving, etc
3. [Level/World](./Level/) - Region, Chunk, level storage, etc
4. [File Types](./File%20Types/) - ARC, COL, GRF, MSSCMP, Options, THUMB
3. [File Types](./File%20Types/) - ARC, COL, GRF, MSSCMP, Options, THUMB
4. [Level/World](./Level/) - Region, Chunk, level storage, etc
5. [Game](./Game/) - Game mechanics and other stuff
Check out the Menu/Sidebar for other stuff not mentioned here.

Expand Down

0 comments on commit 26e226d

Please sign in to comment.