Uriopass / Egregoria

3D City Builder without a grid
http://douady.paris/blog/
GNU General Public License v3.0
1.48k stars 50 forks source link

Launching and crashing soon after #109

Open Arbee4ever opened 6 months ago

Arbee4ever commented 6 months ago

When I try to run the newest release on Fedora 39, it crashes after starting. When I run it using ./native_app in the Terminal I get the error Error trying to flush the wayland display: Broken pipe (os error 32) once it crashes. The Client opens, but I can't interact with it, click anything in the game or move the Camera.

Uriopass commented 6 months ago

Wayland support is probably not great as I don't really tro to support it.
Last time I tried using wayland every other program was broken too so I thought I'd wait until it matured a bit.

Uriopass commented 6 months ago

Can you try running master instead? I upgraded to winit 0.29 recently which could help.

Arbee4ever commented 6 months ago

Tried that, and it didn't even launch and threw the error

thread 'main' panicked at 'texture not found at path: assets/sprites/blue_noise_512.png (in dir: Ok("/home/arbee/Documents/Egregoria")): The image format could not be determined': /home/arbee/Documents/Egregoria/engine/src/texture.rs:353
   0: <backtrace::capture::Backtrace as core::default::Default>::default
   1: log_panics::Config::install_panic_hook::{{closure}}
   2: std::panicking::rust_panic_with_hook
   3: std::panicking::begin_panic_handler::{{closure}}
   4: std::sys_common::backtrace::__rust_end_short_backtrace
   5: rust_begin_unwind
   6: core::panicking::panic_fmt
   7: engine::texture::TextureBuilder::from_path
   8: engine::framework::run::{{closure}}
   9: native_app::main
  10: std::sys_common::backtrace::__rust_begin_short_backtrace
  11: std::rt::lang_start::{{closure}}
  12: std::rt::lang_start_internal
  13: main
  14: __libc_start_call_main
  15: __libc_start_main_impl
  16: _start

even thought the texture at "assets/sprites/blue_noise_512.png" exists.

Uriopass commented 6 months ago

You probably didn't pull the LFS files, check the readme

Arbee4ever commented 6 months ago

I did run git lfs pull

Uriopass commented 6 months ago

What does file assets/sprites/blue_noise_512.png Show ?

Arbee4ever commented 6 months ago

blue_noise_512 This

Uriopass commented 6 months ago

Hmmmm, can you run again ? I don't see why the image format would not be recognized

Arbee4ever commented 6 months ago

Oh.. Is that a Terminal Command? assets/sprites/blue_noise_512.png: PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced Didn't know that command existed

Uriopass commented 6 months ago

It is :) very useful

Arbee4ever commented 6 months ago

I deleted the file and reran git lfs pull, and it ran, but I couldn't interact with it again until it crashed with

Io error: Broken pipe (os error 32)
thread 'main' panicked at 'Failed to run event loop: ExitFailure(1)': /home/arbee/Documents/Egregoria/engine/src/framework.rs:160
   0: <backtrace::capture::Backtrace as core::default::Default>::default
   1: log_panics::Config::install_panic_hook::{{closure}}
   2: std::panicking::rust_panic_with_hook
   3: std::panicking::begin_panic_handler::{{closure}}
   4: std::sys_common::backtrace::__rust_end_short_backtrace
   5: rust_begin_unwind
   6: core::panicking::panic_fmt
   7: core::result::unwrap_failed
   8: engine::framework::run::{{closure}}
   9: native_app::main
  10: std::sys_common::backtrace::__rust_begin_short_backtrace
  11: std::rt::lang_start::{{closure}}
  12: std::rt::lang_start_internal
  13: main
  14: __libc_start_call_main
  15: __libc_start_main_impl
  16: _start

I'm guessing that is the same error as before?

Uriopass commented 6 months ago

I have never seen this error before. Are you running any "surprising" setup? Maybe an old computer, a networked disk, maybe you don't have a gpu?...

Arbee4ever commented 6 months ago

Nope... I don't think so...

Arbee4ever commented 6 months ago

Maybe it's the nvidia gpu messing stuff up... wouldn't be the first time

Uriopass commented 6 months ago

I'm just wondering what pipe could be broken. Super weird.

Arbee4ever commented 6 months ago

I reran it yet again and got the error:


Io error: Connection reset by peer (os error 104)
Io error: Connection reset by peer (os error 104)
thread 'main' panicked at 'Failed to run event loop: ExitFailure(1)': /home/arbee/Documents/Egregoria/engine/src/framework.rs:160
   0: <backtrace::capture::Backtrace as core::default::Default>::default
   1: log_panics::Config::install_panic_hook::{{closure}}
   2: std::panicking::rust_panic_with_hook
   3: std::panicking::begin_panic_handler::{{closure}}
   4: std::sys_common::backtrace::__rust_end_short_backtrace
   5: rust_begin_unwind
   6: core::panicking::panic_fmt
   7: core::result::unwrap_failed
   8: engine::framework::run::{{closure}}
   9: native_app::main
  10: std::sys_common::backtrace::__rust_begin_short_backtrace
  11: std::rt::lang_start::{{closure}}
  12: std::rt::lang_start_internal
  13: main
  14: __libc_start_call_main
  15: __libc_start_main_impl
  16: _start
Uriopass commented 6 months ago

I'm thinking it might be related to the logging. Can you run

sed -i 's/release_max_level_info/release_max_level_off/g' native_app/Cargo.toml

then cargo run --release again?

Uriopass commented 6 months ago

But I'm mostly thinking it's wayland (which is networked) that's broken. In which case I can't investigate right now since I'd need to setup a wayland desktop.

Arbee4ever commented 6 months ago

I'm thinking it might be related to the logging. Can you run

sed -i 's/release_max_level_info/release_max_level_off/g' native_app/Cargo.toml

then cargo run --release again?

That crashed with Io error: Broken pipe (os error 32) I might be able to try it on Windows sometime :D

Uriopass commented 6 months ago

Windows should definitely work. I run Ubuntu on X11 most days but I have a windows gaming pc where I try it occasionally and I haven't had any issues.

Arbee4ever commented 6 months ago

Yeah Windows can be more easily developed for because there isn't multiple display servers or something messing it up all the time

Arbee4ever commented 6 months ago

I just remembered I can just switch to xorg by just logging out setting it to xorg and logging back in... Now it works fine :D

Uriopass commented 6 months ago

Nice! So it was a Wayland issue. I'll try to reproduce it as it's slowly becoming the default.

Uriopass commented 6 months ago

As last time... Wayland+vulkan is buggy as hell with NVIDIA drivers. (Egregoria only supports vulkan on Linux as a graphics backend, I don't have time to make wgpu's opengl backend work)

When using the latest drivers I hit: https://github.com/gfx-rs/wgpu/issues/4775 And when using the stable drivers I hit https://github.com/NVIDIA/egl-wayland/issues/83#issuecomment-1773969793

:upside_down_face:

Let's hope it gets better when the game is ready to be released! In the meantime, I can't test much.

Uriopass commented 5 months ago

Goods news. I'm pretty sure this is fixed by https://github.com/gfx-rs/wgpu/commit/e5c62fb5bd29c5bd99f2445e3b089689c0e145e2 which should come in the next wgpu release :)

Uriopass commented 5 months ago

Didn't made it in time for wgpu 0.19. It should be there in wgpu 0.20 though! (in a few months).

Uriopass commented 4 days ago

I think it's finally good! Can you try again?

Arbee4ever commented 16 hours ago

Now I dont get a window at all and the logs don't tell me there's an issue, but when I run it from the terminal, I get interface 'wl_surface' has no event 2 before any log output log_1720375223294615.log image