Romhacking.net

Romhacking => Newcomer's Board => Topic started by: M-Tee on January 04, 2014, 02:04:43 pm

Title: M-Tee's NES Graphics Workshop
Post by: M-Tee on January 04, 2014, 02:04:43 pm
Introduction
         This post begins a low-learning curve workshop in which I will walk through the steps of creating fairly extensive graphical modifications of an NES game, from setting up a workspace through publishing your completed work through RHDN. Aside from beginners, this should reveal some tips & tricks for more experienced folk, as well as provide a solid foundation for those interested in producing NES-era graphics for other purposes such as indie game design or animation.
   This workshop will reflect my process, which has modified over time through trial and error. It is not how everyone works; therefore, I fully encourage feedback on the effectiveness of my process and explanations.
     Also, keep this thread in mind anytime someone comes around asking those über-newb questions or obviously trying to bite off more than they can chew for their first project. (I certainly would have benefited from the same advice when I first came around.)

Table of Contents
(will be updated with each new addition)
Getting Started (http://www.romhacking.net/forum/index.php/topic,17513.msg254621.html#msg254621)
Setting Up Your Software (http://www.romhacking.net/forum/index.php/topic,17513.msg254660.html#msg254660)
Customizing Your Photoshop Workspace (http://www.romhacking.net/forum/index.php/topic,17513.msg254720.html#msg254720)

Getting Started
     To begin with, you will need to acquire the programs and files with which we will work. Download and install the following files, and organize them into an easily accessible directory. (Unfortunately, most of the tools of the trade are Windows-only, so we will be working in a Windows environment. For others, I apologize. )
     Next, if you don't have access to web hosting, I suggest signing up for an account through TinyPic (http://www.tinypic.com) to be able to upload and post your screenshots of work-in-progress.

Selecting a Game
     The purpose of this workshop is to modify a game. Therefore, you need to select one and come up with an idea for your hack. I'm sure you've already got some totally awesome hack in mind. Now is not the time for it. Now is the time to choose a simple game so that we may produce a thorough and complete hack in a reasonable amount of time. The confidence and experience you will gain by doing so will enable you to handle larger projects better.

Therefore, browse this list of mapperless NES titles (http://files.mteegfx.com/Mapper0GameList.txt) (they are the smallest and best-suited for instruction). Youtube the titles to watch gameplay and brainstorm some ideas for hacks. Keep in mind the scope of the changes you will be making will be complete graphics and text. (This workshop will not cover music and programming behaviors, primarily because they are skills not in my repertoire.)  Once selected, use your own ingenuity and the worldwide web to acquire the rom.

Next Up: Setting Up Your Software (http://www.romhacking.net/forum/index.php/topic,17513.msg254660.html#msg254660)
Title: Re: M-Tee's NES Graphics Workshop
Post by: VicVergil on January 04, 2014, 04:13:58 pm
Actually, I do have some degree of knowledge in the matter, since FCEUX does all the work (Discovered the map viewer recently only recently :P I'd prepare a pic like this
(https://dl.dropboxusercontent.com/u/144606983/numbered%20tiles.png)
 and paste it with a tile editor in place of that particular 16x16 pattern table loaded (or part of it) then write down all of it manually :P
Anyways, later it's the same, I just look the PPU hex code sequence for that particular tilemap in a ROM search and I modify manually with hex editors. That part is tedious though, do you know of any tool that could automate it ? :P

Besides, I'm totally in the black when it comes to altering the palette for a given part of the title screen.
I'd be interested in learning how to alter palettes.

That aside, do you have a trusty tool/emulator that has similar options for SNES games?
Title: Re: M-Tee's NES Graphics Workshop
Post by: naxis on January 04, 2014, 05:42:55 pm
Are you planning to do something similar for the SNES? I sure could use a workshop on that.
Title: Re: M-Tee's NES Graphics Workshop
Post by: M-Tee on January 05, 2014, 04:59:53 am
Setting Up Your Software
     Now that everything's downloaded and installed or organized, you'll need to adjust the settings for your programs across the board. Although you're certainly not obligated to follow the same setup I have, by understanding why I've chosen it, you can wisely choose your own.

FCEUX
(NOTE: I generally use NEStopia  (http://nestopia.sourceforge.net/)(a different emulator) to play games for pleasure. That way, I am able to test hacks on two emulators, and can set up FCEUX settings such as zoom and directories primarily for these purposes with different settings in NEStopia for entertainment.)

Open FCEUX and address the following settings:
Palette Controversy
(http://files.mteegfx.com/nesPaletteComparisonB.png)
(http://files.mteegfx.com/nesPaletteComparisonA.png)
(http://files.mteegfx.com/nesPaletteComparisonC.png)

     Above is a series of screenshots taken of commonly used palettes. I have added the hex codes for each color above it. (The NES has a palette consisting of 64 colors, each represented by a two-digit hex value. More on that later.)

Points of Contention

YY-CHR
     The version of YY-CHR you use affects color assignment when pasting from outside sources. The colors in the hex chart I've included have been pulled from the photoshop swatches file that accompanies. Those colors paste accurately into the version of YY-CHR linked in the OP as colors 0, 1, 2, and 3 respectively (more on that in the later). Older versions have required more drastic contrast such as pure 255 red, green, blue, and black.
     Also, if your system language is not English, YY-CHR will attempt to display its interface in your system language. This is corrected with a filename change, explained in a text file included with the program.

Next Up: Customizing Your Photoshop Workspace

Quote from: GHANMI
Actually, I do have some degree of knowledge in the matter, since FCEUX does all the work (Discovered the map viewer recently only recently :P I'd prepare a pic like this

...

 and paste it with a tile editor in place of that particular 16x16 pattern table loaded (or part of it) then write down all of it manually :P
Anyways, later it's the same, I just look the PPU hex code sequence for that particular tilemap in a ROM search and I modify manually with hex editors. That part is tedious though, do you know of any tool that could automate it ? :P

Unfortunately, I do not have a method to automate the typing of the hex. However, I do have some pointers for identifying the addresses. The hex chart which I use (and is included in the Graphics toolkit (http://files.mteegfx.com/Graphicstoolkit.zip) link) is as follows:

(http://files.mteegfx.com/hexChart.png)

Although not easy to read now, when pasted from Photoshop into the version of YY-CHR available in the OP, the white acts as color 0 (transparent), first digit displays as color 1, the underline as color 2, and the second digit as color 3. Meaning that the chart not only provides you information of what tile is being used, but what palette is assigned where.  Essential information when palettes may share a color or more, which is very common.

Quote from: GHANMI
Besides, I'm totally in the black when it comes to altering the palette for a given part of the title screen.
I'd be interested in learning how to alter palettes.

As for background palettes, you'll want to find information on the PPU and on Attributes. You can search and track that info down (there is good documentation available), or wait until I cover the topic further down the road (it is on my agenda).

Quote from: naxis
Are you planning to do something similar for the SNES? I sure could use a workshop on that.
Quote from: GHANMI
That aside, do you have a trusty tool/emulator that has similar options for SNES games?

I haven't tried any SNES romhacking since high school, more than decade ago. Quite frankly, it doesn't interest me. The limitations of the NES visuals are what attract me so strongly to the hobby.
Title: Re: M-Tee's NES Graphics Workshop
Post by: VicVergil on January 05, 2014, 05:38:27 pm
I heard that Nintendo did have arcade machines that supported RGB palette output, so they do have a fixed color value for each. Wouldn't that one be the "official" palette?
Title: Re: M-Tee's NES Graphics Workshop
Post by: M-Tee on January 06, 2014, 02:57:19 am
Customizing Your Photoshop Workspace
     Some may oppose the heavy reliance on Photoshop this workshop will have (I suspect roughly 50%). However, I feel that it is essential for efficiency to produce graphics in an external program with a customizable palette, layers, and basic animation features. I build and preview everything in Photoshop and then import it through YY-CHR. I suggest version CS4 or newer (CS4 introduced an optional pixel grid at 500% or more zoom, very useful for our purposes.)
     I understand that GIMP and Paint.net both have large user bases, are legally free, and I'm sure for most purposes, will suffice. However, I'm 15+ years into Photoshop for school, personal, and work purposes though, so I will be unable to provide assistance specific to free alternatives.

Customizing Your Workspace
(http://files.mteegfx.com/gw006.png)

(Click for full size)
TIP: The above settings for text will produce characters that take exactly one tile each. Useful for judging how many characters can fit within an area.


   We will build a custom workspace (arrangement of windows, keyboard shortcuts, and settings) for NES graphic work. First, we need to decide which windows (aka panes) are useful for us and how to organize them on the screen. Click and drag them to combine or dock where necessary. The following is my layout:
Preferences, Options & Shortcuts
   The following are preferences and tool options to optimize Photoshop for tile-based pixel work. Many of which counteract anti-aliasing, the blurring that occurs when scaling or transforming images, which can prove to be majorly frustrating when unwanted.

Change the following settings through Edit>Preferences:
Select the following tools to change their options:
Through Edit>Keyboard Shortcuts, set up the following keyboard shortcuts to replace nonexistent or inconvenient defaults:
Other Useful Shortcuts to Know
(Press shift + the letter to cycle through nested tools.)
Once you have everything to your liking, minimize all panes and in the Workspace dropdown near the top-right (by default, I believe it says Essentials), and select New Workspace..., check both options, then give it a suitable name.

Next Up: Viewing and Understanding NES Graphics


I heard that Nintendo did have arcade machines that supported RGB palette output, so they do have a fixed color value for each. Wouldn't that one be the "official" palette?


That would be the PlayChoice-10. Thanks for bringing it to my attention, I've updated the palette images in the post to represent it. It can be seen in NEStopia's RGB palette as well as Nintendulator's PC-10 palette pictured. If the goal were to emulate that system, then it would be the "official" palette. However, there are known discrepancies between it and what would would typically be seen from a normal home console hooked up to a television. 

Nevertheless, defending a specific palette was not my intention. Know that when you release your patch, it will inevitably get a couple of hundred downloads. Those people will be using an assortment of palettes. My goal is to bring the differences between these palettes to attention, so that you can work with all of these limitations and strengths in mind, knowing that if you use color x, it could appear as x, y, or z to different users.

EDIT: I also noticed while double-checking these palettes that blue 23 color in FCEUX was corrected with v. 2.2.0 in Nov. of 2012. Therefore, it should not be an issue anymore, making FCEUX's default palette an acceptable choice. Previous Post updated.