Kuribo64
Views: 19,851,436 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
03-28-24 04:57 PM
Guest:

0 users reading Let's hack... Super Monkey Ball! | 1 bot

Main - Misc. ROM hacking - Let's hack... Super Monkey Ball! Hide post layouts | New reply

Pages: 1 2 3
Yoshimaster96
Posted on 11-04-14 03:57 PM (rev. 2 of 11-04-14 03:57 PM) Link | #50774
Need help cracking this collision:

FLOAT:

-5
0
-5
0
1
0
-2.01
-2.01
10
0
10
10
-1
0
0.71
-0.71

-5
0
-5
0
1
0
-2.01
-37181718523570814976
14.14
0
14.14
14.14
-0.71
-0.71
0.71
-0.71

HEX:

C0A00000
00000000
C0A00000
00000000
3F800000
00000000
C0010000
C0010000
41200000
B58637BD
41200001
411FFFFF
BF800000
00000000
3F3504F7
BF3504F7

C0A00000
00000000
C0A00000
00000000
3F800000
00000000
C0010000
E0010000
4162462F
B58637BD
40E24630
40E2462E
BF3504F7
BF3504F7
3F3504F7
BF3504F7

The level is 10x10 units, centered at the origin.
Dimensions:
-X left
+X right
-Y down
+Y up
-Z forward
+Z backward

[EDIT]

I suspect complex functions, such as trig, may be involved. Investigate further!

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

blank
Posted on 11-05-14 05:18 AM Link | #50848
It's hard to say much based on this, but my guess would be that the first three floats are the base point of the triangle and the next three are the normal. The next two I'm not sure are floats at all. The next four I don't really have any idea about, but if this is supposed to be 10x10 square then 10 is the width/height and 14.14 is the diagonal. The last four are 2 2D normal vectors. How exactly this translate into a triangle I'm not sure of.

As for trigonometric functions I doubt they are involved. Collision testing has to run fast and trigonometric functions are slow.

Yoshimaster96
Posted on 11-05-14 01:32 PM (rev. 2 of 11-05-14 02:55 PM) Link | #50855
Posted by blank
It's hard to say much based on this, but my guess would be that the first three floats are the base point of the triangle and the next three are the normal. The next two I'm not sure are floats at all. The next four I don't really have any idea about, but if this is supposed to be 10x10 square then 10 is the width/height and 14.14 is the diagonal. The last four are 2 2D normal vectors. How exactly this translate into a triangle I'm not sure of.

As for trigonometric functions I doubt they are involved. Collision testing has to run fast and trigonometric functions are slow.
2D vectors can be used if you have a plane, which you can get from a normal vector. Also, trig is necessary for rotation matrices, which means it may be used for collision. For example, sin(atan(-37181718523570814976)) is very close to -1, also cos(atan(-37181718523570814976)) is very close to 0.

[EDIT]

Perhaps F-Zero GX uses a similar collision format. I heard that format is known.

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

blank
Posted on 11-05-14 07:12 PM Link | #50862
Taking atan of a very large number is essentially meaningless due to tan's asymptotic behavior. In general if the value of a float is very large it's probably not actually a float.

Do you have some more examples, possibly some entire collision files? It's very hard to say much based on just two triangles.

Yoshimaster96
Posted on 11-05-14 08:31 PM Link | #50865
I could, but the collision triangles don't match the level geometry, so it'd be hard to make a conclusion.

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

Yoshimaster96
Posted on 11-08-14 09:21 PM Link | #50986
Anyone know how F-Zero GX's collision is encoded?

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

Arisotura
Posted on 11-08-14 09:31 PM Link | #50988
I'm going to say that just throwing a bunch of floats without giving much more precision isn't going to be very helpful. Providing a sample file (or telling people how to obtain one if legality is an issue) would work better imo.

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd

Yoshimaster96
Posted on 11-08-14 10:51 PM (rev. 9 of 11-23-14 01:25 AM) Link | #50999
You'll need a SMB1 ISO and this program:
http://gamehacking.org/downloads/LZSCDec.7z

Extract an lz file.
To decompress, delete the first 4 bytes with a hex editor (or any 4 bytes of the first 8 bytes), then decompress with the program.
To compress, compress with the program, then edit the first 4 bytes to 8 bytes:
CC CC CC CC UU UU UU UU
C: Total compressed size (including these 8 bytes)
U: Uncompressed size
These values are in little endian.

For levels:
File header (0xA0 bytes):

## ## ## ## - ??? (Usually 00 00 00 01)
## ## ## ## - ??? (Usually 00 00 00 64)
## ## ## ## - COLLISION
## ## ## ## - OFFSET 1
00 00 00 A0 ## ## ## ## - ALWAYS
## ## ## ## - NO. GOALS???
## ## ## ## - OFFSET 2
## ## ## ## - NO. GOALS???
00 00 00 00 - ALWAYS
## ## ## ## - BUMPERS
## ## ## ## - OFFSET 3
## ## ## ## - NO. JAMABARS (SEE AD14 AND AD25)
## ## ## ## - OFFSET
## ## ## ## - BANANAS
## ## ## ## - OFFSET 4
00 00 00 00 00 00 00 00 - ALWAYS
00 00 00 00 00 00 00 00 - ALWAYS
## ## ## ## - NO. SOMETHING
## ## ## ## - OFFSET 5
## ## ## ## - LEVEL MODELS
## ## ## ## - OFFSET 6
00 00 00 00 00 00 00 00 - ALWAYS
## ## ## ## - MODELS
## ## ## ## - OFFSET 7
## ## ## ## - NO. SOMETHING
## ## ## ## - OFFSET
## ## ## ## ## ## ## ## - ???
## ## ## ## - REFLECTION FLAG?
## ## ## ## - OFFSET 8
00 00 00 00 00 00 00 00 - ALWAYS
00 00 00 00 00 00 00 00 - ALWAYS
00 00 00 00 00 00 00 00 - ALWAYS



GOAL FORMAT:
XX XX XX XX - X POSITION (FLOAT)
YY YY YY YY - Y POSITION (FLOAT)
ZZ ZZ ZZ ZZ - Z POSITION (FLOAT)
XX XX - X ROTATION (INT, FULL RANGE IS 360 DEGREES)
YY YY - Y ROTATION (INT, FULL RANGE IS 360 DEGREES)
ZZ ZZ - Z ROTATION (INT, FULL RANGE IS 360 DEGREES)
CC CC - GOAL COLOR (4200 IS BLUE, 4700 IS GREEN, 5200 IS RED)

JAMABAR FORMAT:
XX XX XX XX - X POSITION (FLOAT)
YY YY YY YY - Y POSITION (FLOAT)
ZZ ZZ ZZ ZZ - Z POSITION (FLOAT)
XX XX - X ROTATION (INT, FULL RANGE IS 360 DEGREES)
YY YY - Y ROTATION (INT, FULL RANGE IS 360 DEGREES)
ZZ ZZ - Z ROTATION (INT, FULL RANGE IS 360 DEGREES)
00 00 - ALWAYS 0
XX XX XX XX - X SCALE (FLOAT)
YY YY YY YY - Y SCALE (FLOAT)
ZZ ZZ ZZ ZZ - Z SCALE (FLOAT)

BUMPER FORMAT:
XX XX XX XX - X POSITION (FLOAT)
YY YY YY YY - Y POSITION (FLOAT)
ZZ ZZ ZZ ZZ - Z POSITION (FLOAT)
XX XX - X ROTATION (INT, FULL RANGE IS 360 DEGREES)
YY YY - Y ROTATION (INT, FULL RANGE IS 360 DEGREES)
ZZ ZZ - Z ROTATION (INT, FULL RANGE IS 360 DEGREES)
00 00 - ALWAYS 0
XX XX XX XX - X SCALE (FLOAT)
YY YY YY YY - Y SCALE (FLOAT)
ZZ ZZ ZZ ZZ - Z SCALE (FLOAT)

BANANA FORMAT:
XX XX XX XX - X POSITION (FLOAT)
YY YY YY YY - Y POSITION (FLOAT)
ZZ ZZ ZZ ZZ - Z POSITION (FLOAT)
TT TT TT TT - TYPE OF BANANA (00000000 SINGLE, 00000001 BUNCH)

MODEL FORMAT:
UNKNOWN, SEEMS TO BE SOME KIND OF TREE/HIERARCHY

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

Yoshimaster96
Posted on 11-13-14 10:41 PM Link | #51170
Anyone make use of my notes? Also, if anyone wants me to try values for the collision, I'll be glad to.

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

Yoshimaster96
Posted on 11-16-14 01:10 AM Link | #51247
YAY! I FINALLY CRACKED THE COLLISION !!!1!!11!!11one
But it's so glitchy that the ball falls through the floor at random places

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

Yoshimaster96
Posted on 11-19-14 12:20 AM (rev. 5 of 11-22-14 08:02 PM) Link | #51440
COLLISION TRIANGLE FORMAT

04 X1
04 Y1
04 Z1
04 Normal X
04 Normal Y
04 Normal Z
02 X Angle
02 Y Angle
02 Z Angle
02 Zero
04 DX2X1
04 DY2Y1
04 DX3X1
04 DY3Y1
04 ?
04 ?
04 ?
04 ?

04 & 02 are lengths.

X1, Y1, and Z1 are the first point in the triangle.
Normal is, obviously, the triangle's normal vector.
X, Y, and Z angle specifies the rotation angle (Z then X then Y) as integers, which are scaled to 360 degrees (i.e. 4000 is 90 degrees, 8000 is 180, C000 is 270).
DX2X1 and DY2Y1 specify the distance from point 1 to point 2 (DX3X1 and DY3Y1 do the same for point 3).
Note that DZ is not specified, so rotation is necessary.
Also note that said rotation takes place about point 1, NOT the origin.
The ?s are 2 2D vectors, that's all I know at the moment.

[EDIT]

Now we just need to convert GMA 3D triangles to LZ 3D triangles

GMA 3D triangle format:
04 Pos X
04 Pos Y
04 Pos Z
04 Normal I
04 Normal J
04 Normal K
04 Color RGBA (Optional)
04 Texture S
04 Texture T

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

Yoshimaster96
Posted on 12-01-14 11:11 PM (rev. 2 of 12-02-14 12:23 AM) Link | #52107
Some dumb program I made to extract collision from LZ files:
https://www.dropbox.com/s/bh3gpf9mypv1h5i/lz2obj.exe?dl=0
Decompress LZ files with this:
https://www.dropbox.com/s/vkuua4a2g8inpi7/lzfix.zip?dl=0

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

Yoshimaster96
Posted on 12-06-14 03:17 PM Link | #52299
Screenshot of my new program, "LZ Modifier" (not final name):
[image]

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

MandL27
Posted on 12-06-14 04:32 PM Link | #52304
Posted by Yoshimaster96
Screenshot of my new program, "LZ Modifier" (not final name):
[image]

Wow, that's actually looking nice! I may have to try this eventually, hehe. Anyways, would it be possible to use the actual models for goals/bananas/etc instead of just colored boxes? SonED did this a lot which made it not exactly usable imo...

____________________
Come to MandLBoards today!



<%Eevee> lance with a flygon
<%Eevee> shit got real
<~MandL27> ^
<~MandL27> Evice has a team full of starters
<~MandL27> shit got more real

Me: *starts convo about IRC clients, saying that FP should at least try other clients before making them out to be objectively inferior to Mibbit*
Falconpunch: "Fuck you, MandL."
fp be more idiot than jedayoshi

blank
Posted on 12-06-14 04:52 PM Link | #52308
Posted by Yoshimaster96
Some dumb program I made to extract collision from LZ files:
https://www.dropbox.com/s/bh3gpf9mypv1h5i/lz2obj.exe?dl=0
Decompress LZ files with this:
https://www.dropbox.com/s/vkuua4a2g8inpi7/lzfix.zip?dl=0


When trying to run these I get an error telling me that I'm missing MSVCR100D.dll, which as far as I can tell means that the programs are debug versions.

gridatttack
Posted on 12-06-14 07:03 PM Link | #52318
Awesome, an editor is on the works. I wonder, hwo is the BG handled? Is there something in the game that tells the game what backdrop it will use? Or are they hardcoded?

____________________
[image] [image]

Yoshimaster96
Posted on 12-06-14 07:34 PM (rev. 2 of 12-06-14 07:39 PM) Link | #52321
Posted by gridatttack
Awesome, an editor is on the works. I wonder, hwo is the BG handled? Is there something in the game that tells the game what backdrop it will use? Or are they hardcoded?
The BG is usually made of several models, each loaded by name with a position, rotation, and scaling. These objects are static and cannot move.

Posted by blank
Posted by Yoshimaster96
Some dumb program I made to extract collision from LZ files:
https://www.dropbox.com/s/bh3gpf9mypv1h5i/lz2obj.exe?dl=0
Decompress LZ files with this:
https://www.dropbox.com/s/vkuua4a2g8inpi7/lzfix.zip?dl=0


When trying to run these I get an error telling me that I'm missing MSVCR100D.dll, which as far as I can tell means that the programs are debug versions.

Try these:
https://www.dropbox.com/s/bh3gpf9mypv1h5i/lz2obj.exe?dl=0
https://www.dropbox.com/s/vkuua4a2g8inpi7/lzfix.zip?dl=0

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

gridatttack
Posted on 12-06-14 07:48 PM (rev. 2 of 12-06-14 07:53 PM) Link | #52323
Posted by Yoshimaster96
Posted by gridatttack
Awesome, an editor is on the works. I wonder, hwo is the BG handled? Is there something in the game that tells the game what backdrop it will use? Or are they hardcoded?
The BG is usually made of several models, each loaded by name with a position, rotation, and scaling. These objects are static and cannot move.


Yeah I found they are like this when ripping models from them. I wonder, can they be repositioned? (when ripping an entire level, all the BG objects get set to the middle, so a value somewhere must be positioning the objects when the level loads)

I also wonder this, can the background used for each level be changed? Like, instead of a jungle, I want to use the ice theme?

____________________
[image] [image]

Yoshimaster96
Posted on 12-06-14 08:55 PM (rev. 2 of 12-06-14 09:19 PM) Link | #52324
Posted by gridatttack
Posted by Yoshimaster96
Posted by gridatttack
Awesome, an editor is on the works. I wonder, hwo is the BG handled? Is there something in the game that tells the game what backdrop it will use? Or are they hardcoded?
The BG is usually made of several models, each loaded by name with a position, rotation, and scaling. These objects are static and cannot move.


Yeah I found they are like this when ripping models from them. I wonder, can they be repositioned? (when ripping an entire level, all the BG objects get set to the middle, so a value somewhere must be positioning the objects when the level loads)

I also wonder this, can the background used for each level be changed? Like, instead of a jungle, I want to use the ice theme?
The positions are in the LZ file associated with the level. As for the second question, I guess that changing the name is enough, though I could be wrong.
[EDIT]
Welp, tried replacing a jungle level to a night level simply by changing the names, but Dolphin crashed. Therefore my guess is that it is hardcoded.

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96

Yoshimaster96
Posted on 12-21-14 05:43 PM (rev. 2 of 12-21-14 08:03 PM) Link | #52901
I figured out what the glitch collison does: it acts as a collision rectangle from (x,z) (-16,11.314) to (0,0) at y=0. The collision when ST_COLI is enabled shows the correct collision, yet it acts like the rectangle.

[EDIT]

Sorry I wasn't clear. When debugging, the actual (octagonal) collision is visible, but a rectangle of collision is what the ball actually collides with.

My Youtube Channel:
Yoshimaster96smwc
Some layout tips/code!

-Yoshimaster96
Pages: 1 2 3

Main - Misc. ROM hacking - Let's hack... Super Monkey Ball! Hide post layouts | New reply

Page rendered in 0.122 seconds. (2048KB of memory used)
MySQL - queries: 29, rows: 239/239, time: 0.017 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.