Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!
You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!
Well when you display the object it has to disappear at some point right. Theres probably a function to remove them. Like YLs taunt displays a bottle, but some function has to remove the bottle. Im curious about that function.Removes meshes...as in after it displays a mesh on screen, you want the function that takes it off-screen?
I found that function by doing a memory read breakpoint on the flags of the jungle japes main stage platform bone structure, lol. Just some arbitrary bone structure.
not really, because I lack understanding of materials/TEVs
Might find some luck in http://smashboards.com/threads/foxs-functions.409379/Well when you display the object it has to disappear at some point right. Theres probably a function to remove them. Like YLs taunt displays a bottle, but some function has to remove the bottle. Im curious about that function.
Probably works like the mdl0's mipmaps. There might be a flag with a version number and number of images in the material or texture structure. Id have to see a mipmap texture header/material struct though to confirm.First off, I'd like to say that this thread is awesome. I haven't had time to play with the stuff in here or even read it all yet, but this is stuff we've needed for a while. I have a question though, which has finally led to myself getting involved. You know how tpl files are able to contain multiple textures (even though this is pretty much never seen, since Dolphin doesn't appear to ever dump them with more than one)? Well, what I want to know is, how is this represented in a DAT file? I suspect they're used for two purposes: mipmaps, and animations (cases where a texture is swapped out for another slightly different one after a frame or two, like with dust textures). I think that the data for these is stored end-to-end, so essentially it's actually just one larger image, like a spritesheet. But I don't know if there are separate headers. If they exist, they must be in a different format, perhaps similar to the matanim tables I described before. Reason being, I can't seem to find some headers for some textures. For example, for some textures I had dumped and located a long time ago (EfCoData spreadsheet):
View attachment 75578
Second column is the offset range (start to end), third column is the data length.
I find it really strange that I couldn't find anything pointing to at least the start of the first texture's image data. Any ideas?
27 - 00081c20 MIP -- 0, 8, 0
20 - 0008cf20 MIP -- 0, 7, 0
Looks exactly like the tex0 header.Yoshi's Story Mipmaps
View attachment 75626
Placement as referenced by Steelia:
Image Structure (highlighted):Code:27 - 00081c20 MIP -- 0, 8, 0
View attachment 75628
Note: I really don't know much about mipmaps, nor what Steelia means by "0,8,0", but I assume that the floating point value of 0x41000000 = 8 at offset 0x14 of the Image Structure is a reference to this value.
Material Structure (highlighted):
View attachment 75629
Note: 0x14 of the Material Structure is a pointer to, what looks to be, a flag structure of 0xC in length.
-----------------
For another mip texture on Yoshi's, Steelia gives the placement data as:
Image Structure:Code:20 - 0008cf20 MIP -- 0, 7, 0
Note: Floating point value of 0x40E00000 = 7, as referenced in Steelia's placement data.
00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 40
00 00 00 40 00 00 00 00 00 06 26 40 00 06 2E 40
00 06 36 40 00 06 3E 40 00 06 46 40 00 06 4E 40
00 06 56 40 00 06 5E 40 00 06 66 40 02 4D 30 40
00 00 00 06 00 00 00 03 00 00 00 00 00 00 00 40
00 00 00 40 00 00 00 00 00 06 6E 80 00 06 8E 80
00 06 AE 80 00 06 CE 80 00 06 EE 80 00 07 0E 80
00 00 00 00 00 00 00 00 00 00 00 00 02 51 2D 50
@0xB50C0
00 00 00 03 00 00 00 01 00 00 00 02 00 00 00 20
00 00 00 20 00 00 00 00 00 0A 34 E0 00 0A 38 E0
00 0A 3C E0 00 00 00 00 00 00 00 20 02 17 01 A8
00 00 00 00 00 00 00 00 00 00 00 00 02 5E 77 A0
@0xD4500:
00 00 00 03 00 00 00 03 00 00 00 00 00 00 00 40
00 00 00 40 00 00 00 00 00 0C 29 20 00 0C 49 20
00 0C 69 20 00 00 00 00 00 00 00 20 02 17 01 A8
00 00 00 00 00 00 00 00 00 00 00 00 02 62 BC E0
Thats how sections work in the mdl0 format and the pl**aj files work that way as well. The headers are relative to the start of the section. Same should apply to whatever pointer led you there.I found some interesting structures. Of the group of electricity textures I posted above, I found this header/table right before the first texture, at 0x74220:
And then this appears directly after the last texture, at 0x78A60:Code:00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 40 00 00 00 00 00 06 26 40 00 06 2E 40 00 06 36 40 00 06 3E 40 00 06 46 40 00 06 4E 40 00 06 56 40 00 06 5E 40 00 06 66 40 02 4D 30 40
But the pointers in neither of these point to the electricity textures between them. (And there is nothing but image data between them.) :/Code:00 00 00 06 00 00 00 03 00 00 00 00 00 00 00 40 00 00 00 40 00 00 00 00 00 06 6E 80 00 06 8E 80 00 06 AE 80 00 06 CE 80 00 06 EE 80 00 07 0E 80 00 00 00 00 00 00 00 00 00 00 00 00 02 51 2D 50
They still appear to be a table of image data pointers though. To be more precise, it looks like:
Offset|Size (bytes)|Description
0x0|4|Number of textures in table (N)
0x4|4|Texture type
0x8|4|unknown
0xC|4|width or height
0x10|4|width or height
0x14|4|unknown
0x18|N*4|image data entries
0x3C|4?|unknown
There are a lot of headers/tables like these throughout the file. Though some are strangely slightly different, like these:
There's also a common similar structure that's only 0x20 long.Code:@0xB50C0 00 00 00 03 00 00 00 01 00 00 00 02 00 00 00 20 00 00 00 20 00 00 00 00 00 0A 34 E0 00 0A 38 E0 00 0A 3C E0 00 00 00 00 00 00 00 20 02 17 01 A8 00 00 00 00 00 00 00 00 00 00 00 00 02 5E 77 A0 @0xD4500: 00 00 00 03 00 00 00 03 00 00 00 00 00 00 00 40 00 00 00 40 00 00 00 00 00 0C 29 20 00 0C 49 20 00 0C 69 20 00 00 00 00 00 00 00 20 02 17 01 A8 00 00 00 00 00 00 00 00 00 00 00 00 02 62 BC E0
Guess this is all different than mipmaps.
I still don't understand why I can't find pointers or headers to those electricity textures (as well as other textures in this file). I'm not sure yet if these headers/tables above exist in other files, but I haven't seen them before. I don't think they're in character or stage files anyway. And probably not trophy files.
WAIT! STOP THE PRESSES!
Ok, while writing this I think I figured it out. If so, the pointers have been sitting here all along. I think they might be that first group in this post above. But then they're not relative to the start of this file's data section! They would be off by 0x11C00. Ugh, why is this file so weird? It's gotta have something to do with what these textures are used for. Or more specifically, how they're used.
Anyway, the reason I'm thinking that structure corresponds to the electricity textures is because the pointers are 0x800 apart (the length of the textures), there are 9 of them (which is how many textures appear before the next header/table), the image type and width/height corroborates, and then one more thing, which changed my mind from the rest being coincidence: one of the pointers included is 0x063E40. But that can't be right, because there's actually image data for another texture there, from 0x5C220 to 0x6421F.
And another thing, the second header/table I posted that comes after the electricity textures has 6 entries. And sure enough, it looks like there's a group of 6 images following it. Image type, width/height, and data length between pointers all match. And the mystery offset is the same.
0x11C00, what are you?
I see. I've never looked at files that didn't have the standard 0x20 offset for everything, so I was really confused for a while. I'm still not sure why I can't find a pointer to the headers/tables that I outlined, even with the 0x11C00 + 0x20 offset.Thats how sections work in the mdl0 format and the pl**aj files work that way as well. The headers are relative to the start of the section. Same should apply to whatever pointer led you there.
Also could we move this conversation to the dat file research thread. Its really what its for.
Id appreciate if he did lol. Id have to look at the file or Ill probably give you some false leads on what to do. After I figure out a few things with the imports.I see. I've never looked at files that didn't have the standard 0x20 offset for everything, so I was really confused for a while. I'm still not sure why I can't find a pointer to the headers/tables that I outlined, even with the 0x11C00 + 0x20 offset.
lmao, yeah, actually that's where I intended to post this in the first place. But I had both tabs open and accidentally posted in the wrong one. If Achilles1515 feels like it, he has my permission to just move all of my posts here to that thread, so the research is all together. Of course, for it all to make sense I guess he'd have to move the responses too.
The next half-word is what Ive really been playing with. The first half word makes arbitrary changes and I cant figure it out. Ive just been just 0x40 because 0x00 doesnt support alpha. 0x11 or 0x12 does something really weird in the next half-word. Anything over 0x14 for the next half-word applies shading to the stage.Material Structure unknown flags at 0x4
If the first byte of the flag word contains 0x20, then the object seems to get sent to the back.
View attachment 76081
If the first byte of the flag word contains 0x04, then the object is able to have a shadow cast on it.
View attachment 76082
But it doesn't work quite right, as you can see the shadow is on the underside of the top platform as well.
Below I added the shadow flag to the top surface and sides of the Gamecube. I don't know how to fix this problem.
View attachment 76083
0x04 supports alpha. It also gives me a solution to a problem. While not a solution to the problem in general, for battlefield at least if I make EVERY other material struct flag 0x04 and the waters 0x40 the water shows. Its something to do with draw order.The next half-word is what Ive really been playing with. The first half word makes arbitrary changes and I cant figure it out. Ive just been just 0x40 because 0x00 doesnt support alpha. 0x11 or 0x12 does something really weird in the next half-word. Anything over 0x14 for the next half-word applies shading to the stage.
Ive try 0x4 for the first half-word though, If it still supports alpha it I might use it over 0x40.
This is what I see.The material structures start around 0x6ef88. Trying to isolate why the shadows flicker. This should give you an Idea of what Im talking about.
Yeah Im rebuilding the file again testing what breaks. Making the whole file again takes too long so Im just doing the platform over and over.This is what I see.
View attachment 76119
Well I can tell you it flashes because the third bit is set high in the last byte of the flag word. So changing it from 0x3c to 0x38 fixes the problem.Yeah Im rebuilding the file again testing what breaks. Making the whole file again takes too long so Im just doing the platform over and over.
If you notice though, every time a hit is connected the platform flashes as well and flickers if you kill off the top.
Probably not the best thing to test with since it doesnt have really any shading to begin with lol. I did the base platform again. Ill upload it in a sec.
Let me know how it goes.materials should start around 0x999e4.
Maybe changing them to 0x38 will keep the shading.
It makes it now only flicker white. Also gets rid of the shadingLet me know how it goes.
Oh so that might be it. Theres no material index for the section I created.map_head
+0x28 = pointer, start of table of material structs pointers to automatically apply shadows to during stage loading.
+0x2c = unsigned, number of material struct points in table (1-indexed)
Function that controls autoshadowing is 801c6228.
It loads the material structure flag word and then or's it with 0x04000000.
Tried a little bit tonight. Didn't really find anything substantial and got super sidetracked following random code.@achilles. When you get a chance can you look into the table at the beginning of the file. Its related to camera/spawn stuff. The first pointer in the root section always has the camera/spawn/blastzone bone struct and it always points to that table so my theory is that the table tells the game which bone does what. Otherwise the game would just have to know somehow to use which bones as spawns. Thought this would be easier than trying to remake the file using a table and bones from a different stage but Im not quite sure how youre testing this stuff.
Thanks, one day we'll have shading.Tried a little bit tonight. Didn't really find anything substantial and got super sidetracked following random code.
I booted up Hyrule 64 on Dolphin and it looked very good. Your work is great.
No, I know about the area tables. I was talking about where the game is reading collision data mid-match in the RAM. It looks a little different than the table of floats that you edit in the DAT for collision points.@achilles when you originally moved the platforms for battlefield you said something about them being stored in a different format. Can you go into that a bit and how you found it. I believe what you found is related to area tables. Basically when I tried importing collisions into 1 file that game broke and I believe its to do with the area tables so I want to look into it.
I was reading up on what the brawl table is used for and apparently area table is what the game uses for collisions mid match. I didnt really follow much further but it sounds similar to what you found in that the collisions should be tied to the area table somehow. I did an import over groy and it breaks. I suspect that its because I changed the area table and how the game reads the area table and the disappearing clouds.No, I know about the area tables. I was talking about where the game is reading collision data mid-match in the RAM. It looks a little different than the table of floats that you edit in the DAT for collision points.
My understanding of the Area Table:I was reading up on what the brawl table is used for and apparently area table is what the game uses for collisions mid match. I didnt really follow much further but it sounds similar to what you found in that the collisions should be tied to the area table somehow. I did an import over groy and it breaks. I suspect that its because I changed the area table and how the game reads the area table and the disappearing clouds.
It broke only from importing the coll data. The same imported coll data worked on a different stage. It doesnt make sense that it would be the collision points or links which is why I believe its the area table. Brawl modders concluded that the only reason why theres not 1 big area table normally is for platforms that undergo some transformation and they just make a big 1 for stages that dont have any but use multiple for things that undergo transformations. I guess I could just set a break point at the area table and see what the game does with it.My understanding of the Area Table:
All the area table [an imaginary rectangle(s)] does is allow stage collisions to occur (correctly) in that region. That is the only function I have ever seen it play. If a collision link exists outside of any defined area table, it won't do anything. If a collision link (floor) extends outside an area table, then the portion inside will work as normal, but the portion outside can be walked out to like normal, but will be passed through and ignored by characters falling on top of it.
The disappearing clouds for Yoshi 64 are controlled by ASM code, likely from supporting data in the stage file. I don't know the nature of the "break" you caused, but I would guess it to be something related to game code controlling bones, more so than the area table. I'm not sure if you can cause the game to freeze by strictly modifying the area table (with legitimate floating point values).
Hmm alright. I posted that same thought somewhere here in the forums a while back, asking “why isn’t the area table just the size of the blastzone?” I’m not sure why the area table would affect the cloud; it looks like the collision link just gets removed when it disappears. But I do bet the area table is meant to be used for dynamically changing stages, otherwise is just wouldn’t make sense.It broke only from importing the coll data. The same imported coll data worked on a different stage. It doesnt make sense that it would be the collision points or links which is why I believe its the area table. Brawl modders concluded that the only reason why theres not 1 big area table normally is for platforms that undergo some transformation and they just make a big 1 for stages that dont have any but use multiple for things that undergo transformations. I guess I could just set a break point at the area table and see what the game does with it.
That's incredibly useful. I was just complaining to myself about how the target stage music wasnt fitting at all.Hmm alright. I posted that same thought somewhere here in the forums a while back, asking “why isn’t the area table just the size of the blastzone?” I’m not sure why the area table would affect the cloud; it looks like the collision link just gets removed when it disappears. But I do bet the area table is meant to be used for dynamically changing stages, otherwise is just wouldn’t make sense.
Also, idk if you were on your hiatus or not when I posted this about how to change the BGM in the stage DAT file.