Skip to content

DEV: Creating Models

Llennpie edited this page Dec 19, 2022 · 15 revisions

This guide will explain the fundamentals of creating a Saturn-compatible model, as well as adding color code and/or CometSPARK support.


Table of Contents


Requirements

Basic Setup

To export models for usage in Saturn, you will need to configure Fast64 to export to C. You can do so by navigating to SM64 -> SM64 File Settings -> Export type and set to C.

You do not need to specify a ROM, Decomp folder, or any other file path.

In SM64 Geolayout Exporter, enable Custom Export Path and set the Directory to your model's folder (e.g. <path_to_build_folder>/dynos/packs/CustomMario). Set Folder Name to mario and Geolayout Name to mario_geo.

Once finished, select your armature and press Export Armature Geolayout. Relaunch Saturn and the model should appear in the Model Packs list.

Adding Metadata

As of 2022-08-14, Saturn now uses a model.json file to store basic model information. This includes the model's name, author, version, and whether or not it supports color codes and/or CometSPARK lights.

This isn't necessary to use models, but is required for the below sections.

model.json

Each model.json file must be placed in the model's root folder (dynos/packs/<ModelFolder>/model.json).

Adding Color Code Support

Saturn models can also support color codes. Saturn identifies a color-codable part based on it's shade color value. Each part follows Mario's vanilla colors, except the gloves, which are solid green. This was done to avoid texture lighting issues.

To add color-codable limbs, simply edit a Fast3D material's Light color to use one of the following hex codes:

Hat - #FF0000
Overalls - #0000FF
Gloves - #00FF00 (green)
Shoes - #721C0E
Skin - #FEC179
Hair - #730600

Color code support can be enabled/disabled by changing cc_support in the model.json file.

Extra CometSPARK Lights

Saturn also has support for CometSPARK GameShark codes, allowing 6 more color-codable Lights to be used in a model.

Shirt - #FFFF00
Shoulders - #00FF7F
Arms - #00FF7F
Pelvis - #FF00FF
Thigh - #FF007F
Calf - #FF007F

CometSPARK support can be enabled by setting spark_support to true in the model.json file.

Adding a Default GameShark Code

You can add a default GameShark (.gs) code to your model, which can be enabled from within the editor. This is recommended for models that have an intended color palette (such as Luigi or Sonic).

Simply place a GS file (.gs) in the model folder and rename it to default.gs.

Once set, you can test in Saturn by right clicking your model in the model packs list and selecting Set Model CC.

Adding Expressions

Saturn models support up to 8 texture "expressions" for users to customize. These can be eyes, sideburns, eyebrows, sunglasses - you name it, and they can be changed at runtime.

In Blender, create a new Fast64 material for each expression you want to add. This next step is arguably the most important - The texture's file name (not the material name) must contain the keyword saturn_<expression>, where <expression> is the name of your expression. This can be saturn_cape_asdanhfdfd or saturn_eye_blahblah, as long as it contains that keyword.

image

Next, create a folder inside your model's folder called expressions/. Inside that folder, create one folder for every expression, named after the keyword you specified above. For example, dynos/packs/<ModelFolder>/cape/. You can place as many PNG files as you want in these folders, and Saturn will swap them out accordingly.

For eye textures, we make one small exception:

Eyes

As Mario's blinking state consists of 3 looping textures, Saturn makes use of Mario's unused "left" eye state for custom eye expressions.

In Blender, enter Pose Mode and highlight the 000-switch.001 bone (see below image).

image

Select Switch Option 3 (the left eye state) and assign a Material Override. We overwrite Mario's neutral expression with the eye material we defined earlier.

You can now set material overrides for each switch option (e.g. Switch Option 3 is left, we overwrite Mario's neutral expression with our new custom saturn_eye_blahblah material we defined earlier).

image

After exporting, select CUSTOM... in the Saturn eyes dropdown. If your eyes get swapped, you've set this up successfully!

image

As a side note, if an eyes/ folder is not present in expressions/, Saturn will use the dynos/eyes/ folder instead - This is helpful if you don't want model-specific eye textures!

(OPTIONAL) Checkboxes

Optionally, if you have an expression that's just "on" and "off", you can choose to have it displayed as a convenient little checkbox instead of a dropdown.

image

Getting these set up is easy - just rename your 2 textures to default.png and none.png.

image

If you wish to reverse these (checkbox disabled by default), you can use the filenames 0-none.png and default.png so none appears first alphabetically.

Adding Customizable Textures

By default, textures will be embedded in the model.inc.c file. Note that this does not remove or "bypass" copyright restrictions, it just reduces file sizes and makes textures harder to edit. However, you can also choose to export textures as easy-to-edit PNG files.

To export textures alongside a Saturn model, navigate to Fast64 -> F3D Global Settings and enable Save Textures.

In each Fast3D material, make sure the Format is NOT set to Color Index. These will break in DynOS! I suggest using RGBA 16-bit instead.

And finally, before exporting, verify that Save texture.inc.c separately is disabled as it is incompatible with DynOS.

Exported models should now contain editable PNG textures. Note that after each model/texture edit, the mario_geo.bin file must be deleted (and Saturn relaunched) to reset the cached modeldata.

Protecting Models

The mario_geo.bin file may be distributed without needing to include mario/ folder. This file contains pre-cached model data, which restricts it from editing. In a way, this allows model authors to "protect" their models from being modified directly.

NOTE: If you have copyrighted/vanilla textures in your model, it WILL STILL BE included in the mario_geo.bin file. Be careful on distributing them publicly! (gg Nintendo)

Clone this wiki locally