ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
634 stars 74 forks source link

[Source - Single-player] Engine does not clear .HL# files upon quit, can create game state transmutation with other games (?). #6191

Open LittlePlanetCD opened 1 month ago

LittlePlanetCD commented 1 month ago

Hi! This is my first time writing an issue for Source, so I apologize if this gets confusing. I'll do my best to describe this:

I had recently discovered that single-player Source games (i.e. Half-life 2 & it's episodes, Portal) have a problem where it does not clear the .HL# files from a loaded save when quitting.

I stumbled upon this issue from playing a source mod, called Half-life 2 MMod Mirrored (an extension of MMod that basically adds a "Mirror Mode").

I had played through the mod up until d1_canals_07 (which is modified from the vanilla map from Half-life 2), and somehow the mod loaded the .HL# game states from my vanilla Half-life 2 saves directory.

I could tell, because these blood splatters exist in my HL2 save from that exact map: image

and sure enough, they also exist here in the mod's version of canals_07 when it loaded the game states from the vanilla save directory: image

as far as I am aware, Source does seem to have some checks in regard to .sav files to prevent them from being loaded into other games or mods. But in this case, it seemingly has no checks for .HL# game state files.

I believe this might be in due part of the .HL# files being considered as "loose files"? Not entirely sure. What is interesting is that this issue also seems to stem from GoldSrc as well, as it originated there.

A good solution might be to either implement a validity check for these files, or / and implement functionality within the engine for those to be cleared upon quitting a game.

LittlePlanetCD commented 1 month ago

as an added bonus, here's a funny gameplay clip from MMod with this bug:

https://github.com/user-attachments/assets/9669a34e-6b0b-4567-aa28-2cca0dbfd485