Views: 23,105,679 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
12-06-24 08:13 PM |
Guest: |
0 users reading [Tutorial] How to Import Custom Minimaps | 1 bot |
Main - General SM64DS hacking - [Tutorial] How to Import Custom Minimaps | Hide post layouts | New reply |
Fiachra |
| ||
Local moderator Level: 65 Posts: 783/1065 EXP: 2298599 Next: 37029 Since: 12-15-12 From: Ireland Last post: 2385 days ago Last view: 335 days ago |
This tutorial will document the process of importing custom minimaps using SM64DSe.
There are 2 issues that need to be taken into consideration when replacing a level's minimap:
Only the first two will be covered as the third is not implemented in the editor (although it may be n future, it wouldn't be too difficult). This tutorial will go over three examples:
The first issue, the size is hardcoded for each level and cannot be changed (yet, I've never looked into where it's stored) and is either 128x128 or 256x256. The Minimap and Image Editor: First, open the "Minimap and Image Editor". This is done through opening the level whose minimap you want to edit and clicking on "Minimap" along the top. You will see something like the following: 1 - "Is Minimap": This was added due to differences in how minimap ISC (NSC) files are arranged compared to the rest of the images in the game and needs to be set to true if you want to view the minimap using an ISC file eg. when a level has more than one ISC file. Note: This will be discussed further in the examples. 2 - "Bits Per Pixel": For minimaps this is always 8. The setting "Palette Row" is not used for 8 BPP images. 3 - "Width and Heigth": Specifies the image's width and height both for viewing, importing and exporting. When "Is Minimap" is set to true, the width and height must match that of the minimap size ie. 128x128 or 256x256. 4 - "Graphic NCG": NCG or ICG for minimaps is the file that contains an image's data, giving for each pixel the index of its colour within the palette. 5 - "Palette NCL": NCL or ICL for minimaps holds the list of colours available in the image. 6 - "Screen NSC": NSC or ISC files are used to split an image into 8x8 tiles and specify the tile number of each 8x8 block. Eg. if a single NCG file is used for multiple areas of a level, an ISC file is used to hide unwanted parts of the image so that the whole level map is not visible at once. 7 - "Set Selected as Background": Allows specifying the colour that will be shown outside the border of the minimap during the game. The background colour is determined as the first palette colour. To change the background colour, select the colour you want within the palette by clicking on it and click on this button. This will re-arrange the palette's colours so that the selected colour comes first. 8 - "Co-ordinate Scale": Used to control the scale of the player's co-ordinates in relation to the minimap. Typically finding the correct value will be a matter of trial-and-error. Custom Minimap File Formats Images to be imported as custom minimaps MUST be:
Tips for creating a minimap Note: This assumes that you're using Blender. You will need to make sure when creating a minimap that the centre of the image corresponds with the centre or origin of the model to ensure that Mario's position is shown correctly. To shown the model's origin, enter Object Mode, select the model and press '7' to enter 'Top' view and depending on your version you amy need to press '5' to enter orthogonal view. The origin is shown with the red, green and blue arrows eg.: Take a screenshot and hold on to that image. For the minimap itself you can either take a screenshot in your 3D modelling program similar to above but without any axes indicators visible or you can use SM64DSe. To use SM64DSe, import your model and position the camera so that it's looking down on your model eg.: Once positioned, click on the button "Orthogonal View" near the top right corner and position the camera so it's looking straight down (use known straight edges to help judge). Note: use 'Pg Up'/'Pg Dn' to zoom in/out and 'Home'/'End' to change the clipping level: Take and save a screenshot. Use the screenshot you took earlier to create a minimap with the centre of the model lining up with the centre of the image: The image in the centre is correct; the centre of the image and the centre/origin of the model match whilst the second image is incorrect; the origin of the model doesn't line up with the image's centre. If the map is incorrectly rotated upon importing, just keep rotating your image by 90 degrees until it's the right way around. Examples: Note: I have used Photoshop below but any that supports layers and indexing images eg. GIMP should be fine as well. Example 1 - 128x128 minimap: Bob-Omb Battlefield
Example 2 - 256x256 minimap: Playroom
Example 3 - 128x128 minimap with hard-coded portion: Whomp's Fortress
|
Fiachra |
| ||
Local moderator Level: 65 Posts: 906/1065 EXP: 2298599 Next: 37029 Since: 12-15-12 From: Ireland Last post: 2385 days ago Last view: 335 days ago |
Something which may come in handy:
If you want to disable all of the level-specific minimap changes eg. the ship in JRB or the Fortress in WF, add the following code to your hack: // Disable all of the level-specific minimap changes eg. the ship in
// JRB or the fortress in WF. void repl_020F99B4_ov_02() { asm ( "mov r0, #0x00 \t\n" ); } If you want to override the minimap sizes used by the game: // One bit for each of the 52 levels: 1 for 256x256, 0 for 128x128 unsigned int LEVEL_MINIMAP_SIZES[2] = { 0xFFFFFFFF, 0xFFFFFFFF }; unsigned int Map_c = 0xFFFFFFFF; unsigned int DMA_Related = 0x0400100E; void hook_020FB698_ov_02() { asm ( "ldr r0, =Map_c \t\n" "str r6, [r0] \t\n" "ldr r0, =DMA_Related \t\n" "str r2, [r0] \t\n" ); byte currentLevelMinimapSize = ((byte)(LEVEL_MINIMAP_SIZES[CurrentLevelID >> 5] >> CurrentLevelID) & 0x01); if (currentLevelMinimapSize == 0x00) { // 128x128 *((volatile unsigned int*)(Map_c + 0x1D8)) = 0x00000080; *((volatile unsigned int*)(Map_c + 0x1DC)) = 0x00000040; *((volatile unsigned int*)(Map_c + 0x1E0)) = 0x00000000; *((volatile unsigned int*)(Map_c + 0x1E4)) = 0x00000000; *((volatile unsigned int*)(Map_c + 0x1E8)) = 0x00000000; *((volatile byte*)(Map_c + 0x251)) = 0x01; *((volatile unsigned short int*)(DMA_Related)) = 0x1F12; } else if (currentLevelMinimapSize == 0x01) { // 256x256 *((volatile unsigned int*)(Map_c + 0x1D8)) = 0x00000100; *((volatile unsigned int*)(Map_c + 0x1DC)) = 0x00000080; *((volatile unsigned int*)(Map_c + 0x1E0)) = 0xFFD44000; *((volatile unsigned int*)(Map_c + 0x1E4)) = 0x00000000; *((volatile unsigned int*)(Map_c + 0x1E8)) = 0x00000000; *((volatile byte*)(Map_c + 0x251)) = 0x02; *((volatile unsigned short int*)(DMA_Related)) = 0x5F12; } } |
Main - General SM64DS hacking - [Tutorial] How to Import Custom Minimaps | Hide post layouts | New reply |
Page rendered in 0.042 seconds. (2048KB of memory used) MySQL - queries: 27, rows: 107/107, time: 0.008 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |