Views: 20,052,601 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
04-25-24 06:34 AM |
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 |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 2/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
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! |
blank |
| ||
Normal user Level: 26 Posts: 115/129 EXP: 96173 Next: 6102 Since: 07-08-12 Last post: 3341 days ago Last view: 2314 days ago |
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 |
| ||
Member Normal user Level: 39 Posts: 4/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
Posted by blank2D 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. |
blank |
| ||
Normal user Level: 26 Posts: 116/129 EXP: 96173 Next: 6102 Since: 07-08-12 Last post: 3341 days ago Last view: 2314 days ago |
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 |
| ||
Member Normal user Level: 39 Posts: 5/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
I could, but the collision triangles don't match the level geometry, so it'd be hard to make a conclusion. |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 7/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
Anyone know how F-Zero GX's collision is encoded? |
Arisotura |
| ||
Star Mario in this room you have a pile of apple pies Level: 163 Posts: 2725/9019 EXP: 56258912 Next: 228732 Since: 07-03-12 From: in a box Last post: 13 days ago Last view: 23 hours ago |
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 |
| ||
Member Normal user Level: 39 Posts: 8/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
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 |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 9/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
Anyone make use of my notes? Also, if anyone wants me to try values for the collision, I'll be glad to. |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 12/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
YAY! I FINALLY CRACKED THE COLLISION !!!1!!11!!11one
But it's so glitchy that the ball falls through the floor at random places |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 14/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
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 |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 15/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
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 |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 19/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
Screenshot of my new program, "LZ Modifier" (not final name):
|
MandL27 |
| ||
Member Normal user Level: 16 Posts: 24/48 EXP: 19706 Next: 550 Since: 09-13-14 Last post: 3406 days ago Last view: 3350 days ago |
Posted by Yoshimaster96 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! |
blank |
| ||
Normal user Level: 26 Posts: 122/129 EXP: 96173 Next: 6102 Since: 07-08-12 Last post: 3341 days ago Last view: 2314 days ago |
Posted by Yoshimaster96 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 |
| ||
Giant Red Paratroopa K64 RPG Overlord Level: 73 Posts: 771/1416 EXP: 3483597 Next: 2271 Since: 08-11-12 From: El Salvador Last post: 1072 days ago Last view: 1065 days ago |
|
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 20/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
Posted by gridatttackThe 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 Try these: https://www.dropbox.com/s/bh3gpf9mypv1h5i/lz2obj.exe?dl=0 https://www.dropbox.com/s/vkuua4a2g8inpi7/lzfix.zip?dl=0 |
gridatttack |
| ||
Giant Red Paratroopa K64 RPG Overlord Level: 73 Posts: 772/1416 EXP: 3483597 Next: 2271 Since: 08-11-12 From: El Salvador Last post: 1072 days ago Last view: 1065 days ago |
|
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 21/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
Posted by gridatttackThe 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. |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 28/345 EXP: 376960 Next: 27811 Since: 11-03-14 Last post: 1947 days ago Last view: 888 days ago |
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. |
Main - Misc. ROM hacking - Let's hack... Super Monkey Ball! | Hide post layouts | New reply |
Page rendered in 0.155 seconds. (2048KB of memory used) MySQL - queries: 29, rows: 235/235, time: 0.032 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |