ProwlEngine / Prowl

An Open Source C# 3D Game Engine under MIT license, inspired by Unity and featuring a complete editor
MIT License
447 stars 37 forks source link

Linux Editor seems broken #180

Closed Armynator closed 1 month ago

Armynator commented 1 month ago

Describe the bug Just tested the editor on Linux, the results are not that impressive. Not sure if this was ever tested properly before?

To Reproduce Steps to reproduce the behavior:

  1. Build & run editor on Linux
  2. Set UI scale to something other than 1.0
  3. Notice how the whole UI breaks
  4. Try to spawn a cube
  5. Notice various exceptions in the console
  6. Try to build the game after assiging a scene in the project settings
  7. Notice various exceptions in the console

Expected behavior A working editor.

Additional context Tested on Ubuntu 24.04 with Nvidia 550 drivers, X11 display server on a 27" 4k monitor and .NET 8.0.0 I haven't tested Windows so far, but I assume it's working better there?

PaperPrototype commented 1 month ago

@Armynator may I ask what branch of Prowl you are working with? The development branch is where the latest changes are at.

Armynator commented 1 month ago

Just tested the latest development branch which is even worse. Upon opening a project in the editor, tons of errors are spammed into the console. Example:

Failed to import /test/Library/AssetDatabase/8623525a-750e-406f-aa7c-eca654dfd043.serialized!
System.Exception: Failed to import /test/Library/AssetDatabase/8623525a-750e-406f-aa7c-eca654dfd043.serialized
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset(Guid assetGuid) in /Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 491
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset[T](Guid assetGuid, UInt16 fileID) in /Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 430
Error in EditorWindow: Something went wrong loading asset.
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset[T](Guid assetGuid, UInt16 fileID) in /Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 452
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset[T](FileInfo assetPath, UInt16 fileID) in /Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 413
   at Prowl.Editor.Assets.EditorAssetProvider.LoadAsset[T](String relativeAssetPath, UInt16 fileID) in /Prowl/Prowl.Editor/Assets/EditorAssetProvider.cs:line 17
   at Prowl.Runtime.RenderPipelines.DefaultRenderPipeline.ValidateDefaults() in /Prowl/Prowl.Runtime/Rendering/RenderPipeline/DefaultRenderPipeline.cs:line 38
   at Prowl.Runtime.RenderPipelines.DefaultRenderPipeline.Render(Framebuffer target, Camera camera, RenderingData& data) in /Prowl/Prowl.Runtime/Rendering/RenderPipeline/DefaultRenderPipeline.cs:line 48
   at Prowl.Editor.SceneViewWindow.Draw() in /Prowl/Prowl.Editor/Editor/SceneViewWindow.cs:line 144
   at Prowl.Editor.EditorWindow.ProcessFrame() in /Prowl/Prowl.Editor/Editor/EditorWindow.cs:line 235

For the first example error it looks like the path is wrong, shouldn't the "test" project be in a subfolder of the Prowl folder? The main branch doesn't have that problem. The project at least opens and renders there.

Also when setting the UI scale to anything else than 1.0, this happens, on development and main branch: img

PaperPrototype commented 1 month ago

EDIT: Would love to help you (lol I actually sat here and tried to figure out how I could help) but then realized I'm not actually that involved in the dev so I'm not sure why that is happening :P thats why I suggested "You might have more luck in the discord."

michaelsakharov commented 1 month ago

Hey, thanks for trying out prowl and making an issue!

UI Scaling isn't too surprising, however, it is a bug and should be working, It appears ClipRects have gotten broken at some point. Im not sure why exceptions are being thrown on the creation of a cube or exporting project... The development branch is a lot further along and has more effort in it toward Linux support due to @sinnwrig a Linux user doing a lot of work on it.

One thing is that the Development branch and Main branch projects are incompatible with each other, which explains those errors. Other than that development should work a lot better and shouldn't have exceptions on creating a cube or exporting the game (Export may not produce a viable executable though) Could you try development out again with a new project and let us know if there are any exceptions?

sinnwrig commented 1 month ago

@Armynator apologies your experience with Prowl wasn't the smoothest - it's pretty rough around the edges right now, but the issues you described should be relatively simple fixes!

If it's alright, could you please verify if the import error still occurs even when opening a newly created project with the development branch? As @michaelsakharov mentioned above, the serialization formats have changed considerably from main and I can only seem to reproduce the same exceptions when opening a project on development that was created with main.

As for UI scaling, the scissor rects are broken on all platforms, although that should be the only place the UI is broken, as disabling scissor rects seems to alleviate almost all of the issue. It should be a relatively simple fix and I'll try to patch it up ASAP on development.

sinnwrig commented 1 month ago

@Armynator UI scaling should be fixed in a806522 on development. However, I'll leave this issue open in case project importing is still broken.

Armynator commented 1 month ago

UI scaling is fixed. Opening project still doesn't work. (Well, it opens, but the editor stays blank and errors are spammed into the console)

  1. Clone repo, checkout development branch, init submodules
  2. Open or build the SLN file
  3. Start Prowl.Editor
  4. Create project
  5. Open project
  6. Notice error spam in console

Tested with .NET 8.0 and .NET 9.0 on Linux Mint 22 (based on Ubuntu 24.04)

Failed to import /ProwlProjects/Test/Library/AssetDatabase/ddc9e4fb-07a9-4b76-a65c-a2be4d059533.serialized.
System.Exception: Failed to import /ProwlProjects/Test/Library/AssetDatabase/ddc9e4fb-07a9-4b76-a65c-a2be4d059533.serialized.
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset(Guid assetGuid) in /ProwlProjects/Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 491
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset[T](Guid assetGuid, UInt16 fileID) in /ProwlProjects/Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 430
Error in EditorWindow: Something went wrong loading asset.
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset[T](Guid assetGuid, UInt16 fileID) in /ProwlProjects/Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 452
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset[T](FileInfo assetPath, UInt16 fileID) in /ProwlProjects/Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 413
   at Prowl.Editor.Assets.EditorAssetProvider.LoadAsset[T](String relativeAssetPath, UInt16 fileID) in /ProwlProjects/Prowl/Prowl.Editor/Assets/EditorAssetProvider.cs:line 17
   at Prowl.Runtime.RenderPipelines.DefaultRenderPipeline.ValidateDefaults() in /ProwlProjects/Prowl/Prowl.Runtime/Rendering/RenderPipeline/DefaultRenderPipeline.cs:line 35
   at Prowl.Runtime.RenderPipelines.DefaultRenderPipeline.Render(Framebuffer target, Camera camera, RenderingData& data) in /ProwlProjects/Prowl/Prowl.Runtime/Rendering/RenderPipeline/DefaultRenderPipeline.cs:line 45
   at Prowl.Editor.SceneViewWindow.Draw() in /ProwlProjects/Prowl/Prowl.Editor/Editor/SceneViewWindow.cs:line 144
   at Prowl.Editor.EditorWindow.ProcessFrame() in /ProwlProjects/Prowl/Prowl.Editor/Editor/EditorWindow.cs:line 235
Failed to import Defaults/SkyDome.obj
Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: 
/ProwlProjects/Prowl/Build/Editor/Debug/net9.0/runtimes/linux-x64/native/libdl.so: cannot open shared object file: No such file or directory
/home/hannes/.dotnet/shared/Microsoft.NETCore.App/9.0.0-rc.1.24431.7/libdl.so: cannot open shared object file: No such file or directory
/ProwlProjects/Prowl/Build/Editor/Debug/net9.0/libdl.so: cannot open shared object file: No such file or directory
/ProwlProjects/Prowl/Build/Editor/Debug/net9.0/runtimes/linux-x64/native/liblibdl.so: cannot open shared object file: No such file or directory
/home/hannes/.dotnet/shared/Microsoft.NETCore.App/9.0.0-rc.1.24431.7/liblibdl.so: cannot open shared object file: No such file or directory
/ProwlProjects/Prowl/Build/Editor/Debug/net9.0/liblibdl.so: cannot open shared object file: No such file or directory
/ProwlProjects/Prowl/Build/Editor/Debug/net9.0/runtimes/linux-x64/native/libdl.so.so: cannot open shared object file: No such file or directory
/home/hannes/.dotnet/shared/Microsoft.NETCore.App/9.0.0-rc.1.24431.7/libdl.so.so: cannot open shared object file: No such file or directory
/ProwlProjects/Prowl/Build/Editor/Debug/net9.0/libdl.so.so: cannot open shared object file: No such file or directory
/ProwlProjects/Prowl/Build/Editor/Debug/net9.0/runtimes/linux-x64/native/liblibdl.so.so: cannot open shared object file: No such file or directory
/home/hannes/.dotnet/shared/Microsoft.NETCore.App/9.0.0-rc.1.24431.7/liblibdl.so.so: cannot open shared object file: No such file or directory
/ProwlProjects/Prowl/Build/Editor/Debug/net9.0/liblibdl.so.so: cannot open shared object file: No such file or directory

        In UnmanagedLinuxLibraryImplementation.dlopen at :0:0
        In UnmanagedLinuxLibraryImplementation.NativeLoadLibrary at :0:0
        In UnmanagedLibrary.LoadIfNotLoaded at :0:0
        In AssimpContext.CreateConfigs at :0:0
        In AssimpContext.ImportFile at :0:0
        In ModelImporter.Import at /ProwlProjects/Prowl/Prowl.Editor/Assets/Importers/ModelImporter.cs:68:13
        In AssetDatabase.Reimport at /ProwlProjects/Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:362:13

Failed to import /ProwlProjects/Test/Library/AssetDatabase/ddc9e4fb-07a9-4b76-a65c-a2be4d059533.serialized.
System.Exception: Failed to import /ProwlProjects/Test/Library/AssetDatabase/ddc9e4fb-07a9-4b76-a65c-a2be4d059533.serialized.
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset(Guid assetGuid) in /ProwlProjects/Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 491
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset[T](Guid assetGuid, UInt16 fileID) in /ProwlProjects/Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 430
Error in EditorWindow: Something went wrong loading asset.
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset[T](Guid assetGuid, UInt16 fileID) in /ProwlProjects/Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 452
   at Prowl.Editor.Assets.AssetDatabase.LoadAsset[T](FileInfo assetPath, UInt16 fileID) in /ProwlProjects/Prowl/Prowl.Editor/Assets/AssetDatabase.Core.cs:line 413
   at Prowl.Editor.Assets.EditorAssetProvider.LoadAsset[T](String relativeAssetPath, UInt16 fileID) in /ProwlProjects/Prowl/Prowl.Editor/Assets/EditorAssetProvider.cs:line 17
   at Prowl.Runtime.RenderPipelines.DefaultRenderPipeline.ValidateDefaults() in /ProwlProjects/Prowl/Prowl.Runtime/Rendering/RenderPipeline/DefaultRenderPipeline.cs:line 35
   at Prowl.Runtime.RenderPipelines.DefaultRenderPipeline.Render(Framebuffer target, Camera camera, RenderingData& data) in /ProwlProjects/Prowl/Prowl.Runtime/Rendering/RenderPipeline/DefaultRenderPipeline.cs:line 45
   at Prowl.Editor.SceneViewWindow.Draw() in /ProwlProjects/Prowl/Prowl.Editor/Editor/SceneViewWindow.cs:line 144
   at Prowl.Editor.EditorWindow.ProcessFrame() in /ProwlProjects/Prowl/Prowl.Editor/Editor/EditorWindow.cs:line 235
sinnwrig commented 1 month ago

Interesting - it seems that the Assimp native library doesn't load correctly or can't be found. I'll investigate a bit more and try to fix the native dependencies, but this might be fixed once @michaelsakharov finishes porting Assimp to C# and removes the native dependency altogether.

sinnwrig commented 1 month ago

@Armynator I've found a related issue to yours regarding Assimp here, and they seem to have a very similar problem with libdl not being found. It appears that this line of code in the package is causing issues since it's looking directly for libdl.so (when the system might have libdl.so.2 or the like) and causes cascading exceptions for the editor when it fails to find it. If this is the case, completely fixing this issue might have to wait until the Assimp package is fixed or our C# port of it is completed. In the meantime, there's two temporary fixes that might help:

Try installing libc6-dev if it isn't present already (might add the missing shared objects, this is the cleaner approach)

sudo apt-get install libc6-dev

If that doesn't give any useful results, you could try a more hack-y fix like this one provided in the stack exchange question and create a symlink to the libdl version installed on the system:

$ whereis libdl.so.2
libdl.so.2: /usr/lib/libdl.so.2 /usr/lib32/libdl.so.2 (or similar paths)
$ sudo ln -s /usr/lib/libdl.so.2 /usr/lib/libdl.so (make symlink to 64-bit libdl)
$ sudo ln -s /usr/lib32/libdl.so.2 /usr/lib32/libdl.so (make symlink to 32-bit libdl)
Armynator commented 1 month ago

Yup that worked.