Views: 19,850,194 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
03-28-24 08:57 AM |
Guest: |
Main - Posts by Fiachra |
Fiachra |
| ||
Local moderator Level: 65 Posts: 1/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
Hi, Fiachra here, glad you like the changes.
I've nearly got the level models' geometry exporting: If I can get that working properly it should be possible to compare the game's kcl collision data with that generated by re-importing the level and see what the problem is. Although that may not be neccesary as I think Mega-Mario, blank and others are making good progress on that. (https://kuribo64.net/?page=thread&id=128&from=20) Posted by Homer Currently you can import custom models for non-animated objects, such as brick blocks. Importing custom characters would require modifying the bca animation files, though that should be possible in the future as Gericom has it working in his MKDS editor. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 2/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
Thanks for the GBATek link - it was very helpful.
I've now got it working more or less perfectly - some models have 1 or 2 faces missing but you can just fill them in with Blender as the vertices are still there. Here's the same model as earlier (it was the castle courtyard) and the main castle grounds as they appear now after exporting: They look identical when re-imported (minus textures). I'll also be adding the ability to export objects' models. Also, I've converted the whole GBATek site into a pdf with working links for navigation if anyone wants it: http://www.sendspace.com/file/zk9vmf |
Fiachra |
| ||
Local moderator Level: 65 Posts: 3/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
The latest version of SM64DSe in the repo has the ability to export level models almost exactly (http://postimage.org/image/ruuu6hmw7/). You can then reimport them (but make sure to reove the textures first - seems to cause problems) and compare the collision files generated by Nintendo and those made by the editor. For example here's the Main Castle before and after collision files:
http://www.sendspace.com/file/5ckyiv The original is about 5kB bigger. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 4/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
Posted by ray I've added a kcl terrain type editor to SM64DSe so you can now fix that, though it'll be quite tedious - I need to add multiple selections and an easier way of selecting a face. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 5/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
Has there been any word from blank regarding the modified version of his script?
I've already got his python script from collision tools v0.6 in the editor but I haven't been able to get it to produce SM64DS kcl files properly. If I had his new version I reckon I could get it working quite quickly. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 6/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
There's also a lot of information on GBAtemp such as:
http://gbatemp.net/threads/can-someone-help-me-swap-music.338615/#post-4471702 and http://gbatemp.net/threads/the-various-audio-formats-of-the-ds.305167/ |
Fiachra |
| ||
Local moderator Level: 65 Posts: 7/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
That's great, thanks for this. I'm going to try and port this into the editor in the next few days. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 8/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
Finished porting blank's new script into the editor - perfect collision!
I've quickly tested it with Skelux's Bob-Omb Islands model and it seems to be working perfectly apart from the small raised bumps around the rim of the floating fort. On top of tower to the right of the floating fort. On top of roof of floating fort. I've committed the code to the repo (http://code.google.com/p/sm64dse/source/list). Posted by Mega-Mario You need to press the 'Save' button (upper left corner) after importing a custom model. Posted by Mega-Mario I've never used Git so I don't know much about it. If you think it's better I'm happy to change. Rewriting to Java'd be good so it worked in Linux. I don't think I could help much with the NitroROM, NitroFile classes or the GLView parts but if those were done I could probably help a good bit with the rest. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 9/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
Posted by ray The executable in the repo is an old version, it doesn't be updated when new code is committed. You need to download and compile the source code to get the newest version. Posted by Mega-Mario Yeah, when you press the 'Save' button, if you've imported a custom model it goes through the level data header for each area: Posted by Skelux Unfortunately the collision types differ for every level, the only one that's the same is zero - solid and it'd be too hard to make a list as some levels have a lot of collision types, eg. Shifting Sand Land has 167 different types (but looks pretty in the KCL editor)! It should be possible to replace all the levels now, for example the main castle grounds can be replaced. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 10/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
Posted by ray Can you post a link to the model so I can look at? Did you triangulate the model? |
Fiachra |
| ||
Local moderator Level: 65 Posts: 11/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
It may be a problem with the normals facing the wrong way. After I exported it to .OBJ and removed duplicate faces and vertices it looked like this:
Some are facing inside instead of outside so the collision also has some faces on the outside and some on the inside. It seems each face is exported twice, with two sets of normals, I'm not sure why. A good tool for cleaning, fixing, simplifying triangulating etc. models is MeshLab. It's a great looking level by the way, hope you get it working. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 12/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 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: |
Fiachra |
| ||
Local moderator Level: 65 Posts: 13/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 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. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 14/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 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. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 15/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 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. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 16/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 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. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 17/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 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. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 18/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
I'll also be posting updates on the progress here as I don't a new thread'd be necessary.
That's been done deliberately - you'll to ask Mega-Mario
That turned out to be Google Sketchup not exporting them properly. Latest: Revision 31 - 24/01/2013 Rev. 31 24/01/2013 2 improvements Got model exporting working I made a mistake with working out the amount of faces in quadrilateral strips, messed up BODMAS. I had this: 4+(N-1)*2 vertices per N quads ((N/2)-4)+1 Quads. per N Vertices instead of 4+(N-1)*2 vertices per N quads ((N-4)/2) + 1 Quads. per N Vertices Some textures are upside down or repeated incorrectly but that's because the BMD format supports texture features that OBJ doesn't, that can't be helped. Also fixed the issue with exporting models that had a material without a texture that caused the textures to become swapped around. I had made improvements to the minimap editor that appeared to be working perfectly but it seems that resolution and other information about the minimaps is hardcoded into the game somewhere. Eg. just swapping playroom's minimap with Bob-Omb Battlefield's doesn't work. As Mega-Mario would say: Blarg! The changes though should allow it to be used as a general 2D graphics editor with some changes. |
Fiachra |
| ||
Local moderator Level: 65 Posts: 19/1065 EXP: 2231004 Next: 104624 Since: 12-15-12 From: Ireland Last post: 2132 days ago Last view: 81 days ago |
I just used the method LZ77_Compress found here http://nsmb-editor.googlecode.com/svn/trunk/NSMBe4/ROM.cs
It's not used by default in NitroFile.SaveChanges() yet as it's easier to test uncompressed files though it'd be very easy to add for a release. I've just tested it on importing a custom level model and it doesn't seem to make much of a difference to that. Do you want it on by default? Posted by NWPlayer123 What do you mean? Has he worked on the format? |
(post in restricted forum) |
Main - Posts by Fiachra |
Page rendered in 0.073 seconds. (2048KB of memory used) MySQL - queries: 21, rows: 141/141, time: 0.015 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |