News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Metroid 1 - Wiki Tutorials Section - Brainstorming Ideas

Started by Grimlock, April 14, 2015, 11:55:14 PM

Previous topic - Next topic

Grimlock

So I was thinking it might be nice to have a tutorial section for Metroid 1.  Snarfblam obviously has the "what everything does" section nailed down.  I was thinking of maybe producing some specific editing and designing tutorials, graphics editing, and level design geared toward M1.  Maybe layout my personal approach.  I already have a few tutorials written up in the M1 section.

Here's some possibilities in no particular order (feel free to add ideas for those interested):

Creating animations (with Tile Layer Pro, Tile Molester, and Editroid).
Creating complete (themed) graphic sets for M1 (my approach).
Working with bubbleless door scrolls.
Using guitar tablature as a source for Metroid Tuner.
Metroid Tuner tips and tricks (just some basic tips to consider while using the app).
General level design considerations (things like sketching and planning).
Level Design tips and tricks for M1/Editroid.
How to edit and customize in game sprites.
How to create you first M1 hack, step by step, go through Editroid features while editing an area
  (Maybe a video would be best)


I'm sure some of these might not be worthy of a dedicated page but I figured I'd list them since I'm just brainstorming right now. 

GF_Kennon

#1
I think Metroid Tuner could possibly get its own segment somewhere along the lines of metroid:metroid_tuner:pageshere, since you could probably write a fair bit about that program from what I hear.

A lot of these though could probably get their own pages though, could probably sort the guides under metroid:basic/advanced_guides maybe, probably need some more views on how to sort things, since the wiki creates a site map based on this.

Edit: http://wiki.metroidconstruction.com/doku.php?id=playground:metroid screwing around with this

NARFNra

I'm typing up a short guide on understand Metroid Tuner's format and how to simply insert songs and such, think I should post what I have up there?

[spoiler]
Understanding Metroid Tuner

This is a guide that's current under development. For now, it will be a simple description of the basics. More complex info will be added later.

It is suggested you have some basic understanding of NES audio before trying more advanced work. If just inserting and dumping songs, though, not too much effort is required.

-----Part A: Adding a prepared custom song-----

To dump a track in Metroid Tuner, simply open your rom, select the preset for the bank you want from the drop down menu, and press dump. Once you have the track dumped, it should consist of several parts headered by titles <Like this>. We'll go into that in Part B. If you just want to add a song, though, it's very simple.

===to do: guide to adding grimlock song===
-----Part B: Understanding song data-------
For the sake of this guide, we'll use the Brinstar theme as an example. It should be track A.

<Context>
[Bank:            1]
[SongTable:       BD31]
[VolumeTable:     BCB0]
[NoteTable:       BE77]
[NoteLengthTable: BEF7]

These just explain various pointers that we don't need to worry about, with the exception of the bank info.
Metroid's game data is organized into various "banks" of data. Editing one bank will never affect another bank. However, many songs have copies in banks where they never play, or copies in every bank as in the case of the item room music. An individual dump file, in its own tab, will always deal with only a single bank.

<Song>
[Song:            A]
[NoteLengthTable: 0B]
[TriangleLength:  00]
[Sq1VolumeTable:  2]
[Sq2VolumeTable:  3]
[Repeat:          True]

Here's where things get interesting. Note Length Table defines what note lengths in frames you can use in the song. Most of the songs in the game use Table 2, which is built for music in 4/4 time and referred to as 0B. There is also Table 1, referred to as 00 and built for 3/4 time, and Table 3, which I'm not sure on yet but is referred to as 17.

I'm not totally sure on how Triangle Length works, but it probably has something to do with the fact that the Triangle channel cannot change its volume and is either on or off. This needs more research, but as it is either 00, 0F, or F0, it likely has something to do with RAM Address 062D. According to the RAM map:
   062D        TriangleCounterCntrl    $F0=disable length cntr, $00=long note, $0F=short note
More research will be necessary.

The Volume Table settings apply only to the Pulse/Square tracks. For more info, consult appendix 1.1.

Repeat, amazingly, decides whether or not the song repeats.

Now we get into actual music data. This consists of four tracks; the two Square wave tracks, the Triangle track, and the Noise track. Some songs do not have all of these. Adding an entirely new track to a song is a little complex and is not yet covered here.

<Track>
[Song:    A]
[Track:   Square1]
[Address: B000]
[MaxSize: 57]
// Remove or update MaxSize tag to embiggen data (be ever so careful).

// Track length: ~ 45 seconds
// Track size: 87 ($57) bytes

Everything with a // before it is a comment and does not affect music at all. This will also not be saved into the rom once you reinsert the song, so it's mostly for your editing convenience. The [Address] tag defines where the song starts reading data; in this case, at location B000 in the bank defined in the <Context> block. This is very important in conjunction with the [MaxSize] tag, which is equal to how much space the track takes up at the moment of extraction.

In this case, the Square 1 track starts at address $B000, and continues on for $57 (or 87 in decimal) bytes until it finds a terminate flag at B057. Upon reaching a terminate command, the song will either end or repeat depending on the setting defined earlier. It does not matter if one track has a terminate flag 50 bytes ahead of another, the first terminate flag reached will restart the entire song. Often, when adding a new song, you will need to find unused data in the bank using the metroid disassembly.

Next is actual music data.

2 { // --------------
    :60
        B3 C4
} //   --------------

For pulse and triangle tracks, this is basically almost everything you'll be seeing. It's pretty simple.

2 {
something
}

Means that this will play twice.

:60

Means that the notes will be 60 frames, or one second long.

B3 C4

Means that the notes will be B3 followed by C4.

So this segment is just saying "Play B3 for sixty frames, then C4, then do it again."

And this goes on for the rest of the music. Things to note:
Loops can only loop something up to 64 times due to byte limitations, but it's unlikely you'd need to do more. Even so, you can just make another loop afterwards.
"-" defines a rest in the pulse and triangle channels.
The triangle channel cannot change volume like the pulse channels can. You can either put rests between notes, which costs a lot of space, or you can use the triangle setting mentioned above. I'm still not sure how it works, but as we can see in Brinstar:
    :18
        A#3
    :08
        A#3 F4 A#3
The A#3s would normally blend into one another, yet they're clearly separated. I'm still not sure on this, but it makes things easier.

Finally, the Noise track uses a variety of predefined sound effects instead of note names (loops and length still works as with other channels). The only real way to use this is experimentation, but there a good list by Grimlock here.
http://forum.metroidconstruction.com/index.php/board,6.0.html
Note that $14 is used for rests, so setting a song to loop long $14s is good when testing if you can't disable the noise channel.

-----
Appendix 1: Understanding Tables

=1.0= The Note Length Table:
This is probably the most important of the three table types. A note length table determines the possible lengths available for notes in a song, in frames. Note that the game runs at 60 frames per second (unless you're using a pal rom). The first two note tables are designed to make it easy to convert music in 3/4ths and 4/4ths time into Metroid. Note that, in the song data, Table 1 is referred to with using [NoteLengthTable: 00] and Table 2 is referred to using [NoteLengthTable: 0B]. I am not yet fully familiar with Table 3, but it is referred to as [NoteLengthTable: 17].

Table 1 is designed for 3/4ths time, as seen in Kraid's theme.

// Table 1, used by these songs: 3 9
04 08 10 20 40 18 30 0C 0B 05 02

02 - SIXTY FOURTH NOTE (48 can go in a 3/4 measure)
04 - THIRTY SECOND NOTE (24 can go in a 3/4 measure)
08 - SIXTEENTH NOTE (12 can go in a 3/4 measure)
10 (16 decimal) - EIGHTH NOTE (6 can go in a 3/4 measure)
20 (32 decimal) - QUARTER NOTE (3 can go in a 3/4 measure)
30 (48 decimal) - HALF NOTE (2 and a half can go in a 3/4 measure)
40 (64 decimal) - DOTTED HALF NOTE (1 and a half can go in a 3/4 measure)

Table 2 is defined for 4/4ths time, as seen in most of the music in the game.

// Table 2, used by these songs: 0 1 2 4 5 8 A B
06 0C 18 30 60 24 48 12 10 08 03 10

03 - THIRTY SECOND NOTE (32 can go in a 4/4 measure)
06 - SIXTEENTH NOTE (16 can go in a 4/4 measure)
0C - (12 decimal) - EIGHTH NOTE (8 can go in a 4/4 measure)
18 - (24 decimal) - QUARTER NOTE (4 can go in a 4/4 measure)
24 - (36 decimal) - DOTTED QUARTER NOTE (2 and a half can go in a 4/4 measure)
30 - (48 decimal) - HALF NOTE (2 can go in a 4/4 measure)
48 - (72 decimal) - DOTTED HALF NOTE (1 and a third can go in a 4/4 measure)
60 - (96 decimal) - WHOLE NOTE (1 can go in a 4/4 measure)

For more information, you can look at this thread;
http://forum.metroidconstruction.com/index.php/topic,3255.0.html

=1.1= The Volume Table: This defines "volume envelopes" for the Pulse tracks. Basically, these determine how loud an instrument's notes sound, as well as how they change over time. A track with no volume envelope will play at the same volume until it cuts off. A track with a volume envelope will change volume throughout the track until the end of the envelope, where it will either cut to zero or continue "sustaining", playing at the same volume until the note cuts off.

The NES volume is a hexadecimal number from 0-F (0-15). 0 is silence, F is loud as possible. Here is the first volume envelope in Metroid, as an example.


<VolumeTable>
[Table:   0]
[Address: BCBA]
[MaxSize: B]
// $B (11) bytes. Remove or update MaxSize tag to embiggen data (be ever so careful).
// 00-0F: Volume level, F0: End note, FF: Sustain note until next note

01 02 02 03 03 04 05 06
07 08 FF

This instrument will start very quiet (01) and rise until it is of medium volume (08), where it will continue until the note cuts off.
To increase the size of a volume envelope, you need to change the MaxSize byte. However, expanding a volume table will cut into the table ahead of it, so you shouldn't mess with this unless you know what you're doing (i.e. how to shorten and move the next table, or repoint it somewhere else).

There are 5 tables in the default game. In Metroid Tuner, these are defined at the start of a song under the <Song> section. Please note that table 0 is actually defined as "[Sq1VolumeTable:  1]", because setting volume table to 0 makes the instrument play with no envelope at all.

Setting constant volume requires hex editing and can have unwanted effects on other songs in the game.

=1.2= The Note Table:
The note table simply defines what each note in the game actually sounds like.

<NoteTable>
// Frequency of each note is ($1B503 / value).

07F0 0000 064E 05F3 054D 0501 04B9 0475
0435 03F8 03BF 0389 0357 0327 02F9 02CF
02A6 0280 025C 023A 021A 01FC 01DF 01C4
01AB 0193 017C 0167 0152 013F 012D 011C
010C 00FD 00EE 00E1 00D4 00C8 00BD 00B2
00A8 009F 0096 008D 0085 007E 0076 0070
0069 0063 005E 0058 0053 004F 004A 0046
0042 003E 003A 0037 0034 0031 002E 0027

Understanding this table requires a little understanding of how Metroid actually stores notes. Basically, every note in the table is given a specific number. When a note is called in a song, the music data actually simply contains a number. The game uses that number to look up which of the frequencies in this table should be played by the sound generator. I would advise not messing with this table unless you want to remove a note you aren't going to use at all, but be wary.

This is probably a good time to bring up the fact that the range of notes available in Metroid Tuner is limited to C#2-D7 and F7.
[/spoiler]

I plan to add an example of adding one of Grimlock's songs before posting it up. Also, to do more research on the Triangle control.

Grimlock

Looks like you have a lot of good detail written up, turning the track itself into a tutorial with notations was a good idea, I put something like that together for Optomon a couple months ago. 

You should mention and link to Snarfblam's blog and list it as prerequisite reading for your tutorial:

http://snarfblam.com/words/?p=282

You could just list it as an assumption like I did in my tutorials:

http://forum.metroidconstruction.com/index.php/topic,3255.0.html

I think you're on the right track (no pun intended or was it), it'll dive deeper into the gritty details and dark underworld of metroid tuner hack and slashing.

snarfblam

#4
Grimlock, I notice a couple of the things you've suggested you've already written on the forum. We can just transfer that right over to the wiki.

I copied my Metroid Tuner guide from my site to the wiki. While mine may be more complete, NARFNra's guide seems more... approachable. I don't know whether they should be merged somehow, or put up separately.

I also wrote a crash course for Editroid.

If there is something you guys want to add or edit, don't be afraid to jump on the wiki and start doing things and stuff. Pages don't have to super polished and perfect to go up there. We can always improve, fix, or revert pages later on. And either James or I will probably be on IRC if you have questions about DokuWiki.


Flower

Quote from: SuperMetroidSamus on July 01, 2019, 05:56:52 AM
I don't know what to say here
but that doesn't stop you from saying basically nothing.

In time, i wanted to expand on the MetroidTuner - Tutorial - stuff, now that you resurrected this thread. will happen anytime.

snarfblam

Quote from: SuperMetroidSamus on July 01, 2019, 05:56:52 AM
I don't know what to say here

Then don't say anything.

Pointless posts and necrobumps (posting to old topics without adding something new, relevant, and interesting) are against the rules. Your first two posts have been bad bueno. So start playing some newly released hacks and share your thoughts in their threads, or start your own hack and post your questions in Engine Works when you get stuck and need help figuring things out, or post your favorite song. Just try to make sure it's on-topic and worth saying.