Views: 19,998,551 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
04-20-24 09:54 AM |
Guest: |
0 users reading Looking into SM64DS fixing collision | 1 bot |
Main - General SM64DS hacking - Looking into SM64DS fixing collision | Hide post layouts | Thread closed |
Fiachra |
| ||
Local moderator Level: 65 Posts: 12/1065 EXP: 2237233 Next: 98395 Since: 12-15-12 From: Ireland Last post: 2155 days ago Last view: 104 days ago |
When exporting .OBJ from Sketchup (I used this plugin https://sites.google.com/site/messiaen64/level-importer/ObjExporter.rb?attredirects=0) make sure you don't tick "Guess faces to export", but do tick "Front Faces". I think the plugin may be assuming that with a strip of triangles, the normals alternate.
Edit: Looks like it should work now: and here's the Sketchup OBJ Export dialogue: |
ray |
| ||
Normal user Level: 25 Posts: 67/119 EXP: 85171 Next: 4449 Since: 07-07-12 From: In front of my PC Last post: 2741 days ago Last view: 2530 days ago |
I don't know what is going on. I used your plugin (I normally use the Sketchup export) and somehow everything is different:
1. I imported it into the Game -> KCL IS triangulated, even if I didn't triangulate it. 2. The game DOES NOT crash, even if the triangulated model has waay more than 2048 faces. 3. The Textures look PERFECT (Sketchup exporter makes them darker and such) 4. The model is mirrored on the Z axis. 5. Actually, some of the faces can't be seen after importing. It's like you said, they are facing inside, but that only happens after triangulating. 6. I have no idea what to do. EDIT: What did you do that it works? o0 ____________________ Check out my Patreon Page if you want to support me |
Arisotura |
| ||
Star Mario in this room you have a pile of apple pies Level: 163 Posts: 626/9019 EXP: 56227211 Next: 260433 Since: 07-03-12 From: in a box Last post: 8 days ago Last view: 3 days ago |
Fiachra |
| ||
Local moderator Level: 65 Posts: 13/1065 EXP: 2237233 Next: 98395 Since: 12-15-12 From: Ireland Last post: 2155 days ago Last view: 104 days ago |
Posted by ray 4. Import the .obj model into Blender. Right-click on it. Select Object>Mirror>Z Global This should flip it on its Z axis (if it asks you to select and axis, press 'Z' on the keyboard). There is an option when importing the model to flip Z axis but I just realised that I didn't implement that for the new collision importing so it will flip the model but not the collision. 5. When I left the textures as they were the game crashed because the "yellow-coin.png" one is too large. Resizing that causes only part of the face to be visible. I noticed that the larger its resolution, the more of it can be seen in the game. All faces actually are visible, the game just crashes loading their textures. The collision is also perfect now. 6. If you can get the coin model textures resized properly, then your model should look fine in the game. If you can't get it working I'll try and fix it tomorrow for you. |
ray |
| ||
Normal user Level: 25 Posts: 68/119 EXP: 85171 Next: 4449 Since: 07-07-12 From: In front of my PC Last post: 2741 days ago Last view: 2530 days ago |
Posted by Fiachra Wait what? How the hell did you fix the collision now? It just doesn't work for me. And yes I noticed the coin-texture-thing and it's already fixed here on my Computer. Just the Collision fails. ____________________ Check out my Patreon Page if you want to support me |
Skelux |
| ||
Banned Level: 28 Posts: 16/148 EXP: 116159 Next: 15179 Since: 11-27-12 Last post: 3617 days ago Last view: 2077 days ago |
Well, I'm a little more confused and concerned about the freezing stars now. Almost every star freezes on contact. I imported a level over the wing cap course, placed 8 red coins and a star spawner with the exact same parameters, but It still froze. Any ideas?
Edit: It only seems to be in my star road rom. It happens on stars that zoom the camera out when you collect them. Any idea what files may be responsible for this? Could you tell me which files handle what objects are in a level, so I can just move them over to a fresh rom? |
Fiachra |
| ||
Local moderator Level: 65 Posts: 14/1065 EXP: 2237233 Next: 98395 Since: 12-15-12 From: Ireland Last post: 2155 days ago Last view: 104 days ago |
Skelux:
Are you deleting the original star in the level? Maybe it freezes because there's a duplicate? Not really sure. What happens if, instead of adding a new star you just move the original star object's position and the star act that it appears in? I don't know why it would only happen in your rom, maybe Mega-Mario can help more with this. In a patched rom, the level data (including objects) are stored in overlays 103 - 154. You should be able to copy these to a new patched rom. Use Nitro Explorer or NSMBe so as not to corrupt the ROM header. Ray: You're right, the collision on the coins isn't right, I hadn't noticed because I imported them with a small scale. It's definitely a problem with the normals on the coins, the exporter seems to think some of the outside faces are on the inside. Strangely, flipping the normals of those faces didn't work. Also, the player falling out of the sky is just with your model. I'll see if I can get it exporting properly and will let you know. |
ray |
| ||
Normal user Level: 25 Posts: 69/119 EXP: 85171 Next: 4449 Since: 07-07-12 From: In front of my PC Last post: 2741 days ago Last view: 2530 days ago |
Posted by Fiachra What do you mean? ____________________ Check out my Patreon Page if you want to support me |
Fiachra |
| ||
Local moderator Level: 65 Posts: 15/1065 EXP: 2237233 Next: 98395 Since: 12-15-12 From: Ireland Last post: 2155 days ago Last view: 104 days ago |
Posted by ray Whenever I import your model, the camera is pointed up at the sky. After a few seconds you can see the player falling from the sky and then hits the gound and loses about half his health. I tried a different OBJ Export plugin and the same thing happens but the coins are even worse using this plugin (http://www.sendspace.com/file/w945la). One time I messed up the model, can't remember how and the player started in the right place. Weird. |
ray |
| ||
Normal user Level: 25 Posts: 70/119 EXP: 85171 Next: 4449 Since: 07-07-12 From: In front of my PC Last post: 2741 days ago Last view: 2530 days ago |
Hm, for me the player starts at the right position. ____________________ Check out my Patreon Page if you want to support me |
Fiachra |
| ||
Local moderator Level: 65 Posts: 16/1065 EXP: 2237233 Next: 98395 Since: 12-15-12 From: Ireland Last post: 2155 days ago Last view: 104 days ago |
Posted by ray That's good then. Unfortunately I couldn't get the coin working as the sloped parts just wouldn't export properly. Maybe you can try using one of these models: http://sketchup.google.com/3dwarehouse/details?mid=85028b9f1057fb63d2191f7229b07ca6&prevstart=0 http://sketchup.google.com/3dwarehouse/details?mid=252889819ee1e5165a51ab55e054a42a&prevstart=0 and give them the old coin's texture. Ones like this shouldn't case a problem when exporting as they're not sloped on the inside. |
ray |
| ||
Normal user Level: 25 Posts: 71/119 EXP: 85171 Next: 4449 Since: 07-07-12 From: In front of my PC Last post: 2741 days ago Last view: 2530 days ago |
Okay thanks, I'll try when I find the time for it. The reason why I didn't want to use them, was the light. The coins I now have, have shadows, created by the texture. But the other ones are just one color, and it looks like ONE big face in SM64DS itself, since we can't add shadows/light. ____________________ Check out my Patreon Page if you want to support me |
Fiachra |
| ||
Local moderator Level: 65 Posts: 17/1065 EXP: 2237233 Next: 98395 Since: 12-15-12 From: Ireland Last post: 2155 days ago Last view: 104 days ago |
OK, turns out there was a problem with the collision! Two actually. (Sorry Ray)!
This line: if (cross(v.sub(u), w.sub(u)).norm_sq() < 0.001) { continue; } //#TODO: find a better solution was getting rid of very small faces, like the ones on the inside of the coin - the coins now work. Also this: int result = (int)(ix*this.magic_x + iy*this.magic_y + iz*this.magic_z) % this.num_buckets; Sometimes num_buckets could be equal to zero if there were fewer than 256 triangles in the model (problem is also in blank's script, download fix here: http://www.sendspace.com/file/yyj6e8). I've fixed this problem as well in the editor (code added to repo). Ray: What scale are you using for your model? I'm still having the player fall out of the sky. I've noticed this problem with other models - especially small models and sometimes when otherwise fine models are scaled. Edit: The problem with falling from the sky isn't just SM64DSe - it happens when using blank's script as well. When I was trying to get it working this usually happened if the octree wasn't right - maybe it's being made too large? Edit 2: Importing the same model to replace an object's model doesn't cause any problems. Maybe the game expects a level model' size to be within a certain range? Also, I realised there was a problem with importing an object model in that it replaced the level's model/collision instead - this has now been fixed in the latest commit. |
Skelux |
| ||
Banned Level: 28 Posts: 17/148 EXP: 116159 Next: 15179 Since: 11-27-12 Last post: 3617 days ago Last view: 2077 days ago |
Posted by Fiachra Thanks, moving the files over to a fresh rom fixed everything. I'll start a Star Road DS thread now, I'll probably have things to post about it quite often. |
ray |
| ||
Normal user Level: 25 Posts: 72/119 EXP: 85171 Next: 4449 Since: 07-07-12 From: In front of my PC Last post: 2741 days ago Last view: 2530 days ago |
@Fiachra: Thanks a lot! It finally works Now I only need to do the Level objects etc. ____________________ Check out my Patreon Page if you want to support me |
Main - General SM64DS hacking - Looking into SM64DS fixing collision | Hide post layouts | Thread closed |
Page rendered in 0.054 seconds. (2048KB of memory used) MySQL - queries: 28, rows: 224/224, time: 0.015 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |