-
Notifications
You must be signed in to change notification settings - Fork 60
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
Client crashes when unfocused #581
Comments
Was going to say this sounds vaguely familiar, there are/were platform-specific conditions where window events are not delivered, at least: rust-windowing/winit#219 - but if you've solved it... handling packets on a separate thread I agree does seem like a good solution to me (maybe all/most packets?).
In this fork? https://github.com/terrarier2111/stevenarella Web support (#446 🕸️) is very incomplete, wouldn't be too much of a loss to break or disable it, may be worth the rendering backend upgrade. Looked into alternatives in #34 Investigate rendering backends, and I switched from a custom OpenGL wrapper from Steven, to glow in #262 - abstracting OpenGL/ES and WebGL. But now, there's newer tech like WebGPU on the horizon, which more closely resembles vulkan, and vulkano does look to be a very nice library (safe Rust wrapper around Vulkan API). And the industry appears to be moving away from OpenGL to newer graphics APIs, so I wouldn't mind moving this project, either. Just saw this recent gfx-rs update: https://gfx-rs.github.io/2021/07/16/release-0.9-future.html "a single Vulkan-like Rust API with multiple backends that implement it: Direct3D 12/11, Metal, Vulkan, and even OpenGL ES". And then there are implementations of Vulkan which bridge to other platform APIs. It is all quite confusing, many options, no clear best winner... I suppose what I'm saying is, I'm all for your porting to use the vulkano graphics backend (if not necessarily to merge into this repo - at least it will be a worthwhile alternative for some usages - a step forward beyond the OpenGL/WebGL hegemony). The ideal scenario I see is full support for all native modern rendering backends for each platform (Vulkano? Metal? Direct3D? WebGPU?), ideally abstracted away, but, that's a long way off (if ever), not easy... |
No its not a fork in the traditional sense, I just uploaded the modified files to a private repo on github, as i don't think anyone except me would work on this project, if published, so I decided, I'd loose nothing when making it private (and probably open sourcing it later on down the line). |
I handle all packets on a seperate thread which also boosts perf dramatically. (for this i had to restructure many parts of this project to use Arc/Arc->RwLock ie. the Server has no mutable stuff in it anymore (the same is true for the World) as they are both only passed in Arcs which allows me to use way more multithreading in order to improve the performance. (i think i was able to improve the perf by at least 3 to 4 times the original perf, thus I get an average of 100 frames, when standing still and 20-40 fps when moving and loading the world initially, and all of this in an unoptimized build) |
When the client is unfocused (by making it non fullscreen and then clicking on some other application on the same monitor)
the client sends no keep alive packets more (it seems like it freezes somehow, which is good in theory but in practice it doesn't respond to any packets sent to it anymore, like for example keep alive packets... which causes it to crash after a timing out from the server. This can be fixed by handling some specific packets in the reader thread, and not sending them to the main thread via the channel. (I already fixed it in my custom version of this client, which I can't merge into this one, cuz I removed web support and I am about to switch to vulkano as a rendering engine)
The text was updated successfully, but these errors were encountered: