bruvzg / gdsdecomp

Godot reverse engineering tools
MIT License
1.42k stars 138 forks source link

Error importing StreamTextures2D #37

Closed sairam4123 closed 2 years ago

sairam4123 commented 2 years ago

While decompiling my friend's game (for fun), I found that there're some export errors with StreamTexture2D. Here's what I have found.

ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)

Hopefully it should help.

sairam4123 commented 2 years ago

I also found that this syntax isn't supported properly.

class Name extends Base: # It is being exported as class Nameextends Base:
nikitalita commented 2 years ago

Can you post the game that you're trying to decompile? This doesn't tell us much. Also, is this a Godot 2.x game or 3.x?

sairam4123 commented 2 years ago

3.x Game. Godot 3.4.0 to be accurate.

nikitalita commented 2 years ago

unfortunately, I'm not going to be able to do much until I have the game, as I've tested texture export on 3.4 and it works fine.

nikitalita commented 2 years ago

I also found that this syntax isn't supported properly.

class Name extends Base: # It is being exported as class Nameextends Base:

this was fixed in #40

sairam4123 commented 2 years ago

I tried on this game and I was able to reproduce this issue. https://store.steampowered.com/app/1419150/Woodland_Empire/ I'll try again today.

sairam4123 commented 2 years ago

I'm able to reproduce this issue, but unable to share the logs as text. I have uploaded it as a file. output.txt

Somethings which might or might not be related to the issue:

WARNING: Converting lossy imports, you may lose fidelity for indicated assets when re-importing upon loading the project
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:306)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
Converted res://.import/GodRays.svg-0e880633ec1b3300b7885fc8b84904ed.stex to res://.assets/addons/SIsilicon.vfx.godrays/GodRays.png
WARNING: Godot 3.x/4.x import data rewrite not yet implemented
     at: ImportExporter::export_texture (modules\gdsdecomp\utility\import_exporter.cpp:440)
WARNING: These assets will not be re-imported when loading the project
     at: ImportExporter::export_texture (modules\gdsdecomp\utility\import_exporter.cpp:441)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
Converted res://.import/muzzle_02.png-73907a9fd22662bc7d090524d607da4c.stex to res://particles/kenny/muzzle_02.png
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
Converted res://.import/star_01.png-082b9253d599c8efaa4c7c6fcb42f161.stex to res://particles/kenny/star_01.png
Converted res://.import/star_02.png-1d09d8be2728c0806dacae2291962e3d.stex to res://particles/kenny/star_02.png
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
Converted res://.import/star_04.png-01a58584dcaa137a09dc37994a074992.stex to res://particles/kenny/star_04.png
Converted res://.import/star_05.png-04696b30a26a481a02a7f0444257ce01.stex to res://particles/kenny/star_05.png
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
Converted res://.import/star_07.png-c376252c3f3f4549470d63a7d959b44e.stex to res://particles/kenny/star_07.png
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
Converted res://.import/particle_square.png-5ab53758826d473b71bac2061a95fc02.stex to res://particles/particle_square.png
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
     at: ImportExporter::export_imports (modules\gdsdecomp\utility\import_exporter.cpp:337)
Did not convert PackedScene resource res://.import/cloud_animated2.glb-7fff3a258c0059e498f20ec26d23ad86.scn
Did not convert PackedScene resource res://.import/cloud_animated3.glb-9e8b4f7bdfe91977c6b2336b3e56a3b6.scn
Did not convert PackedScene resource res://.import/cloud4.glb-dfb231c8aba172615fc59560d5e3abb5.scn
ERROR: Resource F:/Downloads/GDRE_tools-standalone-windows/Test-Woodland-New/ does not exist
   at: (modules\gdsdecomp\utility\gdre_settings.cpp:369)
ERROR: Can't open texture file
   at: (modules\gdsdecomp\utility\texture_loader_compat.cpp:29)
WARNING: Failed to load texture StreamTexture2D
nikitalita commented 2 years ago

d'oh, this was a bug I had fixed on another branch but hadn't PRed yet, I'll do that now.

sairam4123 commented 2 years ago

StreamTexture2D still isn't being exported..

Did not convert StreamTexture2D resource res://.import/slot0_normal_roughness.packed_tex-74d105433912d55960197f1e81f5c031.s3tc.stex
Did not convert StreamTexture2D resource res://.import/slot1_albedo_bump.packed_tex-c50964103f6881a306e97da81b332dcd.s3tc.stex
Did not convert StreamTexture2D resource res://.import/slot1_normal_roughness.packed_tex-631aea85a8c6aa800fb0f7ed84b54efb.s3tc.stex

Tried it on my own game.

Totals:
Imports for export session:     93
Successfully converted:                 72
Lossy:          0
Rewrote metadata: 0
Require rewritten metadata but weren't: 49
Not converted: 15
Failed conversions: 6

Tried again on my another game:

*********EXPORT REPORT***********
Totals:
Imports for export session:     26
Successfully converted:                 24
Lossy:          0
Rewrote metadata: 0
Require rewritten metadata but weren't: 6
Not converted: 1
Failed conversions: 1
-------------

The following files were converted and saved to a non-original path, but did not have their import data rewritten.
These files will not be re-imported when loading the project.
res://.import/add-white-18dp.svg-06b50d941748dbfd6e0203dec68494ea.stex to res://.assets/addons/imjp94.yafsm/assets/icons/add-white-18dp.png
res://.import/arrow_right-white-18dp.svg-10d349447e9bd513637eade1f10225f0.stex to res://.assets/addons/imjp94.yafsm/assets/icons/arrow_right-white-18dp.png
res://.import/close-white-18dp.svg-3d0e2341eb99a6dc45a6aecef969301b.stex to res://.assets/addons/imjp94.yafsm/assets/icons/close-white-18dp.png
res://.import/compare_arrows-white-18dp.svg-7313ec3b54f05c948521b16e0efaaeed.stex to res://.assets/addons/imjp94.yafsm/assets/icons/compare_arrows-white-18dp.png
res://.import/remove-white-18dp.svg-984af3406d3d64ea0f778da7f0f5a4c3.stex to res://.assets/addons/imjp94.yafsm/assets/icons/remove-white-18dp.png
res://.import/subdirectory_arrow_right-white-18dp.svg-09b2961410e6b2c0e48e0cf1138c3548.stex to res://.assets/addons/imjp94.yafsm/assets/icons/subdirectory_arrow_right-white-18dp.png

The following files were not converted because support has not been implemented yet:
res://.import/Sleeper_Coach.glb-fa6495d1fc0f39b483956912df51ce7d.scn

Failed conversions:
res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.s3tc.stex
*********************************

it still has issues.. gdre_export.log

nikitalita commented 2 years ago

We don't support packed_tex textures. As for the others, I'm gonna need to see the full gdre_export.log, which is located in the directory where you dumped the game. Just attach them to the issue.

sairam4123 commented 2 years ago

Added the log, could you give it a check?

nikitalita commented 2 years ago

This looks like a bug on Godot's part. Apparently the icon was imported in a very strange way; if it's imported and stored as a compressed format, it's supposed to be able to uncompress it, but it can't here. Can you post the game somewhere so I can take a look?

sairam4123 commented 2 years ago

Sure, you can download it from here.