Jump to: navigation, search

Editing N3S Files

Revision as of 13:38, 28 June 2017 by Admin (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

What sets N3S apart from other NES emulators is it's ability to render 3D (voxel) models in place of 2D sprites. However, those 3D models need to be created by a third-party first. This process is detailed below.


N3S allows you to render 8x8x32 voxel meshes in place of 2D sprites in NES games.

Converting a 2D NES game to 3D in N3S follows this workflow:

  • Identify a game that would work with this process
    • If a game implies a large amount of depth or extreme perspective, such as the large streets or floors seen in games like Double Dragon, it probably won't look right in N3S.
  • Generate the flat voxel meshes from the original 2D data
    • This is easy if the game stores graphics uncompressed in CHR sections in the ROM. Other methods are being developed for games that don't.
  • Arrange all graphics into scenes and examine
    • Define a voxel art style that will work consistently across the game
    • Identify sprites that are re-used and take multiple uses into consideration.
  • Sculpt the sprites in 3D

Identifying a Game

The first step is finding a game you'd love to play with a 3D art style, and making sure that it will actually work with N3S.

As mentioned previously, games with an extreme sense of perspective or depth won't look good in N3S. To help explain why, here are some technical considerations:

  • N3S sprites are 8 x 8 x 32 voxels.
    • That's 32 voxels deep, or going towards / away from the player.
    • This gives a relatively small window for things to be near / far.
  • Most NES games use the same sprite when drawing a large, flat, surface that is angled towards or near the player. N3S cannot easily distinguish which is "near" or "far" and cannot replicate that sense of depth.

Generating Initial Models

N3S will generate "flat" (1-voxel deep) 3D models from NES ROMs whenever possible. These will let you play the game in 2D, and are perfect starting points for sculpting truly 3D models. Generating 3D models from compressed ROMs (or ROMs that just store graphical data in PRG memory areas) is currently unsupported.

Once you have generated this data, you should save it to an N3S file.

The N3S File Format

N3S data is stored in a very straightforward file format using JSON. This allows for easy versioning if you want to publish your work or collaborate on something like GitHub.

The Editor

The editor has two main components: the scene editor and the voxel editor.

Scene Editor

Since NES sprites are only 8x8 pixels, most graphics are composed of several, and identifying them individually is very difficult. To help with this, N3S allows you to create and save 16 scenes, which are arrangements of sprites in a space that is 2x2 NES screens (512 x 480 pixels) in size. Scenes are extremely useful for organizing sprites in ways that make them easy to edit and compare, much like a sprite sheet.

If you've decided to tackle converting a game to 3D, the first thing you'll want to do is collect all the graphical assets into logical partitions within these scenes. The easiest way to do this would be to play the game, likely leveraging save states and invincibility hacks (neither of which are currently supported), and utilizing the VRAM scene that is generated automatically each time you enter the editor.

The VRAM scene represents exactly what is in the NES PPU memory when you switch to the editor. You can easily copy+paste large sections of levels or individual sprite animations into your scenes. (If you cannot find sprites in-game or want to see if you're missing any, you can also use the CHR page function to tab through every single sprite in chunks of 256.)

Each scene also has 8 palettes, which each contain the 24 colors (plus background color) used by the PPU at any given time. An author can use these 8 palettes to show variations within a single level or different colors for certain characters.

How to partition game assets into scenes is ultimately up to the author of the N3S file, but here's a recommended approach to something like Super Mario Bros:

  • 1
    • Title screen
    • Live count / level number / "intro" screen
    • All letter + number "font" sprites.
  • 2
    • First level "overworld" style, including blocks, castle, pipes, etc
    • All Mario sprites
    • All generic enemy sprites
    • Powerups
    • Palettes for Mario / Luigi colors, black background from later levels, 3 different "glow" colors of blocks / coins
  • 3
    • Underground level + colors
  • 4
    • Mushroom / bridge level + enemies
  • 5
    • Latter overworld levels with fences, trees, spring jumps, etc.
  • 6
    • Underwater level
    • Fish enemy sprites
  • 7
    • Castle levels
    • Bowser / Toad / Princess sprites.
    • Ending scene

Voxel Editor

The voxel editor itself is where the 3D models get defined. It allows you to place blocks of any color within each sprites 8x8x32 area. It is entered by clicking on a single sprite that is already individually selected within a scene. You can back out of it by pressing ESC or clicking the back button.

Voxels are placed along a "plane", which is always facing the camera. The axis that you are drawing on, represented by a wireframe grid can be changed by rotating the camera. You can set the depth you are drawing at.