Register - Login
Views: 99790423
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 03:43:29 AM
Jul - Posts by KCat
Pages: 1 2 3
KCat
Member
Level: 15


Posts: 1/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 11-10-13 07:14:44 AM, in Star Fox Adventures E3 2002 prototype (5/17/02) Link
Originally posted by koolaidman
2.) Using N64 Sound Tool and MIDI Tool, I was able to extract all the data necessary to recreate the music.
3.) The sequence data was converted to MIDI, while the samples from MUSIC.bin were used to create a soundfont. The MIDI sequences with patch changes were split with a program so that each instrument has it's own channel.

I'm curious about this bit. How exactly was the sequence data converted to MIDI? What was the original format? I ask because it seems there was a problem with handling the pitch bend, which is most obviously heard in track 49 or 50 (00000032 00051D24):
https://www.youtube.com/watch?v=UbfcXpFTXks (song in the final game)
https://www.youtube.com/watch?v=nm-PBRWkh4M (from the reconstructed OST)

I don't believe the difference in pitch can be attributed to being an earlier version of the song, given how note-for-note similar it is otherwise. There's some other songs that stick out with off-key notes as well. If I could understand the format of the original sequence data, and how it was converted to MIDI, I could try to help figure out what may be wrong in the conversion.

All that said, I've extremely impressed with all the work that's been done in this thread. The model data extraction also has my interest piqued.
KCat
Member
Level: 15


Posts: 2/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 11-13-13 10:42:56 AM, in Star Fox Adventures E3 2002 prototype (5/17/02) (last edited by KCat at 11-13-13 01:49:59 PM) Link
Originally posted by koolaidman
Rare games sometimes used the AMSeq format for their N64 games. I told SubDrag that there was data in AUDIO.bin that looked like the sequence format in Diddy Kong Racing and he was able to add support in N64MidTool for it. There are some problems with the converted sequences as I said when I released everything, here are some that I encountered:

1.) Pitch problems - as you said, there are some pitch problems in songs that heavily depend on it. For the song you listed I tried to shrink the pitch change values but nothing seemed to sound quite right so I left it to go work on other songs. For that song in particular I knew it was exactly the same as the one used in SFA so I figured it wasn't important to fix that particular one, but you're right that there are more that aren't used that have the same problem. But sometimes there were songs (like Discovery Falls) where the pitch changes are actually too weak. And most of the other songs had pitch changes that were just right. So you'll have to talk to SubDrag about this one.

2.) Program/Patch changes mid song - this wasn't much of a problem since ValleyBell's program worked wonderfully to split the individual channels that had changes and carry their pitch/patch settings over. But since it was an automated process it might've messed some stuff up (in fact there were one or two songs that didn't want to go through his program so I had to resave the MIDI file from a DAW elsewhere and open that up instead). One song that really had this problem bad was the Northern Wastes one. This song is really crazy as it basically has 3 songs in one MIDI file (a lot of the songs do this), each song with it's own channels and using some channels from the other songs. Thankfully I was able piece together something based on IOnEI Falcon's 1 hour video and the officially released version (during the game's original production) but it still sounds inaccurate because I wasn't as familiar with the song at the time so I just left it as is. There were a lot more problems with this song specifically which I'll get into later.

3.) Possible missing channels/notes - not as much as a problem because there weren't many places where it seemed like it was missing channels/notes. The only places that seemed noticeable were the ones for the Test of ____ tracks and Ice Mountain Race where the vocals were missing but the voice samples are actually still in MUSIC.bin (where all the other instrument samples are kept). The officially released music from DP was probably not taken directly from an N64, so there were probably some things that needed to be fixed during the conversion process to the game.

4.) Incorrect notes - also not as much of a problem, but there were some songs that seemed to be using the wrong samples (originally, Discovery Falls was like this but was an easy fix). This might have more to do with the soundfont I made rather than the converted MIDI, but I remember double checking this to make sure it wasn't a problem in other songs but I still ended up having the same problem here and there. (00000052 00081BD8 being the biggest case since nothing seems to work for it and there's no telling what the original sounded like).

5.) Problems with the soundfont - As I said, the instrument samples were taken from MUSIC.bin. The samples were extracted with N64SoundTool, which also has it's share of problems too. Luckily, the majority of the samples in MUSIC.bin were exactly 22khz, but there were still some that had a different rate. I had to manually fix this in Audacity, but since the samples had to be rerendered I lost the root key and loop point for the sample so these had to be recalculated. As a result, there are some parts where the instruments sound a little off, the biggest offender being the piano patch (which I still have no clue how to fix since it appears to be right but still sounds way off). To make matters worse, a lot of the patches used a variety of samples (for instance, there was one patch that had vocal expressions, drums, AND sfx all in one) and to top it all off, instead of having each sample have one root key the game spans the sample across multiple keys in range of the root key. Luckily I don't think I messed that up, but there might be problems with some of the samples themselves still.

6.) No looping - can't be helped I think. You can use some creative license to make up your own loop point for the song though. A lot of the songs sound very good even without a loop, like a soundtrack version.

I've done quite a bit of hacking around with the sound and midi files in recent days, and I think I've come to a good, if broad, understanding of them. Enough so that I could make my own extractors and stupid'n'simple converters, at any rate. Here's some things I've noted:

Pitch problems -- what sticks out to me here is that the instrument sounds contain parameters for detune and bend range, along with attack/release/decay times and key base/ranges and other things. Were these preserved in creating the soundfont? I've yet to look into the sf2 format very much, or the soundfont you provided, but missing the detune and bend range info could probably account for some of the off-key issues.

Program/Patch changes mid song -- I'm not sure where this is actually an issue, at least in the technical sense. I've been able to track-for-track convert the songs and they will play fine. Though as noted, there are some peculiarities in that some songs are actually multiple songs in one (e.g. the Northern Wastes), but I imagine these would be handled by fading in and out specific tracks during gameplay... probably by having an extra 'master' volume control per track that can be controlled externally by the game logic. So to 'extract' the individual songs, you'd just mute specific tracks.

Possible missing channels/notes -- This still has me stumped. There's a couple possibilities I can think of. One, the data just isn't there for some reason. For the ice mountain race, perhaps the devs thought the vocals didn't fit with the visuals or gameplay and took them out for the in-game version. The other possibility is that they're there, but are somehow triggered by game logic. For the Krazoa tests, I could imagine the game logic signaling the audio system with a specific "Test of ___" 'instrument' to use based on which test the player was doing (which would be an odd way to do it surely, especially since the tests seem to have their own songs, but I've seen games do some really odd things before).

Another side issue here is with MIDI itself. In General MIDI, track channel 10 (don't know why I said track) is designated as the percussion/drum channel, and defaults to using bank 128 where the standard drum set is. Music creation programs tend to let you easily change that, so it may not be an issue for generating flacs or mp3s, but people that play the MIDIs using the soundfont will have wrong or missing output for that channel (and unfortunately you may not be able to move it if a given song needs all 16 channels).

Incorrect notes -- Notes that have the wrong pitch or key could be due to the aforementioned detune or bend range parameters, if they were indeed lost when creating the soundfont. As for "00000052 00081BD8", I'm not actually sure if that's a problem, specifically. I could see that song as being something that plays in an options menu or when paused or something.

Problems with the soundfont -- I don't have much on this. I do intend to look into the soundfont eventually, to see if I can spot anything amiss in it.

No looping -- Yeah, this is not strictly possible, because of short-comings in the MIDI file spec. There's one or two non-standard ways to do looping, but in general they only loop all tracks at once (and generally at the end), while the original songs could do per-track nested looping with specific loop counts. There is actually one (non-standard) way you can do per-track looping, which is to use Apogee's EMIDI extensions that they used for their games in the mid 90s. But even that would require having a MIDI player that understands it.


All that said, I'm still going to keep looking into this. Something that kinda bugs me about the conversion is that it basically just copies the MIDI events verbatim, only handling special cases like the note-on delta time*, meta events, loop points, or the repetition marker (0xFE; never thought I could hate a hex value so much) to get something that resembles a proper MIDI stream. But there's very little checking on the stream, to see if there may be any non-standard controller changes which just get ignored in the playback, or if it may have even re-purposed some standard controllers.

Another thing is that AUDIO.bin has a non-negligible amount of non-sequence data interspersed with the sequence and track data. It may just be junk in unused sections of the file, but I don't know. Considering cartridge limitations and how far even the music goes to save space (MIDI like this is already small enough, but there's cases where the sequence data will use a 4-byte 0xFE repetition marker to "replay" a 6-byte segment), that it seems unbecoming of it to have so much junk in there. But I have a difficult time thinking of what it could be.

* Incidentally, the note-on delta time is something I've seen before in another MIDI-like format (HMI). Instead of having an explicit note-off event, the note-on event specifies how long until release.
KCat
Member
Level: 15


Posts: 3/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 11-16-13 10:55:19 PM, in Star Fox Adventures E3 2002 prototype (5/17/02) (last edited by KCat at 11-16-13 10:56:23 PM) Link
I have successfully converted the sound bank to an sf2 soundfont. This is a direct automated conversion, which keeps many of the instrument and sound properties precisely intact.

The conversion isn't yet perfect. There's still some properties that I'm not completely sure what scale they use, or how exactly they affect the sound. I haven't completely solved the pitch bend problem most noticed in track 50 (Snowhorn Ride), but many of the other pitch problems have been cleared up and in general the sounds are much nicer when combined with the original MIDI sequence data, IMO. The sounds some of the songs used have even changed (in some cases it's just a minor pitch correction, in others it's using a different sample)... also, track 82 (00000052 00081BD8) now makes sense to me.

Here's the new soundfont, along with the MIDIs I redumped using my extractor.
http://www.fileswap.com/dl/R2GiagQshq/dinosaur_planet_music.7z.html

You'll need to use a MIDI synth that can select a custom sf2 soundfont, since it's not GM compatible. For best results, make sure the synth is set to XG bank-select mode, otherwise you may lose the sound on channel 10.

Tomorrow I'll see about rendering them to FLAC and MP3. I'll also probably release the sources for my extractors and converters.
KCat
Member
Level: 15


Posts: 4/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 11-16-13 11:52:25 PM, in Star Fox Adventures E3 2002 prototype (5/17/02) Link
Originally posted by Kett
The first racing music (in Northern Wastes) is still missing the chanting?

Yeah, the Ice Mountain race music still lacks the chanting. I have a feeling it's just not there (the sequence data I mean, which would trigger the chanting sounds), or it's somehow triggered by the game itself separately. But I haven't looked too much into the MIDIs themselves yet, since I first wanted to get a soundfont that I know matches up closer to the original sound bank -- so if something's wrong, I know it's my fault, rather than a errant modification I wasn't aware of.


But otherwise, some also have more instruments and are slower?

Tempo-wise, it should still be the same. Some instruments may sound slightly lower (or higher) pitched since they didn't go through an extra resampling step and lose it's original base key and key range, and it retained the pitch correction (detune). Some instruments may shift into a different (more correct) sample due to the original key ranges being left intact.
KCat
Member
Level: 15


Posts: 5/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 11-17-13 11:51:27 PM, in Star Fox Adventures E3 2002 prototype (5/17/02) Link
Here's some renders of the songs in FLAC, and 192kbps MP3.

http://www.fileconvoy.com/dfl.php?id=g73b1cd79b596e281999415400ed06ebe15cfdc65d (FLAC, 527MB)
Link will only be valid for 7 days. If someone else has a place to put up such a large file more permanently, please do.

http://www.fileswap.com/dl/nnOGMALUcZ/Dinosaur_Planet_Music_%28mp3%29.7z.html (MP3, 192MB)

Note that I haven't yet been able to get a good look at tracks 28, 63, and 73 to split them up into separate songs, so they're still kind of messy (63 and 73 anyway, 28 isn't that bad).
KCat
Member
Level: 15


Posts: 6/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 11-18-13 02:44:27 AM, in Star Fox Adventures E3 2002 prototype (5/17/02) Link
Originally posted by Joe
Originally posted by KCat
If someone else has a place to put up such a large file more permanently, please do.
I have a 2TB hard drive and a torrent client. Is P2P hosting acceptable?

P2P is kinda flakey when it comes to availability. But having more places to potentially be able to get it would be a good thing, so I don't see a problem with it regardless.
KCat
Member
Level: 15


Posts: 7/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 11-18-13 07:11:05 PM, in Star Fox Adventures E3 2002 prototype (5/17/02) Link
Originally posted by KarrunaNiara
I've been listening to both reconstructions of the DP OST. There are a few differences between some renderings of some tracks (track 018 seems to lack the flute from koolaidman's rendering of the same track (17 - 00000012 000206D0)), though I think that might be an issue with the soundfont. Some of the drums in 030 also seem to be a bit louder, but I think that may be just me.

The flute issue in track 018 seems to be due to manual modifications of the song. I've tested all 4 combinations of both my soundfont and koolaidman's soundfont, and my midi and koolaidman's midi -- the flute doesn't come up anywhere. It's only present in his render, which suggests that the flute is muted in the original (for whatever reason) and koolaidman turned it back up for making renders.

The difference in track 030 is definitely the soundfont. Note that it's not just the drums being a bit louder and reverberant, but my rendering also has a gong crash that's not present in koolaidman's. This is the kind of thing I was getting at with how some notes have shifted into a different sample due to the original key ranges being kept intact.


Also wanted to mention some other things about both renderings of the OST. I know it's been mentioned that the Ice Mountain race (036) is lacking the vocal samples even though the samples are present in the data, but I think the E3 version of DP had that, too? (http://www.youtube.com/watch?v=ql1cy-gTzCc Music begins at 4:17, but it's hard to hear with the crowd noise. Pretty sure the difference is there, though.). Probably an oversight on Rare's end, but who knows.

Yeah, that sound is a bit too noisy to tell. I can't hear anything that suggests the chanting is there, but it could just as well be drowned out from the noise.


Another thing is the Darkice Mines track. I know it's a dynamic track, but for some odd reason, most of the channels for the "snow" version of the track are missing, leaving it pretty incomplete. http://www.youtube.com/watch?v=h7Ti6qya8d0

The other versions of the track rendered out okay, though.
http://www.youtube.com/watch?v=DF1kwA-oIa8
http://www.youtube.com/watch?v=HD9JH07hEYQ
http://www.youtube.com/watch?v=mgTzDBEI16Y

For dynamic songs, you probably actually want to separate channels instead of tracks. Difficult to know exactly how it worked without some information on how the original music system functioned, but I doubt it should be separated based on track since one track can do anything to any channel. For a game to keep it all under control, it would need to modify based on channel number.

For the aforementioned song, I'm having a difficult time figuring out which channels go to which song. But then, it's actually been a while since I've listened to those songs in SFA's soundtrack, so I'll need to brush up on that before taking another stab at it.


As far as other dynamic tracks are concerned, I'm pretty sure 055/53 - 00000037 00055F88 is a dynamic track, as there's a few channels that are present between 0:09 and 1:50 that aren't present in the Rareminion MP3 of the same song.
http://www.youtube.com/watch?v=Ef6LPVr_Ecw The ripped track.
http://www.youtube.com/watch?v=oFWz8Fzt_MM And the RM mp3 for comparison.

Hmm, this has me really puzzled. Not just this track, but the others RareMinion has don't sound like they came from this soundfont. The Dino_2 track (which is from this trailer) is a remixed version of track 033, but some of the instrument samples are notably clearer (the string ensemble) or different (the choir ahs). I also hear some reverb on the strings, which I don't know if it was added in for that trailer, or if it may actually be something in the sequence data we haven't uncovered yet*.

* I'm positive some of the songs are using non-standard MIDI controllers, or using standard controllers in non-standard ways; I'm pretty sure the N64 could do reverb effects, so who knows... maybe the songs are trying to use some of these effects that weren't standard MIDI yet.


Also, I think there's a few dynamic channels in 068 of KCat's rendering. They don't seem to be present in koolaidman's rendering (60 - 00000044 0006AAB8), but he didn't seem to make a seperate mp3 for them.

It seems this track is dynamic, but the song it's mixed with is the same as track 004.

Incidentally, this is another place where RareMinion's version (Earthwalker Temple) doesn't match what we have. It doesn't even match the final version.

You know, as sad as it is to think about, I wonder if the stuff RareMinion managed to uncover was intended to be for a separate CD release. Kinda like what they did for Killer Instinct and Killer Instinct Gold, where Rare released remixes of the original songs in much higher quality.


Also of mention, at some point in the past, I've been working on a transcript of the hour-long DP/SFA audio rip. Might swing back to working on that sometime.

Sounds like an interesting project. Particularly if you can match it up with the leaked script.
KCat
Member
Level: 15


Posts: 8/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 11-21-13 09:07:25 AM, in Star Fox Adventures E3 2002 prototype (5/17/02) (last edited by KCat at 11-21-13 09:12:11 AM) Link
I decided to take a different tactic to the music. Rather than converting the songs to MIDI files and playing/rendering those, I instead made a program that could play/render them directly from the game files. This enables me to better handle the loop points, which some songs actually rely on for proper playback (073 was one such song; there's a drum track that only plays for part of the song, and is intended to loop while the other tracks continue to play).

I also took the opportunity to better watch (and filter) the MIDI controller changes the song does. This confirmed my suspicions -- some songs set controller 11 (expression, essentially an additional volume control) to a really low value, causing the channel to go nearly silent. Most songs also use controllers 20 to 24, which are undefined in standard MIDI. There's many more oddities here, too.

Ignoring these questionable changes ended up fixing some of the issues, like the missing flute in track 018, and other missing instruments in other songs (still no vocals in the ice mountain race ).

With all that, I've gone and made a new set of renders. These renders also split tracks 063, 068, and 073. I used the one hour gameplay video as a guide for the different variations of the Northern Wastes. Funny enough, despite getting all 3 variations down, a few of the drum tracks are still unaccounted for... not sure if there's a 4th variation, or what.

Here's a set of FLACs (592MB)
http://www.fileconvoy.com/dfl.php?id=ge551db907cab61d999941739618e87de7eea98006
As before, this link will only be valid for 7 days.

And here's 192kbps MP3s (218MB)
http://www.fileswap.com/dl/2IBQD6pxSI/Dinosaur_Planet_Music_%28mp3%29_%28re-rendered%29.7z.html

Finally, here's a very incomplete track list. I used the various official and leaked MP3s, as well as the gameplay video, as the basis for determining what's what. Needless to say, the actual names are made up, but the titles should be good enough to describe what it's for. No idea how much more I'll go into this (there's plenty more still used in the gameplay footage that I haven't matched up, yet), but it's a start if anyone else wants to run with it.

002 - Cape Claw
004 - Walled City Maze
009 - Krystal's Introduction
020 - Galleon Attack
022 - Warlock Mountain Arrival
029 - Galleon Battle
032 - General Scales' Appearance
033 - Title Intro
036 - Ice Mountain Race
042 - Krazoa Test Room Entrance
055 - Swapstone Hollow
068 v1 - Earthwalker Temple
068 v2 - Walled City Maze
073 v1 - Northern Wastes (Outside)
073 v2 - Northern Wastes (Caves)
073 v3 - Northern Wastes (Volcano)
KCat
Member
Level: 15


Posts: 9/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 11-24-13 07:09:39 AM, in Star Fox Adventures E3 2002 prototype (5/17/02) Link
For completeness, here's the current sources for my extractors, converters, and player. Note that this is just the sources, and building it requires CMake and a C++11 compiler (I use GCC 4.8, MSVC will probably need some tweaks). The player requires OpenAL and FluidSynth. Note also that these are command-line apps, so there's no GUI.

http://www.fileswap.com/dl/SAVyBIt6f/extract-audio.zip.html

To use it, first build it (instructions for using cmake to build are beyond the scope of this post). Also, extract the SFA E3 disc using Dolphin or something. Now, extract the raw soundfont:
> extract-bin path-to-sfa-data/MUSIC.tab
then the raw music:
> extract-bin path-to-sfa-data/AUDIO.tab

This should create MUSIC and AUDIO folders with a bunch of .raw files, which are the individual "files" from the respective bins. Now you can create the sf2 soundfont:
> extract-audio --makesf2 MUSIC/out0.raw MUSIC/out1.raw
which will create soundfont.sf2 in the current folder. If you omit the --makesf2 switch, it will instead create a bunch of .wav files, for all the different sounds (these are just basic wave files; loop points and other instrument data is not stored).

From here, you can either create .mid files to play with the soundfont (which should kinda work, but will have issues as noted earlier in the thread):
> extract-audio --midi AUDIO/out01.raw
to create a bunch of .mid files in the current folder. Or if you have the OpenAL and FluidSynth SDKs and built the player, you can play the music directly:
> midplay --soundfont soundfont.sf2 -i AUDIO/out01.raw 94 (to play track 094)
> midplay --soundfont soundfont.sf2 -i AUDIO/out01.raw --randplay (to play all tracks in random order)
You can also render a song to a .wav file:
> midplay --soundfont soundfont.sf2 --write-wav -i AUDIO/out01.raw -o cape_claw.wav 2

I admit the usability of these apps is pretty limited and rather archaic. I just built the interfaces as I needed them to do a specific task. I don't imagine these apps to be very useful to people unless you're curious to see code for how the files are extracted, parsed, converted, and/or played. For anyone else that just wants to listen to the music, you're not really missing anything with the renders (in fact, the renders make it easier to listen to the dynamic songs individually).
KCat
Member
Level: 15


Posts: 10/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 12-02-13 06:56:44 PM, in Star Fox Adventures E3 2002 prototype (5/17/02) Link
Here's something...

I got it pulling in the surface normals from the models. There's more normals referenced per primitive, but I can't figure out what they're for (they do not seem to be per-vertex normals, and I don't think the N64 did bump-mapping for them to be tangents and binormals, so I'm kind of stumped).

For reference, the normals are stored like this:
int32 : primitives offset
int32 : unknown offset
int32 : normals offset
...
int16 : primitive count
int16 : normal count

Each normal is stored as a 3-component vector, similar to the vertex data (signed 16-bit x, y, and z components). Each component needs to be divided by 32767.0, or they otherwise need to be renormalized.

In the primitives, the first index after the three vertex indices is to the surface normal. The next three indices also reference the normals array, but I haven't figured out what for yet.
KCat
Member
Level: 15


Posts: 11/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 12-03-13 01:49:52 PM, in Star Fox Adventures E3 2002 prototype (5/17/02) (last edited by KCat at 12-03-13 01:56:43 PM) Link
Here's up to date code for my tools. Funny enough I had just started on a model viewer when xdaniel posted the third revision of his model viewer.

http://www.fileswap.com/dl/hZKagUIFc6/dp-extract.zip.html

It contains the bin/tab extractor, the sound bank converter, the midi player, and now a model viewer. There's no binaries, but this probably wouldn't be of interest to you unless you were interested in the code anyway (xdaniel's model viewer is probably more user friendly, and the music has already been ripped).

In any case, I've got most of the model data (from BLOCKS.bin) fully parsed and loading. I have no idea what most of data is, mind you, but I've got a good handle on it's structure. I've located the normals, as well as what I think is the texture coordinates, though I can't see where they're referenced so there's no way to know how they're applied. I think I may even see some more rendering instructions, but I haven't done much in the way of interpreting it. Running the view-model program will print out all the data I've been able to parse to the console (also, wasd moves, hold shift to move faster, click and drag the mouse to rotate, 'l' toggles lighting, 'f' toggles vertex shading, 'v' toggles wireframe mode).

There's just one section that has me completely baffled. The second relevant offset in the format (right after the primitive data offset) seems to point to some kind of structure, but I can't find anything that actually tells me what the size of it is, which is preventing me from loading it properly (I could of course brute-force it by reading up to the start of the next section, but that won't help me understand it any so there's little point). Everything else has a size associated with it, so that leaves me scratching my head. All I've found is that it starts off with a 32-bit 0, 6 shorts (or 5 shorts plus 1 for padding), then another 32-bit value, followed by any number of bytes. Here's a screenshot of the section in a hex editor:

This is from mod31.10, aka the ice race track tunnel entrance block. What I find interesting is that in all the models I've looked at, the end of the section has the primitive count (also in the model's main header), 18 null bytes, and is followed by the start of the primitives data section. The ordering of the two sections may be coincidental, but I can't help think there may be something to it. That it duplicates the primitive count is pretty weird, too (these things generally don't duplicate info unnecessarily due to space limitations).

Anyway, that's all I've got for now.

EDIT
Oh, and in case anyone's interested, here's the output of the first model (and rather simple one)...
http://pastebin.com/pDT9TQuu
KCat
Member
Level: 15


Posts: 12/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 12-03-13 10:21:55 PM, in Star Fox Adventures E3 2002 prototype (5/17/02) (last edited by KCat at 12-04-13 12:03:49 AM) Link
Heh, you read my mind...


EDIT:
Have a treat.
KCat
Member
Level: 15


Posts: 13/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 12-04-13 03:45:31 PM, in Star Fox Adventures E3 2002 prototype (5/17/02) (last edited by KCat at 12-04-13 03:49:08 PM) Link
Let's play!

I can't help but think this is Tricky's ball.

Anyway, I've found the proper normals and texture coordinate indices for both the blocks and models. The texture itself here is obviously a placeholder since I haven't found where the texture indices may be (let alone have reverse engineered the texture files yet). I discovered them when I found where the actual draw "commands" are, which are present in both the models and blocks. One block or model can have one or more of these draw lists, which contain one of more segments.

The draw list starts with a 1-byte 'mode' enum (seems to be 0x9D and 0x9E = triangle strip, 0x95 and 0x96 = triangle list). Folowed by a 2-byte 'count'. After this is 'count' index groups*. This is then followed by another 'mode' enum for the next segment. It goes like that until it finds a mode of 0, or reaches the end of the draw list. The size of the draw list is always a multiple of 32 bytes.

* Normally an index group is three bytes. 1 for the vertex, 1 for the normal, and 1 for the texture coordinate. However, there are some models and blocks where this isn't the case. The model at offset 0x00013740, for instance, has no normals, so its index groups are only two bytes (1 for the vertex, 1 for the texcoord). In another case, the block at offset 0x000136e0 has more than 256 texture coordinates and needs more than one byte for the index, so its index groups are 4 bytes (1 for the vertex, 1 for the normal, 2 for the texcoord).

Further, that block has way more than 256 normals too, but the index group still only seems to use one byte to address them. So I'm not sure what's up with that.
KCat
Member
Level: 15


Posts: 14/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 12-07-13 06:47:08 AM, in Star Fox Adventures E3 2002 prototype (5/17/02) (last edited by KCat at 12-07-13 07:09:03 AM) Link
Originally posted by xdaniel

I'm worried anything I ask might be too specific and too low-level for him to know, or that he simply doesn't understand what I mean because my/our terminology is wrong, things like that...


There's also the very good possibility that even if he does know, he wouldn't be allowed to say anything due to NDAs that prevent him from giving details of the hardware and software systems (sadly a very common thing).


...like those draw lists, or rather the "chunks" (that likely were structs in the devs' source files) that point to them. First uint32 is the draw list offset, next uint16 is the size in bytes, next 6 uint16s are what I assume some sort of bounding box for the chunk (minimum X, Y, Z, maximum X, Y, Z, one uint16 each), but the final 10 bytes I have no idea about.

There's also the multiples of 60- and 68-byte segments (in the blocks and models respectively) whose purpose is completely unknown. Seemingly random arrays of bytes and ints. We don't know what or where the flags are that specify the draw list properties (which specifies the existence or size of the individual attribute indices). Many offsets that point to data that's so far untouched.

And depending on how much the GX API resembles what the N64 had, there's also indications that it may also specify the vector component formats (16-bit integer, 8-bit integer, fixed point, etc).
KCat
Member
Level: 15


Posts: 15/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 02-05-14 11:43:36 PM, in Star Fox Adventures E3 2002 prototype (5/17/02) Link
Originally posted by Hugo_Peters
It's been some time!

http://youtu.be/cYhhZdEBvhM

I'll be damned if I haven't heard that song before. I'm having a heck of a time finding where, though.
KCat
Member
Level: 15


Posts: 16/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 02-07-14 08:27:35 AM, in Star Fox Adventures E3 2002 prototype (5/17/02) Link
Out of curiosity, is there any info on the image formats in TEX0.bin and TEX1.bin? I have the individual entries extracted and decompressed, and I can see what seems to the the image width, height, and format (possibly even a mipmap flag), and I can certainly tell there's images of some kind in there, but no matter what kind of pixel formats I use the images are a mess.
KCat
Member
Level: 15


Posts: 17/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 02-08-14 01:56:23 AM, in Star Fox Adventures E3 2002 prototype (5/17/02) (last edited by KCat at 02-08-14 01:56:45 AM) Link
Originally posted by KCat
Originally posted by Hugo_Peters
It's been some time!

http://youtu.be/cYhhZdEBvhM

I'll be damned if I haven't heard that song before. I'm having a heck of a time finding where, though.

I knew I wasn't crazy: https://www.youtube.com/watch?v=o3UiAFZIbao
KCat
Member
Level: 15


Posts: 18/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 02-08-14 07:43:36 AM, in Star Fox Adventures E3 2002 prototype (5/17/02) (last edited by KCat at 02-08-14 07:44:27 AM) Link
Originally posted by 2Tie
I'm not sure, seeing as Tex.bin had all of its images ripped, though I don't know if they're in the same format..

They're not, unfortunately. Having a look at TEX.bin, I can actually read those images fine. Incidentally, basing on this post, I can read the images he's having trouble with, but I'm having a bit of trouble reading the ones he has. Basically it seems every other (odd) line has every pair of 64-bit values swapped (pic)... so for odd lines only, every group of two pixels needs to be swapped with the two in front of it, while the two pixels themselves don't swap with each other (so certainly not an endian issue).
KCat
Member
Level: 15


Posts: 19/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 02-08-14 02:46:33 PM, in Star Fox Adventures E3 2002 prototype (5/17/02) Link
I see. Kinda unfortunate as I was hoping I was doing something wrong, but it looks like the pixel data is kinda messed up like that. Can't fathom why, though, considering it would make it more difficult to load into the N64's texture memory (which is a paltry 4KB, so it would be getting reloaded all the time).

In any case, I did a thing. I was curious about what I could try to make by arranging together the models in BLOCKS.bin. Since each block is made to fit exactly a 640x640 area, that actually helps figure out how they fit together. So here's some images:
http://imgur.com/a/1b9CN
The meshes and texture are being pulled directly from BLOCKS.bin and TEX.bin, although the texture is just a random one applied to everything since I haven't yet found where the model specifies the textures it uses. There's also some missing triangles in some of them still.
KCat
Member
Level: 15


Posts: 20/42
EXP: 15144
For next: 1240

Since: 11-10-13


Since last post: 4.5 years
Last activity: 3.7 years

Posted on 02-09-14 03:27:48 AM, in Star Fox Adventures E3 2002 prototype (5/17/02) Link
Originally posted by zoinkity
The issue you're having with those images is called interlacing. GC and Wii titles interlace their images, which cuts out a degree of post-processing on their end. The N64, on the other hand, does not use interlaced images. The RDP expects images sent to it to be raw.

The problem is the images are formatted for the GC, not the N64.


This isn't any kind of interlacing I'm familiar with. It also only affects some images, those which are specifically flagged (going by xdaniel's code), not all of them. The others are as I expect. It's essentially like:
.0...1...2..3...4..5...6..7
10.11...8..9.14.15.12.13
16.17.18.19.20.21.22.23
26.27.24.25.30.31.28.29
...

I did find something interesting...
"It is possible to load a set of texture tiles using a single LoadBlock command (MIP maps, for example). However, if the tiles have different widths, the single dxt parameter is not enough to do proper interleaving. In these cases, the data must be pre-interleaved and the dxt parameter should be set to zero."
Though that still goes back to this being a method of interleaving/interlacing I don't recognize. The pixel data is also fully accounted for (exactly 28x30 RGBA32 texels to the next image start), which makes me think it's not tiling or mipmaping.
Pages: 1 2 3
Jul - Posts by KCat


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

20 database queries, 57 query cache hits.
Query execution time: 0.084737 seconds
Script execution time: 0.037344 seconds
Total render time: 0.122081 seconds