-
Notifications
You must be signed in to change notification settings - Fork 20
Show loading screen if unsure what map we're loading into #1311
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
Show loading screen if unsure what map we're loading into #1311
Conversation
|
The background map doesn't load outside of first starting the game. After that it just shows the blurred shot. And if you manually load one from console the bar doesn't appear anyway in this PR. Could it be made so the loading bar is hidden when loading a map on game start, or if background maps are enabled in options, dont show it for the first map load? |
|
That works provided there are no problems loading the background map, otherwise the first server load will have the loading screen missing, also have to test how it works if you select a map to load or a server to join from an autoexec, which would also break if we used time since launching the game. Can also go back into the background map on disconnect provided the player disconnects through the menu and not via the command directly |
|
Theres probably some things that the game does for the first time when launching into a map which makes the initial background map load a bit longer, but it does make subsequently joining a server or creating one quicker, as well as any subsequent loads into the background map after disconnecting from a server if we want to add those too |
Weird, I don't have this. Maybe my configs |
|
I mean we can make this be the case. By default you just see the blurred image on disconnect |
|
I imagined it was an intentional thing, cuz people who want to switch between maps/servers quickly might not like the extended load time/freeze, but it's whatever really. Anyway I think this solution is fine for now |
Description
When creating a listen server, the host_map convar gets updated almost immediately with the name of the map we're loading into, if connecting to a dedicated server however this only happens when we're almost finished loading.
Since the whole reason we're doing this is to stop the loading screen from showing up when loading into a background map, and we should only really be loading into a background map on a listen server, we can assume that if host_map doesn't return a value, that we are connecting to a dedicated server at which point we should be showing a loading screen. In reality we still see the loading screen for a couple frames but that's much better than the current behavior.
As a side note, engine->GetLevelName() will return the map on a dedicated server when connecting quicker than host_map, but it's still quite far into the loading process.
Under the notes section https://developer.valvesoftware.com/wiki/Custom_loading_screen there is mention that some mods were able to obtain this value almost instantly, presumably when connecting to a dedicated server, but the author explains that this is probably impossible without engine access and I'm not sure what mods exactly were able to do this. The linked github repo also uses host_map for near instantaneous access to the map name when connecting to a listen server.
This only applies to using the "connect" command from the console. When looking at dedicated servers in the server browser we can see the map that was loaded when the server list was refreshed, so keeping track of what map we're most likely loading into should be easy if we ever want to extend the loading screen functionality to change the background to an image appropriate to the map we're loading into regardless of whether we're connecting to a listen server or dedicated server.