We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

Quick Guide for Sprite Creation using Dynamic Z and Dyzen

From SnesLab
Revision as of 01:58, 23 July 2021 by Anonimzwx (talk | contribs) (→‎Insert Graphics and Dynamic Resources)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
English Português Español 日本語

This guide will explain step by step how to create a Dynamic Sprite from scratch using Dynamic Z (V3.75 or higher) and Dyzen (Version for Dynamic Sprites).

Dynamic Z Installation

First requirements

In order to make "Dynamic Z Installer.exe" or "Dynamic Resource adder.exe" work correctly, you must install:

  • dotNet Core 3.1[1]

Lorom

  1. Starting with a clean ROM, expand it up to 2MB in Lunar Magic. Make any modification and save it.
  2. Open "Dynamic Z Installer.exe".
  3. Select the features that you want to add to your ROM.
    Dynamic Z Installer 1
    • Graphics and Tilemap Change: It is used for any resource that requires changing graphics or tilemaps dynamically.
    • Dynamic Sprite Support: It is necessary to use conventional Dynamic Sprites. Requires Graphics and Tilemap Change.
    • Shared Dynamic Sprite Support: It is necessary to use Dynamic Sprites with shared memory. Requires Dynamic Sprite Support.
    • Semi Dynamic Sprite Support: It is necessary to use Semi-Dynamic Sprites. Requires Graphics and Tilemap Change.
    • Palette Change System: It is necessary to make dynamic palette changes.
    • HSL Support: It is necessary to perform color palette effects such as changing the Hue, Saturation or Lightness, also to mix a base color with the colors of the palette. Requires Palette Change System.
    • Player Graphic Change System: Allows changing the player's graphics both following the same graphics scheme as the original player, as well as making your own graphics routine for players of any size. RequireS Graphics and Tilemap Change.
    • Player Palette Change System: Allows changing dynamically player's color palette (Palette 8). Requires Palette Change System.

    Note: Both the Player Graphic Change System and Player Palette Change System (Player Features), have severe compatibility issues with resources that make changes to the player, such as LX5's custom power-ups, 32x32 Player Tilemap or 8x8 Tile DMAer. If you use resources similar to these, it is recommended to not select these features.

    After selecting the desired features, press the "Next" button. The features that are already selected don't have compatibility issues.

  4. Select your ROM. If you use Pixi, select the folder where pixi is located, and also if you use UberASMtool, select where UberASMtool is located.
    Dynamic Z Installer 2

    Then press the "Install" button.

    If you are using a Beta of Dynamic Z V3.75, after the installation is done, press the "Install" button again, repeating this step. This is a bug in the Dynamic Z V3.75 Beta, in the final or newer versions, this won't be necessary.

Note: After installing Dynamic Z, please put a copy of Asar in the same folder where the ROM is located.

SA-1

  1. Starting with a clean ROM, expand it up to 2MB in Lunar Magic. Then, don't do any modification in LM.
  2. Open the file "sa1.asm", in the line:
    !DSX		= 1
    

    Change it for:

    !DSX		= 0
    
  3. Install SA-1 using Asar.
  4. Open Lunar Magic and make any change in the ROM and save it.
  5. Open "Dynamic Z Installer.exe".
  6. Select the features that you want to add to your ROM.
    Dynamic Z Installer 1
    • Graphics and Tilemap Change: It is used for any resource that requires changing graphics or tilemaps dynamically.
    • Dynamic Sprite Support: It is necessary to use conventional Dynamic Sprites. Requires Graphics and Tilemap Change.
    • Shared Dynamic Sprite Support: It is necessary to use Dynamic Sprites with shared memory. Requires Dynamic Sprite Support.
    • Semi Dynamic Sprite Support: It is necessary to use Semi-Dynamic Sprites. Requires Graphics and Tilemap Change.
    • Palette Change System: It is necessary to make dynamic palette changes.
    • HSL Support: It is necessary to perform color palette effects such as changing the Hue, Saturation or Lightness, also to mix a base color with the colors of the palette. Requires Palette Change System.
    • Player Graphic Change System: Allows changing the player's graphics both following the same graphics scheme as the original player, as well as making your own graphics routine for players of any size. RequireS Graphics and Tilemap Change.
    • Player Palette Change System: Allows changing dynamically player's color palette (Palette 8). Requires Palette Change System.

    Note: Both the Player Graphic Change System and Player Palette Change System (Player Features), have severe compatibility issues with resources that make changes to the player, such as LX5's custom power-ups, 32x32 Player Tilemap or 8x8 Tile DMAer. If you use resources similar to these, it is recommended to not select these features.

    After selecting the desired features, press the "Next" button. The features that are already selected don't have compatibility issues.

    Select your ROM. If you use Pixi, select the folder where pixi is located, and also if you use UberASMtool, select where UberASMtool is located.

    Dynamic Z Installer 2

    Then press the "Install" button.

    If you are using a Beta of Dynamic Z V3.75, after the installation is done, press the "Install" button again, repeating this step. This is a bug in the Dynamic Z V3.75 Beta, in the final or newer versions, this won't be necessary.

Note: After installing Dynamic Z, please put a copy of Asar in the same folder where the ROM is located.

Insert Graphics and Dynamic Resources

After installing Dynamic Z, in the ROM folder you will find a tool called "Dynamic Resource Adder.exe" (DRAdder). This tool is used to insert dynamic resources into the ROM. Although its use is not mandatory (since a dynamic sprite could decide to use another way to insert these resources into the ROM), it is recommended, since, in this way we have better control over these resources, and also it avoids extra patches usage, in addition to the fact that the resources are tried to be inserted in the banks greater than $40 (if is possible), and that it is quite easy to import these resources.

  1. Add the dynamic resources into the "Dynamic Resources" folder. These resources can be graphics, color palettes (in ".bin" files) or tilemaps.
  2. Open the file "ResourceList.txt", and you will see something like the following:
    PIXI:
    .Normal
    .Cluster
    .Extended
    OTHER:
    
  3. For sprites, add to the correspondant labels the name of the ".asm" sprite file. For example:
    PIXI:
    .Normal
    Klaptrap
    Klump
    Gnawty
    Krusha
    SigmaX2
    SMM2BulletBill
    DKCBarrel
    DKCFire
    .Cluster
    DKCContactEffect
    DKCExplosion
    DKCVerticalSmoke
    DKCHorizontalSmoke
    .Extended
    KlumpGrenade
    OTHER:
    
  4. For non sprites resources, such as an uberasm code, a patch, or a block, you can use the label "OTHER:" adding the file path. For example:
    PIXI:
    .Normal
    Klaptrap
    Klump
    Gnawty
    Krusha
    SigmaX2
    SMM2BulletBill
    DKCBarrel
    DKCFire
    .Cluster
    DKCContactEffect
    DKCExplosion
    DKCVerticalSmoke
    DKCHorizontalSmoke
    .Extended
    KlumpGrenade
    OTHER:
    .\Patches\Player Revolution\Players\NSMBPlayer.asm
    
  5. Open "Dynamic Resource Adder.exe" (DRAdder), write the path the program asks you. If asks for Pixi folder, drag the Pixi folder. If asks for the ROM, drag the ROM, etc. Alternatively, it can be used in console with the command:
    DynamicResourceAdder <rom name.smc> <resources list.txt> <pixi folder>
    

To use this tool, the file that imports the dynamic resources, in the first line of the code you must include all the resources you use, as follows:

;@<Resource 1>,<Resource 2>,<Resource 3>, ...

For example, Klaptrap uses 5 different palettes and its graphics. If you see the first line of the sprite code, it is:

;@Klaptrap.bin,KlaptrapPal1.bin,KlaptrapPal2.bin,KlaptrapPal3.bin,KlaptrapPal4.bin,KlaptrapPal5.bin

Then, each one of these resources can be referenced using the defines "!GFXYY", where YY is the number of the resource, for example:

  • !GFX00: Reference to the first resource.
  • !GFX01: Reference to the second resource.

etc.

If I wanted, for example, to obtain the BNK of the first resource, I would use:

#!GFX00>>16

For the High Byte would be:

#!GFX00>>8

And for the Low Byte would be:

#!GFX00

How to make graphics for a Dynamic Sprite?

You can use any image editing program to make the graphics. The graphics must fulfill the following conditions:

  • Maximum colors amount to use is 15.
  • The background must be transparent (color 00000000).
  • Please note that the colors in SNES use RGB555 color format, therefore it is recommended that the RGB channels of the colors end in 0 or 8.
  • Don't make too big graphics, please note that after the optimization the tiles must fit in an 128x32 available space at maximum (128x48 if you use 50% more mode).
  • Graphics must follow a sprite sheet format, in which each frame uses the same size and can't have empty frames.

Example:

DKC Contact Effect

Programs such as aseprites let you work with each frame indivually, and then export it as a spritesheet with the options "File->Export Sprite Sheet".

How to center the sprite in order to fit the object clipping desired?

In many image editors you can create grids for guidance. In aseprite, the grids are 16x16 size by default. The first step is to make the size of the sprite canvas 16*n x 16*n, in which n = odd number. For example: 16x16, 48x48, 80x80, 112x112, etc.


Then, the center square of the canvas will be equivalent to the darker square showed in the CFG Editor.

Central Square

Therefore, you must adjust the position of the graphics, in order to fit it with the square shown in the CFG Editor.

Dyzen for Dynamic Sprites

First Requirements

In order to make Dyzen work correctly, it requires:

  • dotNet Framework 4.8 [2]

Performance

When opening Dyzen you will see the following message:

Dyzen New Project

Since we will make a dynamic sprite, we will press the "Dynamic Sprite" button.

After that, we can see 3 main sections:

  • Frames: In this section, you can make each frame of the sprite.
  • Animations: In this section you can make each one of the sprite animations.
  • Interaction: In this section you can make the sprite hitboxes.

Starting from the Frames section, you will find the "Load Sprite Sheet" button. By pressing it, this window will pop-up:

Dyzen Sprite Sheet Ripper 1

In this screen, first of all we will set the canvas size previously used to create the frame. Then, we will press the button "Load Sprite Sheet", we will select the sprite graphics and then we will select a color palette. Then, we will press the button "Load From Sprite", and then the "OK" button, and this window will pop-up.

Dyzen Sprite Sheet Ripper 2

... WIP