• 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!

MiscData(PW's Guide in first post!)

superyoshi888

Smash Lord
Joined
Apr 8, 2008
Messages
1,026
If anyone has been following my Stage Hacks thread, you may know that I wish to further stage hacking. I believe the key lies in MiscData.

For a moment, take a look at this:




This of two corresponding Stage Builder pieces. As you can see, they are almost identical except with some differences. This is explained easily as you can see by looking to the right of the hex....it gives the name of the parts I looked at.

Ghost Blocks. I copied a bit of hex from a normal stage block onto an ice block, so simply rename the pac STGEDIT_2 and test it out with some ice blocks.

EDIT: PW guide. Just click the blue arrow.

Hello, people. Phantom Wings finally released his guide on editing Collision Data (MiscData)

I sent him an PM requesting to show mii how to edit collision data for stages.
And he told and insisted I also post his guide here.

Here it is:
Hex values:

This is the format for the stage collision files. I'm surprised that no one caught me when I posted a product of this knowledge here but I guess I'm getting better at my subtlety :laugh:

Code:
File Start: (10 words)
0x00 Number of Points
0x02 Number of Planes
0x04 Number of Objects
0x06 Unknown
0x08 Point Array Offset
0x0C Plane Array Offset
0x10 Object Array Offset
0x14 - 0x24 Blank(0x00000000)

Points: (2 words)
0x0 Floating Point X Coordinate
0x4 Floating Point Y Coordinate

Planes: (4 Words)
0x0 Left Point Array Index #
0x2 Right Point Array Index #
0x4 Left Plane Link Array Index # (-1 if null)
0x6 Right Plane Link Array Index #(-1 if null)
0x8 Blank(0xFFFFFFFF)
0xC Type
0xE Effect

Objects: (23 Words)
0x00 Start Plane Array Index #
0x02 Number of Planes
0x04 Blank(0x00000000)
0x08 Blank(0x00000000)
0x0C Blank(0x00000000)
0x10 Unknown
0x14 Point: Object Bottom Left
0x1C Point: Object Top Right
0x24 Unknown
0x28 Blank(0x0000)
0x2A Blank(0xFFFF)
0x2C-0x48 Name1
0x4C-0x68 Name2

Types:
0x0000 None
0x0001 Ground
0x0002 Roof
0x0004 Right Wall
0x0008 Left Wall
0x0010 Unknown
0x0040 Unknown

Effects: 
0x0000 Footstep Sound 1
0x0001 Footstep Sound 2
0x0002 Footstep Sound 3
0x0003 Footstep Sound 4
0x0004 Footstep Sound 5
0x0005 Footstep Sound 6
0x0006 Footstep Sound 7
0x0007 Footstep Sound 8
0x0008 Footstep Sound 9
0x0009 Footstep Sound 10
0x000A Shallow Water Effects
0x000B Bubble Sounds
0x000C Low Friction
0x000D Snow Sounds
0x000E Low Friction + Ice Effects
0x000F Footstep Sound 
0x0010 Low Friction
0x0011 Footstep Sound 11
0x0012 *Crash*
0x0013 *Crash
0x0014 *Crash*
0x0015 Loud Bubble Sounds
0x0016 Footstep Sound 12
0x0017 Footstep Sound 13
0x0100 Platform (drop-through)
0x4000 Unknown
0x8000 Unknown

Notes:
-Planes only work properly if their top side is facing the correct direction relative
to what type of plane it is. (The top side is "up" from the left point to the right point)

-Objects are composed of the Number of Planes starting from the plane at the
Start Plane Array Index #

-The Objects don't appear to have any overall effect on the planes or the points - they
only appear to be there for grouping them together (I imagine they have a use for
stages with moving platforms where an object and it's planes could be moved as a whole)
 

n64billy

Smash Ace
Joined
Feb 4, 2009
Messages
614
Location
Behind you!
Interesting stuff you're looking into there.
If it still hasn't been tested in a few hours, then I'll try it out (Family sleeping still)

What other possibilities do you think could be in this?
 

Nerd With An Afro

Smash Journeyman
Joined
Jul 23, 2009
Messages
283
Location
Lancaster PA
their like invisible props. i just fall through them. http://www.youtube.com/watch?v=zEVyAQc3BUQ

EDIT: i just tried out a normal block and it acts the same way, but the wierd thing is that even though i can fall though it, i can wall kick of it. 2nd vid is right here http://www.youtube.com/watch?v=KTU2XZsG1F4

EDIT 2: Theory: when mario touches the ice, he then has the ability to walk through things.

EDIT 3: The ice blocks turn the character intangable, like a ghost, and has the ability to move through anything thats in direct contact with another block, unless its a special block. even though the charact is intangable, he can still wall kick.

EDIT 4: can you name them ghost blocks?
 

Nerd With An Afro

Smash Journeyman
Joined
Jul 23, 2009
Messages
283
Location
Lancaster PA
Yeah, sure. That's some sweet stuff in the vids.
Also, something else that i just realized that projectiles (marios fludds water) also go through this block. i will test and see if they have the same effect.

EDIT: FAILURE. due to brawl +, i cant load custom stages in normal brawl, even though im using the HB method. wanted to test with samus's missles... but cant.
 

superyoshi888

Smash Lord
Joined
Apr 8, 2008
Messages
1,026
Just open up a Stage Pac. If you want the one I made, download the pac above and export MiscData[950] in Brawl Box.
 

Kaye Cruiser

Waveshocker Sigma
Joined
Aug 11, 2009
Messages
8,032
NNID
KayeCruiser
Switch FC
0740-7501-7043
Also, something else that i just realized that projectiles (marios fludds water) also go through this block. i will test and see if they have the same effect.

EDIT: FAILURE. due to brawl +, i cant load custom stages in normal brawl, even though im using the HB method. wanted to test with samus's missles... but cant.
What're you talking about? Brawl+ works perfectly fine with custom stages. I use em all the time. O_o
 

Isatis

If specified, this will repl[0x00000000]ce the
Premium
BRoomer
Joined
Dec 18, 2008
Messages
10,253
Location
San Francisco, CA
NNID
reverite
Brawl+ does have the "No Custom Stages" code on, but can be disabled, some codes might malfunction without it though
 

Phantom Wings

Smash Apprentice
Joined
Jul 29, 2008
Messages
150
This is the format for the stage collision files. I'm surprised that no one caught me when I posted a product of this knowledge here but I guess I'm getting better at my subtlety :laugh:

Code:
File Start: (10 words)
0x00 Number of Points
0x02 Number of Planes
0x04 Number of Objects
0x06 Unknown
0x08 Point Array Offset
0x0C Plane Array Offset
0x10 Object Array Offset
0x14 - 0x24 Blank(0x00000000)

Points: (2 words)
0x0 Floating Point X Coordinate
0x4 Floating Point Y Coordinate

Planes: (4 Words)
0x0 Left Point Array Index #
0x2 Right Point Array Index #
0x4 Left Plane Link Array Index # (-1 if null)
0x6 Right Plane Link Array Index #(-1 if null)
0x8 Blank(0xFFFFFFFF)
0xC Type
0xE Effect

Objects: (23 Words)
0x00 Start Plane Array Index #
0x02 Number of Planes
0x04 Blank(0x00000000)
0x08 Blank(0x00000000)
0x0C Blank(0x00000000)
0x10 Unknown
0x14 Point: Object Bottom Left
0x1C Point: Object Top Right
0x24 Unknown
0x28 Blank(0x0000)
0x2A Blank(0xFFFF)
0x2C-0x48 Name1
0x4C-0x68 Name2

Types:
0x0000 None
0x0001 Ground
0x0002 Roof
0x0004 Right Wall
0x0008 Left Wall
0x0010 Unknown
0x0040 Unknown

Effects: 
0x0000 Footstep Sound 1
0x0001 Footstep Sound 2
0x0002 Footstep Sound 3
0x0003 Footstep Sound 4
0x0004 Footstep Sound 5
0x0005 Footstep Sound 6
0x0006 Footstep Sound 7
0x0007 Footstep Sound 8
0x0008 Footstep Sound 9
0x0009 Footstep Sound 10
0x000A Shallow Water Effects
0x000B Bubble Sounds
0x000C Low Friction
0x000D Snow Sounds
0x000E Low Friction + Ice Effects
0x000F Footstep Sound 
0x0010 Low Friction
0x0011 Footstep Sound 11
0x0012 *Crash*
0x0013 *Crash
0x0014 *Crash*
0x0015 Loud Bubble Sounds
0x0016 Footstep Sound 12
0x0017 Footstep Sound 13
0x0100 Platform (drop-through)
0x4000 Unknown
0x8000 Unknown

Notes:
-Planes only work properly if their top side is facing the correct direction relative
to what type of plane it is. (The top side is "up" from the left point to the right point)

-Objects are composed of the Number of Planes starting from the plane at the
Start Plane Array Index #

-The Objects don't appear to have any overall effect on the planes or the points - they
only appear to be there for grouping them together (I imagine they have a use for
stages with moving platforms where an object and it's planes could be moved as a whole)
I've asked Kryal if he could add this to Brawl Box, but I haven't heard back from him yet - he's been kinda' busy lately, so I guess you can't blame him.
 

hotdogturtle

Smash Master
Joined
Feb 15, 2007
Messages
3,503
This reminds me of when I tried to swap the collision data from one of Battlefield's platforms with a stage builder platform. I didn't use a hex editor though, I just used BrawlBox. What happened was the platform itself became a ghost, but there was an invisible, completely functional Battlefield in the middle of the custom stage. Regardless of where you put the platform, or how many you put, the Battlefield was always in the center of the stage as long as there was at least 1 of the special platforms.

I'm not sure how helpful this is on its own, but my point is that something useful can come from swapping stage builder pieces, as long as we figure out how they work and get a little creative about it.

Edit: Ninja'd with important info from PW :o
 

Kaye Cruiser

Waveshocker Sigma
Joined
Aug 11, 2009
Messages
8,032
NNID
KayeCruiser
Switch FC
0740-7501-7043
Goddammit Phantom Wings! XD

That's my new personal catchphrase everytime you post something amazingly sexy. ¦D
 

superyoshi888

Smash Lord
Joined
Apr 8, 2008
Messages
1,026
Just one question: How do I read/write those values? I'm kinda new to this whole hex editing thing, and I was kinda hoping to use this to make an epic stage hack.
 

E-Jolteon

Smash Ace
Joined
Sep 7, 2007
Messages
502
Location
The other side
I love it when PW is just like "Oh, hi, I stole info from Nintendo HQ"

Okay, well, he doesn't quite do THAT, but...

High priority: Fix Onett roofsides.
 

...:::VILE:::...

Smash Ace
Joined
Apr 15, 2009
Messages
786
Hmmmm...

Well, i know a fair bit on the structure of OBJ files, im wondering if (with the information provided) an OBJ > Collision Data converter will be written. It actually shouldn't be too hard, it would make making collision files a TONNE easier.
 

Power Marshall

Smash Journeyman
Joined
Jul 18, 2009
Messages
202
Location
Everywhere
Phantom Wings' Guide: How to edit Collision Data.

Hello, people. Phantom Wings finally released his guide on editing Collision Data (MiscData)

I sent him an PM requesting to show mii how to edit collision data for stages.
And he told and insisted I also post his guide here.

Here it is:

Phantom Wings said:
Editing the collision files is really pretty simple, there are only a few concepts that need to be learned for it. For this example, I'll be using Final Destination's collision. Final Destination's collision file is MiscData[2] - you'll need to open it in a hex editor to modify it.

There are four main parts to the collision file. The first is the header. It looks like this:



The stage collision file headers are always 10 words. (1 word = 4 bytes) here's the format for the header.

Code:
0x00 Number of Points
0x02 Number of Planes
0x04 Number of Objects
0x06 Unknown
0x08 Point Array Offset
0x0C Plane Array Offset
0x10 Object Array Offset
0x14-0x24 Blank
For now we'll focus on the Points. 0x00 is a halfword (2 bytes) which contains the number of points (0011 = 17 points) 0x08 is the offset to the array of points that makes up the stage. Looking at it's value (00000028) and the number of points multiplied by the size of each point (2 words) we can surmise that the point array ranges from 0x28 to 0xB0



As I just said, each point is 2 words:

Code:
0x0 Floating point X coordinate
0x4 Floating point Y coordinate
Looking at 0x28 and 0x2C we can determine that the X and Y coordinate of the first point (point 0) is X=4299C083 Y=3F23D70A or X=76 and Y=0.64 in decimal.

If we were to roughly draw each of these points we'd get something like:



Look sorta' like FD?

Now, looking back at the header of the file, we're now going to examine the planes. 0x2 shows that there are also 17 planes. (the amount of planes doesn't always have to be equal to the number of points - it's just a coincidence this time) 0x0C also shows us that the array of planes starts at 0xB0. Each plane is 4 words, so we can now find the data for the planes.



Here's the format for each plane:

Code:
0x0 Left Point #
0x2 Right Point #
0x4 Left Plane Link #(-1 if none)
0x6 Right Plane Link #(-1 if none)
0x8 Blank (0xFFFFFFFF)
0xC Type
0xE Effect
Left Point # and Right Point # specify where the plane stretches from, We can see that plane 0 stretches from point 0 to point 1 in the diagram shown above. Plane 4 is the middle plane for the battle field stretching between 0 and 5.

Plane Links are used to graft planes together. Even if two planes are linked at the same point, there will still be a tear in the collision. (if you walk up to that tear, your character will enter the "balancing on edge" animation) There's a possibility that a character or object that can fall through the tear making things a bit troublesome for you. Plane Links do two things. They first cause your character to teleport from the one side of the plane to the opposite side of the linked plane for a smooth transition and second, they allow your character to travel across the tear without any side effects. In plane 0 we can see that it's left side is linked to plane 4 so that when you walk off the left side of plane 0 you appear on the right side of plane 4 (you don't notice it because those two points are literally one and the same) On a side note, if you have two planes with one directly above the other that were linked and you walked off the right side of the lower platform you'd appear on the left side of the upper platform.

Type and effect specify the behavior of the plane:

Code:
Types
0x0001 Ground
0x0002 Roof
0x0004 Right Wall
0x0008 Left Wall
0x0010 Interact In Air
0x0040 Unknown

Effects
0x0000 Footstep Sound
0x0001 Footstep Sound(Loud Tap)
0x0002 Footstep Sound(Dirt)
0x0003 Footstep Sound
0x0004 Footstep Sound(Echoing Tap)
0x0005 Footstep Sound
0x0006 Footstep Sound
0x0007 Footstep Sound
0x0008 Footstep Sound(Loud Tap)
0x0009 Footstep Sound
0x000A Shallow Water Effects
0x000B Bubble Footstep Sound
0x000C Low Friction
0x000D Snow Footstep Sound
0x000E Low Friction + Ice Effects
0x000F Light *Plink*
0x0010 Low Friction
0x0011 Footstep Sound
0x0012 Freeze
0x0013 Freeze
0x0014 Freeze
0x0015 Loud Bubble Footstep Sound
0x0016 Footstep Sound
0x0017 Footstep Sound
0x0100 Platform(drop-through)
0x2000 Left Edge
0x4000 Right Edge
0x8000 Unknown
These are pretty self explanatory. There's only one thing about the types, and that's that they will only work properly if they are facing the proper direction, any other direction and they'll bug up.

Code:
[B]Ground:[/B]
     ^
     |
L---------R 

[B]Roof[/B]

R---------L
     |
     v

[B]Right Wall[/B]

L
|
|-->
|
R

[B]Left Wall[/B]

   R
   |
<--|
   |
   L
Interact In Air can be used for things like walls that you can only walk into (but jump through) or ground that you can only walk onto. (but fall through if you're in air)

The effect 0x0100 is for platforms that you can drop down through by pressing down.



So we've got points and planes, but none of this will take any effect if they aren't placed inside an object. Back at the header we can find the object data through the offset value and length multiplied by the size. (23 words) In this case, there's only one object.



Code:
0x00 Plane Array Start #
0x02 Number of Planes
0x04 Blank
0x08 Blank
0x0C Blank
0x10 Unknown
0x14 Point: Object Bottom Left
0x1C Point: Object Top Right
0x24 Unknown
0x28 Blank
0x2A Blank (0xFFFF)
0x2C-48 Name1
0x4C-68 Name2
By looking at 0x00 and 0x02 we can see that this one object starts at plane 0 and encompasses 17 planes after that (meaning to say that it takes up every plane in the array)

0x10 is unknown, but it does seem to have some effect, so it may be best to leave it as is. I am unsure of the Points at 0x14 and 0x1C, but they appear to have the farthest bottom left and top right positions for the object - they don't appear to have any effect, but it may be best to set these to avoid any side effects. 0x24 is also unknown but it seems to be related to the plane indexes.

Both Name1 and Name2 are empty as there really isn't any dynamic movement in Final Destination's collision.



And that's that. there's nothing more for me to tell you. If you can grasp this (which I certainly believe you are capable of), then you should be perfectly capable of creating your own stage collisions. As long as you keep the correct count and offset values, it's perfectly fine to add or remove points, planes and objects as you need.

Hope this was helpful.:) Merry Christmas!
 

Almas

Smash Lord
Joined
Jul 6, 2008
Messages
1,588
That actually looks pretty awesome. Combined with some nifty tricks this gives even more power over stages. I'd love to see a couple of custom stages with the accidentally invented "ghost blocks" in use, too. It would add an interesting tactical element, albeit a poor one for game balance.
 

leafbarrett

Smash Lord
Joined
Jun 8, 2009
Messages
1,388
Location
USA
Alright, now I understand a lot more. Thanks PW!
Glad you do. I understand how each pair of points determines the coordinates, but I have no clue how it decides what points are connected.
EDIT: Oh! Now I see what he was talking about when he referenced 0x##! Duh XD I am clueless when it comes to hex editors.
 

rPSIvysaur

[ɑɹsaɪ]
Joined
Jun 7, 2009
Messages
16,415
I got lost at objects x_x
Well I sort of understand what they are, but I just need some clarification of what the name1/name2 things are and why we need objects and what the offsets in the objects parts mean a little more. Like what would the offset for 0x14 and 0x1C be for a platform on SV if it were just a simple platform which is one plane?

Another thing is how do we find how the coordinates coorelate to the stage you see on screen? >.>
 

Power Marshall

Smash Journeyman
Joined
Jul 18, 2009
Messages
202
Location
Everywhere
I think I would understand it much better if I knew what points were...
I am learning as well. I believe points are where planes are linked to.

Look at my poor illustration: :laugh:





As you can see, it looks like FD right? Now here's the terms we need to know.

Points
Planes
Object data


The Points are where each Plane should be connected to. FD has 17.(DOTS)

The Planes are the borders for the size and shape of FD's object data. (FD has 17 also, coincidently)(LINES)

Object data is the battle field of the whole stage, what characters walk on. . Has effects for walking, cliffs and ect.(GREY FILL-IN)

*This may not be right, unless Phantom confirms it, I only "learned" this today.

EDIT: Wow, a lot of people reply so quickly. :laugh:
 

Shadic

Alakadoof?
Joined
Dec 18, 2003
Messages
5,695
Location
Olympia, WA
NNID
Shadoof
If somebody were to alter the FD ledge area so that you couldn't get stuck (Probably by moving the area right under the ledge outward) I think they would be loved forever.
 

fortwaffles

Smash Ace
Joined
Jan 20, 2009
Messages
514
WOW! using this with my vertex editing tutorial... i know how im spending my day tomorrow :D lol
 

Almas

Smash Lord
Joined
Jul 6, 2008
Messages
1,588
The objects aren't the entire stage. Generally, they're sets of linked planes. We would expect Battlefield to have 4 - one for each platform, and one for the main mass. Note that the data provided isn't complete; it doesn't contain a way for objects to be destroyed, respawn, or move. Presumably these may be part of the object's namespace?

(And this characteristic must be ascribable to objects rather than planes, considering the Snake map).
 

fortwaffles

Smash Ace
Joined
Jan 20, 2009
Messages
514
Hmm... i think i might look for the type values of ice, and spikes in the stage builder. unless someone beats me to it
Spikes are 12. PW has that as crashes, which leads me to think that it calls for external code, and may only work in stage editors
 

MK26

Smash Master
Joined
Jun 29, 2008
Messages
4,450
Location
http://www.mediafire.com/?zj2oddmz0yy for ZSS fix!
movenent is probaby contained in the TransN bone

EDIT@waffles

Contains a more detailed set of information than your average stateformat.txt.

Code:
0x18 - Size - $20

0x1C - Compressed Size - $20

0x20 - Creator Name (Requires other data somewhere to be changed to be seen on Brawl)

0x2A - Stage Description

0x54 - ASCII: "ED01"
0x58 - End of picture (Full) + $34
0x5C - Beginning of picture + $54
0x60 - End of picture (Wide)? + $34 ($F0 less then Full)

0x64 - Usually 0x00 00 00 80
0x68 - Stage Style
	00 - Nature
	01 - Factory
	02 - Remains

0x69 - Stage Size
	00 - Small (10 block width)
	01 - Medium (14 block width)
	02 - Large (18 block width)

0x6A - Number of Blocks contained
0x6B - Preview Pic Setting [00=Full:Other=Wide]
0x6C - Music ID

0x6E - Unknown

0x70 - Stage name

0x94 - P1x Spawn
0x98 - P1y Spawn
0x9C - P2x Spawn
0xA0 - P2y Spawn
0xA4 - P3x Spawn
0xA8 - P3y Spawn
0xAC - P4x Spawn
0xB0 - P4y Spawn
0xB4 - P5x Spawn?
0xB8 - P5y Spawn?
0xBC - P6x Spawn?
0xC0 - P6y Spawn?
0xC4 - P7x Spawn?
0xC8 - P7y Spawn?
0xCC - P8x Spawn?
0xD0 - P8y Spawn?

0xD4 - Blocks

	Byte 1: Tile position (no X/Y, just position as if a single dimension ex: if the width is 12 and you want to place it in the second row, then this byte is 0x0C[12])
	Byte 2: Tile Size
		00000011	- 'Block Size' as referenced by the stage editor/spring power / Fractions Width
		00011100 	- Size Y
		11100000 	- Size X

	Byte 3: Tile ID
		00011111	- Tile ID
		01100000        - Fractions the block height (1/3, 1/5, 1/7)
		10000000 (0x80) - Determins other size factors

	Byte 4: Tile Flags
		00011111	- Disables/enables junk surrounding in stage builder
		00100000 (0x20) - Determines if tile is flipped
		11000000 	- Tile ID (2) and/or Fractions the block height

		Tile ID		Tile ID 2	Description
		01000		10		Ancient Support
		01000		11		Future Blue Tube
		01001		00		Nature Tree Shelter
		01001		01		Ancient Building
		01010		00		Nature Tree
		01010		01		Ancient Tri-Support / Future I
		01010		10		Nature Mushrooms
		01010		11		Ancient Toilet
		01011		00		Ancient Pullup Thing / Nature Rock Shelter / Future Support
		01011		01		Nature Tiki
		01100		11		Ferris Wheel
		10000		01		Passthrough Floor
		10000		10		Passthrough Slanted Floor
		10000		11		Passthrough Centered Floor
		10001		00		Stage-Theme Bump
		10001		01		Stage-Theme Block
		10001		10		Stage-Theme Stairs
		10001		11		Stage-Theme Slant
		10010		01		Stage-Theme 2x1 Slant
		11000		10		Nature Rock Table / Future Grill
		11000		11		Nature Stump
		11001		00		Fallen Ancient Support / Future Platform
		11001		10		Ancient Slant / Future Screwthing
		11010		00		Ancient Slant + Support / Future Bed
		11010		11		Nature Toilet
		11011		01		Future /\
		11100		01		Up+Down Elevator
		11100		10		Left+Right Elevator
		11101		00		Spring; Needs Byte 3's 0x80
		11101		01		Ice Block
		11101		10		Falling Block
		11101		11		Conveyor Belt
		11110		00		Spikes
		11110		01		Ladder
 

JamesRaynor

Smash Apprentice
Joined
May 30, 2009
Messages
82
This is interesting, does this mean it could be possible t make new stage builder parts?
 

Almas

Smash Lord
Joined
Jul 6, 2008
Messages
1,588
This wouldn't be used for making new builder parts, it would be used for making or modifying pre-existing stages. The latter to begin with, clearly.
 

superyoshi888

Smash Lord
Joined
Apr 8, 2008
Messages
1,026
Well, I would use it to make new parts to make better stages.

And lol, this is needed to fix the Blue Falcon. Maybe I'll learn how to do it and actually not be lazy. >>
 
Top Bottom