ds-pokemon-hacking / CTRMapV

CTRMap Gen V level editor plug-in.
7 stars 3 forks source link

NSBMD files converted into DAE can't be displayed properly #1

Closed SpagoAsparago closed 1 year ago

SpagoAsparago commented 1 year ago

The converted NSBMD trough creative studio when added in the game from the building editor is initially displayed correctly in CTRMap, but in game this happens: https://user-images.githubusercontent.com/57636185/233854079-3263ccce-4b9c-4751-8cb5-550f50157aa2.mp4

This is the converted DAE I used fs.zip

HelloOO7 commented 1 year ago

Apart from some broken vertices present in the DAE already, I can get the model to work on the title screen with some code changes: obrazek

Can you check if your issue persists if you use the builds from here?

Edit: To clarify - you may need to reconstruct everything that uses the previously broken models with the new builds, loading the old ones and re-saving probably won't work as it is. Importing the static prop textures (a/1/7/4) and archive (a/2/2/5) from a clean ROM and then importing onto them should be enough.

SpagoAsparago commented 1 year ago

Thanks for the response, I made a new project from a clean extracted folder and converted the nsbmd again with CS; now it seems the building gets displayed correctly but with the wrong scale: Cattura But there is still the issue that other buildings get their textures changed and their Y coordinate shifted up by 16 units. However I also made a simple cube with a NNS material in Blender 2.83 and tried to import it, buth both the DAE converted with CS and the DAE exported directly from Blender won't have their textures displayed, despite the nsbmd showing up correctly in CS and the latter showing up correctly when imported in Blender. I attached them: testcube.zip

HelloOO7 commented 1 year ago

a) The test cube texture not being imported seems to be a non-issue. The DAE links to a file in the Targa format, which CreativeStudio does not support (the list of available format support can be viewed at any time from a CS instance by clicking Import > Generic and checking the file filters). Once converted to PNG, it imports correctly. b) As for scaling issues, can you retry with the updated builds (in the same folder)? c) As for malformed Y translations, could you illustrate that further?

SpagoAsparago commented 1 year ago

Now the files are displayed correctly and can confirm texture animations work as well, thanks again. The Y transform error was my mistake, sorry, I assumed the default for ground level buildings was 0 instead of 16 on the map I was editing.

However the issue with the other building textures still persists for some reason: White2Test__10541 I created a new project from a clean rom and only after adding my building the already existing building textures get corrupted in game, even if it's not displayed in the editor. I tested on route 19 and Aspertia City, it happened on both maps.

Also unrelated to this issue but I would like to point out that when adding building animations nsbta files are not shown as part of the supported files.

HelloOO7 commented 1 year ago

I think the texture might be a regression, as I recall having had a similar issue quite a long time ago with similar symptoms.

Do you have an environment on which you could provide the NSBTX files before/after corruption? That is, copyright-free. If not, no worries, I can create it myself, it'll just take time.

Ad animation formats: The only supported input format for material animations are IFMA files, as there is next to no open format that supports UV transforms apart from COLLADA 1.5 which has virtually no adoption. If you need a workaround, CreativeStudio can be used to partially convert NSBTAs into IFMAs (I never tested this to a failproof degree though). However, this is far from being an actual solution, so if someone was to create a simple format for transferring UV animations between DCC tools, I'll be glad to add support for it (as long as it's semi-decently designed).

SpagoAsparago commented 1 year ago

By NSBTX copyright-free files you mean the area data used by the map extracted with Tinke from a/0/1/4?

HelloOO7 commented 1 year ago

Yeah that's not exactly copyright-free, is it? I can dump that part myself, so that part isn't the problem, but the "corrupted" NSBTX would be as it still contains the original textures, but it's not exactly okay to host here. I'll try to reproduce the issue and see if I can get similar corruptions to appear.

HelloOO7 commented 1 year ago

Could you retry with the latest build (on Google Drive)?

SpagoAsparago commented 1 year ago

Can confirm the issue is fixed (at least in the map I tested), thanks for your work. Only issue I noticed is that the cube I added would sometimes become darker while walking around, but that's probably due to a setting in my material.

HelloOO7 commented 1 year ago

Can you confirm whether that is an issue with CS or not?

SpagoAsparago commented 1 year ago

It's not, I made a simple cube without a NNS material and imported the OBJ, it still gets the weird light shift when walking around so I assume the issue is on my end?

https://user-images.githubusercontent.com/57636185/234388774-f2bf7dea-33e5-4519-8218-203aa1087e24.mp4

This is the model: cube.zip

HelloOO7 commented 1 year ago

Can't really say for sure. You might want to try debugging this with No$GBA's video utility as it has excellent tools for viewing exactly what affect every single pixel of each frame. That could bring you closer to tracing the source of the lighting changes. But apart from that I'm as clueless as you are.

SpagoAsparago commented 1 year ago

I see, I'll mess around with material settings and then try that if the issue is still present. You can close this issue if you want.

HelloOO7 commented 1 year ago

Sure. If you do find the lighting to be a CS issue, feel free to open another one.