Palace Analytics - AFontaine79/Z2R_Mapper_Docs GitHub Wiki
Palace Analytics
Note: This is the documentation for the Palace Analytics feature of the Z2R Mapper. Go here for the main documentation page.
The new palace analytics feature is available as of release 1.2. This feature can be found in the File menu. You do not need to open a ROM before using palace analytics.
Overview
Palace Analytics uses the palace routing engine to analyze palace solutions across a batch of Z2R ROM files. Its purpose is to answer questions such as "What are the odds P3 will require the glove?" or "Should I take the drop in P4?"
Keep in mind, some statistics will can affected by the Randomizer settings or the route type selected for analysis.
- Example of randomizer setting that will affect results: a long GP is more likely to require glove or Fairy spell.
- Example of route selection that will affect results: P2 is more likely to require Jump or Fairy spell in an Entrance to Item analysis than with an Entrance to Boss analysis.
TL;DR If you are not interested in learning how to use the Palace Analytics feature, go here for pre-generated reports.
Usage
Step 1: Generate the ROM files
First things first, a set of ROM files must be generated for analysis.
- Create an empty folder to hold the ROMs.
- Decide the flag set and apply them to the Randomizer.
- Use the Batch... feature of the Randomizer to generate a large set of ROMs with the same flag set. Recommend several hundred to a few thousand. This may take a long time.
- Move the ROMs to the newly created folder.
Step 2: Analyze the ROMs
Palace Analytics is performed in two stages: Analysis and Report Generation.
The top of half of the Palace Analytics dialog provides access to the analyzer.
Route to Analyze
This is the same as for the Palace Routing page of the main dialog. Only one route type may be analyzed at a time since reports are specific to the route type.
Palaces to Analyze
Only the palaces selected will be analyzed. This is useful if, for example, you are only interested in statistics on Great Palace.
Folder Selection
Use the folder selection dialog to navigate to the folder where you stored the ROMs. The folder path will appear in the folder selection textbox.
Analyze
Click the Analyze button to start the analysis. The more ROM files, the longer this will take. This process is not optimized or multi-threaded. Progress is shown by the progress bar. You may cancel the operation before it is complete. Once completed, you may generate reports.
Step 3: Generate the Reports
Once a set of ROMs has been analyzed for a specific route type, the dataset is stored internally and multiple reports may be generated. All reports are generated as CSV files. The most useful report types are Which Way to Go and Route Requirements.
The bottom of half of the Palace Analytics dialog provides access to the report generator.
Report Type
Which Way to Go: Builds a cross-reference table showing how often a given exit was the correct choice based on a given entrance. This report is only useful for decision point rooms. The columns have two headings. The first heading says how the room was entered: From the Right, From Above (via elevator), From Below (via elevator), From the Left, of From Drop (i.e. drop into). Each of these comprise a group of columns. The second heading divides the above into possible exit paths: Go Left, Go Down (via elevator), Go Up (via elevator), Go Right, or Take Drop. The rows represent individual rooms. Each cell has a value from 0 to 1 indicating the likelihood of it being the correct path. Here is what this looks like for an Entrance to Boss analysis.
Examples of how to read this:
- In GP, if I enter the Jackimus Room from the right, there is a 65% chance I should take the elevator down.
- In GP, if I enter the EON room from the left, there is a 71% chance I should take the drop.
Correct Path Based on Room Entrance: Gives the likelihood of a room being entered from the identified direction for a particular route type.
Correct Path Based on Room Exit: Gives the likelihood of a room being exited in the identified direction for a particular route type.
Route Requirements: Gives the statistical likelihood of different requirements being required on a route. For locked doors, this is the average number of doors encountered. For everything else, this is a number between 0 and 1.
Note that the average number of doors encountered only accounts for doors in the solution path. This is different than the total number of locked doors a palace contains and may not be a good indicator of how many keys or Fairy casts may be required when exploring the palace.
Rooms to Include in Report
Decision Point Rooms: Include only rooms that offer the player a choice of directions.
Passthrough Rooms: Include only rooms that offer no choice and only function as a pass-through.
All Rooms: Include all rooms in the report.
Output File
The CSV file to generate. Use the browse button to specify a path and filename for the report.
Generate Report
Click the Generate Report button to genreate the CSV file.
Step 4: Open in Excel and Add Formatting
The Palace Analytics tool only generates CSV files. You may want to convert these to proper spreadsheets and add custom formatting. Typical modifications I like to make are:
- Setting the left column and header rows to bold type
- Adjusting column widths to properly fit their headers
- Using Freeze Pains to lock the header rows at the top
- Using Format Cells to set probability values (anything from 0 to 1) to Percentage
Already built spreadsheets
Analyses across a batch of 5000 ROM files have already been performed and uploaded to this repository. They are available as Excel spreadsheets.
- Palace Route Requirements
- Which Way Report for Entrance to Item
- Which Way Report for Entrance to Boss
A note about palace layout and graph theory
Palaces 4, 6, and GP have loops. The number of loops is fixed by the vanilla game. The Randomizer only shuffles connections between rooms. Since the same rooms are always included in the shuffling, these means every palace will end up with the same number of loops, drops, and dead ends as the vanilla game.
- Palace 1: 0 loops, 0 drops
- Palace 2: 0 loops, 0 drops
- Palace 3: 0 loops, 0 drops
- Palace 4: 1 loop, 1 drop
- Palace 5: 0 loops, 0 drops
- Palace 6: 3 loops, 3 drops
- Great Palace: 2 loops, 4 drops
This information can be used to your advantage. For example, if you identify a simple two-room loop in P4, then you know the pit cannot be part of a loop. Therefore jumping down the pit must be the correct path to the boss.
Additionally, loops may or may not be nested. If nested, there will be an outer and inner loop with both loops sharing some of the same screens. As an example, the two loops in GP are nested in the vanilla game. If not nested, then the loops will share none of the same screens.