'Seamless' Singleplayer level transitions#2404
'Seamless' Singleplayer level transitions#2404DarthTealc wants to merge 2 commits intoFacepunch:masterfrom
Conversation
|
you can draw a level transition LOADING panel near identical to vanilla hl2 with you can have localised text with the already existing #GameUI_LoadingGame |
|
Thanks @Xenthio - added and confirmed it matches HL2's dimensions/position |
the text should appear identical to pre anniversary edition half-life 2 |
|
Maybe you might want to separate the loading bubble to avoid this PR becoming stuck. I am not sure if Rubat would like this given that loading bubble had been removed from GMod a long time ago. I like that bubble change, though. |
|
The bubble commit can be reverted during merge without impacting the rest of the PR. Rubat can decide. If kept, it only shows on singleplayer's Source level transitions, doesn't show on any other loading type. |
OnActivate() would receive a 'transition' boolean if the load is happening due to a Source Engine level transition (trigger_changelevel / changelevel2 etc), similar to in player_manager.OnPlayerSpawn. Multiplayer will always end up being false as Source Engine level transitions are only supported in singleplayer. If OnActivate 'transition' is true, it sets the loading page to "about:blank" and draws the panel with the last rendered frame prior to load, provided by engine.GetLastFrame() engine.GetLastFrame() would only exist in menu state, and would return a material of the last game frame that was rendered prior to load, excluding hud/vgui/etc. The result of this is when a singleplayer game initiates a level transition, instead of seeing the default Gmod loading screen, they see a freeze frame of their game with the "loading" source panel in the bottom-right corner, similar to in HL2.
Thanks to Xenthio for HL2-style "LOADING" panel Co-Authored-By: Xenthio <[email protected]>
5991f06 to
24a7e80
Compare






Suggestion
'Seamless' level transitions for singleplayer's Source Engine level transitions, showing the freeze frame just like in the original games.
Demos
trainstation.mp4
testchmb.mp4
HL2's d1_trainstation_02 to d1_trainstation_03 & Portal's testchmb_a_01 to testchmb_a_02
Required for functionality
The PR code would need these before merging.
:OnActivate()function to be given a parameter:OnActivate( transition ), which istruewhen the player's singleplayer game experiences a changelevel2/trigger_changelevel. This is similar to https://wiki.facepunch.com/gmod/game.MapLoadTypeengine.GetLastFrame(), which returns a material of the final frame rendered prior to loading, excluding the hud/vgui/etc.How the demo gameplay works without that functionality
:OnActivate( transition )not currently being provided that flag -transition = truewas added.engine.GetLastFrame()not currently existing - A specific texture is updated everyPreDrawHUDclientside, which stops getting updated when rendering stops and is therefore frozen at the final frame, and in menustate a dummyGetLastFrame()returns a material of that texture.