ad044 / LainTSX

WebGL implementation of the Serial Experiments Lain PSX game
GNU General Public License v3.0
492 stars 27 forks source link

Stuck on a loading screen after exiting a node #30

Open vavrinecsrobik opened 1 year ago

vavrinecsrobik commented 1 year ago

Sometimes when i exit a node (with the exit button or by pressing one of the words) i get stuck on the "life instinct function OS" loading screen. The game seems to work fine, i can hear the music playing, and i am able to save my progress, however i cannot see what is happening as it is obstructed by said loading screen.

I use Brave, this was in the browser console:

handleMediaSceneInput.ts:59 Uncaught TypeError: Cannot read properties of null (reading 'paused') at _o (handleMediaSceneInput.ts:59:17) at InputHandler.tsx:86:36 at InputHandler.tsx:108:18

ad044 commented 1 year ago

hmm that is quite strange, the error logged to the console shouldn't even have anything to do with the loading screen showing. my only uninformed assumption would be that that error (the one logged to the console) happening puts the program in a strange state, which causes all sorts of weird things to happen.

judging from the message, it seems to be some kind of race condition of trying to play the media before the elements have fully loaded. i'll add a little sanity check in the reworked code (not deployed yet on the website) for that just in case. if my above assumption is correct, just avoiding that error from happening by doing this should be sufficient.

if you could reproduce the error consistently that would be extremely helpful! could you look into that please?

vavrinecsrobik commented 1 year ago

I looked into it, the error seems to be a fluke as i was unable to replicate it. It happens while exiting Dc nodes way more often than with other nodes, however only after finishing the video. Sometimes i also get stuck on the loading screen right after loading my save file if i resize the game window while its loading. I havent found a 100% reliable way of triggering it though.

ad044 commented 1 year ago

yeah it happening with the dc nodes makes sense considering the videos would likely take a lot longer to load therefore the time window for the race condition to occur would be higher. i'll keep this issue open for now and look into it, thank you for notifying.