Jump to content

research Deciphering data/fielddata/mapmatrix/map_matrix.narc


AngelSL
 Share

Recommended Posts

Deciphering data/fielddata/mapmatrix/map_matrix.narc in Diamond/Pearl's contents.

I would appreciate it if anyone that has looked into it before provide their insight.

And if you figured out the structure of the contents, I'd appreciate it if you could post it here.

I do know the structure of a NARC file, I'm looking into the contents of the map_matrix.narc file.

If Alpha reads this, SCV said that you might know more about map_matrix.narc's contents.

Shoutout.

Link to comment
Share on other sites

  • 2 weeks later...

Hi. I'm also wondering about the map_matrix.narc file (for D/P).

  1. The "map" matrix is 30x30, indicating that there should be 1800 bytes following the map's prefix. Instead, there is 4500 bytes. Can anyone explain this discrepency?
  2. The matrix provided by "map" (if using the first 1800 bytes after the prefix) is in the shape of the D/P map, although the indexes don't match the maps in the 'land_data_realease.narc' file. For example, the matrix gives '411' as the location for Twinleaf town, but this should be map '0'?
    Edit: This index appears to map to the names in 'mapname.bin', rather than the maps. Does anyone know how to map the map indexes?

I'm sure there is a relatively simple explanation, but I'm yet to find it.

Edited by Cryptix
Link to comment
Share on other sites

Hi. I'm also wondering about the map_matrix.narc file (for D/P).

  1. The "map" matrix is 30x30, indicating that there should be 1800 bytes following the map's prefix. Instead, there is 4500 bytes. Can anyone explain this discrepency?
  2. The matrix provided by "map" (if using the first 1800 bytes after the prefix) is in the shape of the D/P map, although the indexes don't match the maps in the 'land_data_realease.narc' file. For example, the matrix gives '411' as the location for Twinleaf town, but this should be map '0'?
    Edit: This index appears to map to the names in 'mapname.bin', rather than the maps. Does anyone know how to map the map indexes?

I'm sure there is a relatively simple explanation, but I'm yet to find it.

The extra data is unknown to me so far (as I haven't yet looked into it), but I do have some guesses as to what makes it up.

As a matter in fact, the relationship to land_data_release is very very complicated. Land_data_release files are just the visual overlay of the maps, and very often more than one of these relates to a single map. Twinleaf is 0 according to graphics utilities only. Otherwise it is 411.

The only actual program that can map out these complex regions is "AlphaRegion" though it's nowhere near completion yet...

Link to comment
Share on other sites

Hi Alpha. Thanks for the reply, although I am a bit unsure with what you meant by:

As a matter in fact, the relationship to land_data_release is very very complicated. Land_data_release files are just the visual overlay of the maps, and very often more than one of these relates to a single map.

Perhaps read my observations, and then we can discuss?

Just to clarify my current understanding of the 'map_matrix.narc' and the 'land_data_release.narc' files:

map_matrix.narc

This file contains 245 entries (0 - 244) for Diamond/Pearl and 289 (0 - 288) for Platinum. Each entry corresponds to a "matrix" which indicates how to connect areas from the 'land_data_release.narc' (D/P) or 'land_data.narc' (Pt) file, by arranging each map index into a matrix of fixed dimensions.

The 0th entry in this file corresponds to the entire "outside" map (for lack of a better word), and the other entries correspond to different dungeons.

land_data_release.narc

Known simply as land_data.narc in the Platinum ROM, this file contains 578 (0 - 577) entries for D/P and and 666 (0 - 665) entries for Pt.

Each entry in this file describes a 32x32 (1024) square area; including how we can move our character through this area (i.e. the movement grid), which models are used, which textures are applied, etc.

Personal Observations

From my observation of these maps, I've come to the following associations (D/P):

Map #000: Twinleaf Town

Map #001: Lake Verity (Top Left)

Map #002: Lake Verity (Bottom Left)

Map #003: Lake Verity (Top Right)

Map #004: Lake Verity (Bottom Right)/Route 201 (Left)

Map #005: Route 201 (Middle)

Map #006: Route 201 (Right)

...

etc.

I came to this conclusion by comparing the movement grids with the official Nintendo Power game guide and the 'map' matrix (attached).

I have also mapped the indexes from the 'map_matrix.narc' file with each map in 'land_data_release.narc' and found the folllowing:

  • The 0th matrix messes everything up, and except for this map, the matrices are actually fairly simple.
  • Excluding the results from the 0th matrix, maps 179 onwards are indexed in at least one matrix except for maps 225, 226, 227, 326, 327, 547, 548, 549, 550, 551, 552.
  • Most maps are indexed exactly once, except for 499, 500, 501, 502, 503, 504 (not sure what these matrices represent, yet) and 561-576 (this range represents the underground maps).

Furthermore, the indexes from the 0th matrix seem to more accurately correspond the the entries in 'mapname.bin':

  • 411 is 'T01' (Town 1)
  • 334 is 'L01' (Lake 1)
  • 342 is 'R201' (Route 201)
  • 418 is 'T02' (Town 2)
  • 343 is 'R202' (Route 202)
  • etc...

Anyway, I am continuing work on understanding the relationships between the files in the fielddata folder; and if anyone has further information (or wants to help), let me know.

For anyone who wants to know, the tools I am using are: NitroExplorer (to extract NARC files) , and HxD (a free and portable hex editor). I am writing a lot of my own programs for analysing the NARC files, and I may release the code in the future.

Edit:

Offsets:

http://pokemon.xafine.com/land_data_release-dp.txt

http://pokemon.xafine.com/land_data-pt.txt

http://pokemon.xafine.com/map_matrix-dp.txt

http://pokemon.xafine.com/map_matrix-pt.txt

'map' matrix:

http://pokemon.xafine.com/map.png

Edited by Cryptix
Added links, formatting.
Link to comment
Share on other sites

Cryptix, all the information is known to me. I have what may be one of the only map tools. What it does is it searches through the ARM files to get the full correlation set. This set links the map index (Twinleaf = 411) to its encounter rate data, scripts, text, and event data. The map_matrix is used upon calling maps. When you cross that loading line from Route 201 into Twinleaf town, it loads all of this data, and then calculates where it is on that map matrix (just like your image) and then loads the graphical map "map03_27c" which is land_data.narc/0.

Edit: AlphaMap, and its subprograms, and the Alpha-Py Series are not out for release yet.

Edited by Alpha
Program status
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...