Skip to content

Retexturing Models

Deijin27 edited this page Sep 5, 2022 · 5 revisions

Outdated guide, see https://github.com/Deijin27/RanseiLink/wiki/Map-Editing-Guide


This guide shows you how to retexture a battle map model using RanseiLink-Console-5.0-Beta

Using RanseiLink Console

This is just one way to use the console app. In command prompt.

Go to the folder containing the exe. Type cmd into the top bar and hit enter, this will open a command prompt in this directory.

Screenshot (37)

Then to run a command type in the console RanseiLink.Console <the command>. e.g.

image

1. With whatever tool you like, extract the map PAC file.

You could use the console command:

nds extract file "rom.nds" "graphics/ikusa_map/MAP00_00.pac"

Here I use nitro explorer 2b

image

2. Unpack the pac archive file

pac unpack "MAP00_00.pac"

See the files

  • nsbmd = model and materials
  • nsbtx = texture and palette
  • nsbta = texture uv animation. not present in all
  • nsbtp = texture pattern animation. not present in all
  • nsbma = material animation. not present in all

3. Extract model and textures

Extract by providing the folder containing the nsbmd, nsbtx etc.

nsbmd extract "c:\path\to\folder\containing\files"

See the extracted model (obj), material library (mtl), and textures (pngs):

image

4. Edit the textures

You can open the obj in blender File > Import > Wavefront (.obj):

Screenshot (34)

And view the textures on the texture paint tab:

image

The model is quite big, so it will likely look clipped. You can increase the clipping distance with View and turn on the sidebar, then on the View tab of the sidebar, increase the clip end.

image

Edit the textures as you wish, keep in mind you have palette count limits. In maps they use 256 color palettes for non-transparent images, and they use A3I5 for transparent images (32 colors, with 3-bit alpha channel stored per-pixel as opposed to in the palette).

The command simplify palette <imagePath> <maxColors> may help you simplify the image.

5. Create a new NSBTX

I'm working on getting the models importing. For now it's just textures that we can put back into the game. To do this:

nsbtx generate "c:\folder\containing\pngs"

The options --opacityFormat and --transparencyFormat have defaults correct for the maps, the ones mentioned earlier.

6. Recreate PAC

Set up folder as it was before, but with your new btx0

image

pac pack "c:\path\to\folder"

The command uses file order, and auto detects the file extensions to decide how to create the pac, so they need to be correct.

7. Reinsert the Pac into the rom

Reinsert with tool of your choice, or use command:

nds insert file "rom.nds" "graphics/ikusa_map/MAP00_00.pac" "c:\new\pac\file.pac"

8. Hope it worked

retexture_successful