It’ll End in Tiers

For about six years now, I’ve been on-and-off modding Guitar Hero II. While the other kids have run off to all their Soundcloud default dance Mach A meme charts, I’ve been in my premature old man bubble, chasing a, ahem, pure modding experience with my plastic guitars, ahem, thank you.

In any case, my big project this entire time has been the exact same: building a custom disc that’s a sorta Smash Hits-if-Smash Hits-wasn’t-a-pile-of-shit, essentially. Lifting songs, character models, and bits of text from all over the place, mostly latter Rock Band games, but also from 1, 80s, and the II demos a bit. In its most recent form, I’ve also been trying to port the 360-exclusive songs back over to the PS2 version, because to my knowledge, no one’s done it quite yet.

That’s where today’s mini-adventure happened. Rewind to last Wednesday somewhere in MiloHax.

[12:51 PM] marf: i think the only thing i've really wanted is to get six songs to a tier in gh2 ps2
[12:51 PM] H: The tier system acts weird when you mess with how many songs are in each one.
[12:51 PM] Clippit: awh I thought that'd be doable :T
[12:51 PM] marf: how so?
[12:52 PM] skylerinman: I tried on 360 and the game did not like it lmao
[12:52 PM] marf: that's 360
[12:52 PM] H: I never did a ton but I remember people having problems with encores not working right, getting blocked at a tier because it didn’t think enough songs had been completed, etc

To explain for anyone who doesn’t play Guitar Hero, in Career mode, you play 4-5 songs in each tier, the first tier being the easiest songs in the game. Beat the required number of songs in a tier, and you unlock a new venue and a harder batch of songs to wow virtual people with. Because of all the extra space on a dual-layer DVD (read: an Xbox 360 DVD), Harmonix added in an extra song per tier to the 360 version, meaning the setlist went from 40 main songs (eight tiers, five to a tier) to 48 main songs.

I didn’t see a reason for this stuff not to work, so curious about Scott’s warnings, I quickly grabbed the files for the 360 exclusives from the first two tiers and set about porting them over, setlist order and all.

The golden rule of Guitar Hero II modding is that nothing is documented. You are 100% on your own with an engine you weren’t meant to play with and tools someone wrote circa-Windows Vista. This also means that a lot of what was cast off to “not work” is actually quite workable, someone just overlooked a setting. That’ll become important later.

Adding arbitrary files is simple with ArkTool (although I don’t recommend it because the UX is beyond terrible), and aside from the audio (PS2 uses VGS files, while the 360 uses MOGGs), song files are interoperable between the consoles. So far, so good.

ArkTool's GUI
You see how all the folders have shortened song names? That shortname will become relevant in a moment, it’s really neat how they work.

To get a new song working in the game, aside from just dropping in the necessary files (a VGS and a MIDI are the bare minimum; nice extras include a VOC file for the singer’s mouth if you got one and the practice mode VGSes if you built those), you need to add a new song definition to songs.dtb. This is the internal DTB (script) that defines the song title, artist, whether it’s a cover or a master, audio pans and levels for the main VGS and the three practice mode VGSes, the MIDI file to use, quickplay settings for guitarist, guitar and venue, and the song’s preview codes (written in MIDI ticks).

Still with me? Cool. Untokenized, this is what that script looks like.

   "Possum Kingdom")
  (caption performed_by)
   (name songs/possum/possum)
      (2 3))
     (bass 4)))
    (-1.0 1.0 -1.0 1.0 0.0))
    (-1.5 -1.5 -2.0 -2.0 -1.0))
    (-1 -1 1 1 -1))
   (midi_file songs/possum/possum.mid))
  (anim_tempo kTempoMedium)
  (preview 40000 60000)
   (character_outfit alterna1)
   (guitar sg)
   (venue battle))
   (100 85 65 50))

That first line defines the song’s internal shortname. What I find really neat is that the setlist in the game isn’t hardcoded; it’s all scripting. Totally new songs, ones with new shortnames and new definitions, are completely possible with our current knowledge. It all comes down to having a folder in the files for the song and then the definition to tell the game about it. A surprising amount of Guitar Hero II is scripted. Everything from calling menus and text popups to cheats to strings to setting gameplay variables like “visible HUD” and “autoplaying notes” is done in a DTB script, and cheats can be written to let you change this stuff on-the-fly. It’s metal as fuck.

We’re not done yet though. To get the song loaded in the setlist requires a second DTB, this one being campaign.dtb. It’s each tier and a list of shortnames for the songs that make up that tier, plus the required number of songs in each tier, and then the cash rewards you get per-difficulty for beating songs in Career. Here’s what the first three lines of the stock campaign.dtb look like:

  (battle shoutatthedevil mother surrender woman tonightimgonna)
  (small1 strutter heartshapedbox messageinabottle youreallygotme carryonwayward)

To get the 360 order working instead, it becomes this:

  (battle surrender possum heartshapedbox salvation strutter shoutatthedevil)
  (small1 mother lifewasted cherrypie woman youreallygotme tonightimgonna)
Blank spaces in GH2's setlist
Blank spaces in Guitar Hero II’s setlist always means trouble (and an incoming crash).

When I initially built the ISO and tested this, something was going wrong. Having blank spaces in the setlist means the game isn’t loading the definition from songs.dtb at all and thus crashing when it goes to play the preview audio or really do anything with the song other than have it exist on-screen. In PCSX2’s console, you’ll start getting a shitton of what are called “TLB misses”, which in the context of the emulator means the thing it wants isn’t in memory and it ultimately segfaults and crashes the game.

Issue was, I couldn’t see a reason why these songs wouldn’t appear in the setlist. I had three perfectly good extra song definitions in songs.dtb (definitions I was using just fine on my personal custom disc), but the game just wasn’t seeing them. I thought I fucked something with campaign.dtb, so I reverted back to the stock one, got the game going again, added “Possum Kingdom” back to the setlist and started getting blanks and crashes again.

That’s when it hit me, and that’s when this got a lot more arbitrary: songs.dtb is grouped by type of song (so main setlist tracks on their own, bonus tracks on their own, and then tutorial audio on its own) and then alphabetized based on that. I’d thrown these definitions at the tail end of the file, and it wasn’t seeing them.

A setlist working with six songs to a tier
The eagle-eyed among you might notice the “Beat 5/4 songs” down there. Harmonix literally wrote that string to always be out of four tracks. This is easily fixable with a bit in locale.dtb, I just didn’t bother since this was a proof of concept.

Without changing a single line of DTB, merely moving the definitions to earlier in the file, it started working. This is what I mean with this game. Modding it is not for the faint of heart. Another ISO build to pad out the audio for “Salvation” later (there’s a soft lockup that happens if the audio ends before the chart, and this occurs on some of the 360 exclusives >_>) and everything was dandy. Even encores worked perfectly fine, occurring on the final track of the tier regardless of if the tier contained five or six.

One final bit of housekeeping involves the end of the setlist background, where the visible bit of paper ends but the setlist over top it continues. This is something one of the guys in MiloHax is working on fixing; we have the technology to fix the extra tracks onto a disc, I know that much.

Scott clarified the main issue after I got this working, which was having a disparate amount of songs from tier to tier:

[4:02 PM] H: And it’s all just based on memory and might be buried somewhere on SH but I wanna say the problem with disjoint tier sizes was that it would mess up encore handling and sometimes would get stuck in a tier without enough songs

I didn’t expect having varying numbers of songs to a tier to work anyway, honestly. Would probably confuse the game. My goal was just to extend out the tiers to 360 length, and in that respect, it was a total success.

Leave a Comment