New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating "mini" picture #468

Closed
Bob-Z opened this Issue Dec 6, 2015 · 7 comments

Comments

Projects
None yet
4 participants
@Bob-Z
Contributor

Bob-Z commented Dec 6, 2015

After clearing cache, I launch RoR and I see the following traces

Adding archive /home/bobz/.rigsofrods/packs/Boats/HouseBoat.zip (hash: B6C5B59014316784A3D16F59E62433E864A5E87B) (No Compression)
Loading /home/bobz/.rigsofrods/packs/Boats/HouseBoat.zip
Creating resource group General-21
Added resource location '/home/bobz/.rigsofrods/packs/Boats/HouseBoat.zip' of type 'Zip' to resource group 'General-21'
Initialising resource group General-21
Parsing scripts for resource group General-21
Parsing script 4161UID-houseboat.material
Finished parsing scripts for resource group General-21
Creating resources for group General-21
All done
Preparing to add 4161UID-houseboat.boat
 -4161UID-houseboat.boat ...
error deleting file '4161UID-houseboat-mini.dds'
Unloading /home/bobz/.rigsofrods/packs/Boats/HouseBoat.zip
Removed resource location /home/bobz/.rigsofrods/packs/Boats/HouseBoat.zip
Clearing resource group General-21
Finished clearing resource group General-21
Unloading resource group General-21
Finished unloading resource group General-21
Destroying resource group General-21
Unloading resource group General-21
Finished unloading resource group General-21

Note the "error deleting file '4161UID-houseboat-mini.dds' " log.
When RoR has finished loading, I can't see any mini pics (either for maps or vehicule). And, indeed, the "cache" directory only contains "mods.cache" file.

After a bit of investigation I found that the following code cause this issue:

file: main/resources/CacheSystem.cpp
method: void CacheSystem::generateFileCache(CacheEntry &entry, Ogre::String directory)

                 FileInfoListPtr files = ResourceGroupManager::getSingleton().findResourceFileInfo(group, minifn);
                 if (files->empty())
                 {
                         deleteFileCache(const_cast<char*>(dst.c_str()));
                         return;
                 }

"files->empty" seems to be always true so the function returns before creating the mini.
Commenting out these lines fixes the issue.

I didn't make a pull request on this because I don't understand why "files->empty" is always true.

Some more info:
Built with Hiradur's latest scripts.
64 bits system

@Hiradur Hiradur added the bug label Dec 9, 2015

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Dec 9, 2015

Contributor

@only-a-ptr The lovely Ogre resource management system is the problem here, can you comment on this?

The code in question is located here: https://github.com/RigsOfRods/rigs-of-rods/blob/master/source/main/resources/CacheSystem.cpp#L1572

Contributor

Hiradur commented Dec 9, 2015

@only-a-ptr The lovely Ogre resource management system is the problem here, can you comment on this?

The code in question is located here: https://github.com/RigsOfRods/rigs-of-rods/blob/master/source/main/resources/CacheSystem.cpp#L1572

@Bob-Z

This comment has been minimized.

Show comment
Hide comment
@Bob-Z

Bob-Z Dec 11, 2015

Contributor

Maybe related, maybe not:

I have a great number of vehicules with texture issues.
For instance this mod from http://www.rigsofrods.com/threads/120737-All-my-unreleased-unfinished-mods

screenshot_35

Logs:

...
WARNING: impreza_97_body_22b.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Error loading texture impreza_body_blue.psd. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource impreza_body_blue.psd in resource group ManagedMats or any other group. in ResourceGroupManager::openResource at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreResourceGroupManager.cpp (line 756)
Texture: impreza_glass.png: Loading 1 faces(PF_A8R8G8B8,185x185x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,185x185x1.
FLEXBODY Vertices in mesh impreza_97_body_22b.mesh: 20650
FLEXBODY show mesh
FLEXBODY ready
...

Or this one from the same source:

screenshot_38

Logs:

...
WARNING: lancaster_wheel_tail.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Error loading texture camo-spec.jpg. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource camo-spec.jpg in resource group ManagedMats or any other group. in ResourceGroupManager::openResource at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreResourceGroupManager.cpp (line 756)
Texture: lanc_belly.png: Loading 1 faces(PF_A8R8G8B8,30x28x1) with 4 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,30x28x1.
Texture: lanc_wheel.jpg: Loading 1 faces(PF_R8G8B8,14x16x1) with 4 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,14x16x1.
Texture: lanc_gen-spec.jpg: Loading 1 faces(PF_R8G8B8,14x16x1) with 4 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,14x16x1.
Mesh: Loading lancaster_wheel_main.mesh.
WARNING: lancaster_wheel_main.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
...

Finally, on some mods I have this type of errors:

screenshot_39

...
Mesh: Loading beam.mesh.
Texture: RustySteel.dds: Loading 1 faces(PF_DXT1,256x256x1) with 8 custom mipmaps from Image. Internal format is PF_DXT1,256x256x1.
Texture: invis.dds: Loading 1 faces(PF_A8R8G8B8,8x8x1) with 3 custom mipmaps from Image. Internal format is PF_A8R8G8B8,8x8x1.
Mesh: Loading wheelF.mesh.
WARNING: wheelF.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Texture: nodamage2.png: Loading 1 faces(PF_A8R8G8B8,2048x2048x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,2048x2048x1.
Error loading texture wheel.dds. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch! in DDSCodec::decode at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreDDSCodec.cpp (line 651)
Texture: wheel_s.dds: Loading 1 faces(PF_A8R8G8B8,512x512x1) with 9 custom mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
Mesh: Loading wheelR.mesh.
WARNING: wheelR.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Mesh: Loading hub.mesh.
WARNING: hub.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Mesh: Loading body.mesh.
WARNING: body.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Texture: nodamage.png: Loading 1 faces(PF_A8R8G8B8,1024x1024x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,1024x1024x1.
Texture: s2.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
Error loading texture color_s.dds. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch! in DDSCodec::decode at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreDDSCodec.cpp (line 651)
Texture: color.png: Loading 1 faces(PF_A8R8G8B8,1024x1024x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,1024x1024x1.
Texture: damage2.png: Loading 1 faces(PF_A8R8G8B8,1024x1024x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,1024x1024x1.
Texture: s.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
Texture: grille1.png: Loading 1 faces(PF_A8R8G8B8,64x64x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x64x1.
Error loading texture under.dds. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch! in DDSCodec::decode at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreDDSCodec.cpp (line 651)
FLEXBODY Vertices in mesh body.mesh: 21948
FLEXBODY show mesh
FLEXBODY ready
Mesh: Loading windows.mesh.
WARNING: windows.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Error loading texture color_s.dds. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch! in DDSCodec::decode at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreDDSCodec.cpp (line 651)
Texture: glass2.png: Loading 1 faces(PF_A8R8G8B8,16x16x1) with 4 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,16x16x1.
Texture: glass_d.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
Texture: glass.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
FLEXBODY Vertices in mesh windows.mesh: 972
FLEXBODY show mesh
FLEXBODY ready
Mesh: Loading trunk.mesh.
WARNING: trunk.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Texture: lights.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
Texture: damagelights.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
Error loading texture color_s.dds. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch! in DDSCodec::decode at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreDDSCodec.cpp (line 651)
...

I forgot to say that I am using Ubuntu 15.10.

Contributor

Bob-Z commented Dec 11, 2015

Maybe related, maybe not:

I have a great number of vehicules with texture issues.
For instance this mod from http://www.rigsofrods.com/threads/120737-All-my-unreleased-unfinished-mods

screenshot_35

Logs:

...
WARNING: impreza_97_body_22b.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Error loading texture impreza_body_blue.psd. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource impreza_body_blue.psd in resource group ManagedMats or any other group. in ResourceGroupManager::openResource at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreResourceGroupManager.cpp (line 756)
Texture: impreza_glass.png: Loading 1 faces(PF_A8R8G8B8,185x185x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,185x185x1.
FLEXBODY Vertices in mesh impreza_97_body_22b.mesh: 20650
FLEXBODY show mesh
FLEXBODY ready
...

Or this one from the same source:

screenshot_38

Logs:

...
WARNING: lancaster_wheel_tail.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Error loading texture camo-spec.jpg. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource camo-spec.jpg in resource group ManagedMats or any other group. in ResourceGroupManager::openResource at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreResourceGroupManager.cpp (line 756)
Texture: lanc_belly.png: Loading 1 faces(PF_A8R8G8B8,30x28x1) with 4 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,30x28x1.
Texture: lanc_wheel.jpg: Loading 1 faces(PF_R8G8B8,14x16x1) with 4 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,14x16x1.
Texture: lanc_gen-spec.jpg: Loading 1 faces(PF_R8G8B8,14x16x1) with 4 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,14x16x1.
Mesh: Loading lancaster_wheel_main.mesh.
WARNING: lancaster_wheel_main.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
...

Finally, on some mods I have this type of errors:

screenshot_39

...
Mesh: Loading beam.mesh.
Texture: RustySteel.dds: Loading 1 faces(PF_DXT1,256x256x1) with 8 custom mipmaps from Image. Internal format is PF_DXT1,256x256x1.
Texture: invis.dds: Loading 1 faces(PF_A8R8G8B8,8x8x1) with 3 custom mipmaps from Image. Internal format is PF_A8R8G8B8,8x8x1.
Mesh: Loading wheelF.mesh.
WARNING: wheelF.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Texture: nodamage2.png: Loading 1 faces(PF_A8R8G8B8,2048x2048x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,2048x2048x1.
Error loading texture wheel.dds. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch! in DDSCodec::decode at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreDDSCodec.cpp (line 651)
Texture: wheel_s.dds: Loading 1 faces(PF_A8R8G8B8,512x512x1) with 9 custom mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
Mesh: Loading wheelR.mesh.
WARNING: wheelR.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Mesh: Loading hub.mesh.
WARNING: hub.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Mesh: Loading body.mesh.
WARNING: body.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Texture: nodamage.png: Loading 1 faces(PF_A8R8G8B8,1024x1024x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,1024x1024x1.
Texture: s2.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
Error loading texture color_s.dds. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch! in DDSCodec::decode at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreDDSCodec.cpp (line 651)
Texture: color.png: Loading 1 faces(PF_A8R8G8B8,1024x1024x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,1024x1024x1.
Texture: damage2.png: Loading 1 faces(PF_A8R8G8B8,1024x1024x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,1024x1024x1.
Texture: s.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
Texture: grille1.png: Loading 1 faces(PF_A8R8G8B8,64x64x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x64x1.
Error loading texture under.dds. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch! in DDSCodec::decode at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreDDSCodec.cpp (line 651)
FLEXBODY Vertices in mesh body.mesh: 21948
FLEXBODY show mesh
FLEXBODY ready
Mesh: Loading windows.mesh.
WARNING: windows.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Error loading texture color_s.dds. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch! in DDSCodec::decode at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreDDSCodec.cpp (line 651)
Texture: glass2.png: Loading 1 faces(PF_A8R8G8B8,16x16x1) with 4 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,16x16x1.
Texture: glass_d.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
Texture: glass.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
FLEXBODY Vertices in mesh windows.mesh: 972
FLEXBODY show mesh
FLEXBODY ready
Mesh: Loading trunk.mesh.
WARNING: trunk.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Texture: lights.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
Texture: damagelights.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
Error loading texture color_s.dds. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch! in DDSCodec::decode at /home/bobz/rigs-of-rods/source/ogre/OgreMain/src/OgreDDSCodec.cpp (line 651)
...

I forgot to say that I am using Ubuntu 15.10.

@Bob-Z Bob-Z closed this Dec 11, 2015

@Bob-Z Bob-Z reopened this Dec 11, 2015

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Dec 12, 2015

Contributor

I don't think it's related. Without verifying it I guess the FileNotFound error is due to letter case issues (Windows is letter case insensitive while Linux isn't).

OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch!

dds is a container format and unfortunately not all DXT codecs are supported on Linux. The author may have used a codec which isn't supported on Linux.

EDIT: I'm not an expert when it comes to textures so above information may be wrong (I couldn't find any definite answer from a quick search). However, according to this post some formats are incompatible with OGRE: http://www.rigsofrods.com/threads/114853-Install-scripts-for-latest-snapshot-for-Debian-Ubuntu-Mint?p=1359588&viewfull=1#post1359588
though this doesn't explain why it's not a problem on Windows...

any research in this regard would be greatly appreciated.

Contributor

Hiradur commented Dec 12, 2015

I don't think it's related. Without verifying it I guess the FileNotFound error is due to letter case issues (Windows is letter case insensitive while Linux isn't).

OGRE EXCEPTION(2:InvalidParametersException): DDS header size mismatch!

dds is a container format and unfortunately not all DXT codecs are supported on Linux. The author may have used a codec which isn't supported on Linux.

EDIT: I'm not an expert when it comes to textures so above information may be wrong (I couldn't find any definite answer from a quick search). However, according to this post some formats are incompatible with OGRE: http://www.rigsofrods.com/threads/114853-Install-scripts-for-latest-snapshot-for-Debian-Ubuntu-Mint?p=1359588&viewfull=1#post1359588
though this doesn't explain why it's not a problem on Windows...

any research in this regard would be greatly appreciated.

@Bob-Z

This comment has been minimized.

Show comment
Hide comment
@Bob-Z

Bob-Z Dec 12, 2015

Contributor

Thank you Hiradur.

Indeed it seems unrelated with first issue reported:

  • PNG and PSD files were misspelled in truck file
  • DDS files issue is solved by converting them to no-compression DDS (with GIMP using gimp-dds package). I don't know which DXT codec is used for original files.
Contributor

Bob-Z commented Dec 12, 2015

Thank you Hiradur.

Indeed it seems unrelated with first issue reported:

  • PNG and PSD files were misspelled in truck file
  • DDS files issue is solved by converting them to no-compression DDS (with GIMP using gimp-dds package). I don't know which DXT codec is used for original files.
@Speciesx

This comment has been minimized.

Show comment
Hide comment
@Speciesx

Speciesx Jan 4, 2016

Contributor

@Hiradur
With Ogre 1.9 i experience the same issues now on Windows. #521

Contributor

Speciesx commented Jan 4, 2016

@Hiradur
With Ogre 1.9 i experience the same issues now on Windows. #521

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Jan 4, 2016

Contributor

Thanks, perhaps the resource system of Ogre works a bit differently now. Since @tritonas00 built with Ogre 1.8 on Linux can he confirm that it works with Ogre 1.8?

Contributor

Hiradur commented Jan 4, 2016

Thanks, perhaps the resource system of Ogre works a bit differently now. Since @tritonas00 built with Ogre 1.8 on Linux can he confirm that it works with Ogre 1.8?

@tritonas00

This comment has been minimized.

Show comment
Hide comment
@tritonas00

tritonas00 Jan 4, 2016

Collaborator

yes, previews work in 1.8

http://postimg.org/image/aqgsjh9vf/

they didn't show up in 1.9

Collaborator

tritonas00 commented Jan 4, 2016

yes, previews work in 1.8

http://postimg.org/image/aqgsjh9vf/

they didn't show up in 1.9

ulteq added a commit to ulteq/rigs-of-rods that referenced this issue Jan 17, 2016

[Bugfix] 'Fixes' the mini picture generation on Ogre 1.9
Fixes: RigsOfRods#468

Is there any reason not to fix it like that?

@ulteq ulteq closed this in #606 Jan 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment