d07RiV / diabloweb

Diablo 1 for web browsers
2.71k stars 219 forks source link

going back to town -> white screen #14

Closed thk12 closed 5 years ago

thk12 commented 5 years ago

when i go to town a white screen appears. sound still plays. browser is latest chrome v 76.0.3809.87 (64 bit)

on F12 theres a JS error. i'll attach a log d07riv.github.io-1564754812722.log

techi602 commented 5 years ago

yep same error here

nikopp commented 5 years ago

I get the white screen when I go down to level 2.

Browser is latest chrome.

outpost34 commented 5 years ago

Same here. Chrome, turns white trying to return to town from dungeon. Sound stays on.

gwmccull commented 5 years ago

Same error when trying to go to level 2 of the dungeon. Chrome 75 on a mac

d07RiV commented 5 years ago

Please include a save file, it's really hard to read an error log from production build.

You can get the savefiles by typing DownloadFiles() in devtools console (F12).

d07RiV commented 5 years ago

Seems the game was trying to report an error but something went wrong. I'm fixing the error reporting, but the root cause is still unknown.

Foricoso commented 5 years ago

I've downloaded the save file when the prompt asked (just after entering a town portal and getting the error), I'll try to send it to you.

Steviadition commented 5 years ago

Got same error, going down to level 1. white screen, just sound. Chrome, Windows 10.

Is there a solution yet?

Foricoso commented 5 years ago

I'd just like to add that, after starting a new character today, I haven't been able to reproduce the same problem, everything works fine.

gwmccull commented 5 years ago

Right after I posted my error above, I created a new character using MacOS Safari and I did not get the error. Played through both levels of the dungeon w/ no problem. The only difference (other than browser) is that I didn't save at all before I went to the 2nd level

tomekk01 commented 5 years ago

Right after I posted my error above, I created a new character using MacOS Safari and I did not get the error. Played through both levels of the dungeon w/ no problem. The only difference (other than browser) is that I didn't save at all before I went to the 2nd level

I got the error on Chrome and for me the very first save was on 2nd level before taking Butcher. Before making the save I was able to go back and forth to the town several times. It seems that something was\is wrong with information about the town (?) as I was able to move between levels 2>3 (after killing the butcher) >2>1 but when tried to go to the town (via stairs in the cathedral) the game crashed. I did not had any town scrolls yet so I'm not sure if that would also crash the game.

refractionpcsx2 commented 5 years ago

Although i haven't tried it since this morning, I didn't manually save (it may have saved automatically, I didn't check) but going down to the second level of the dungeon caused a white screen for me. I tend to clear out whole levels before going down to the next one, so an auto save is highly possible

tomekk01 commented 5 years ago

Although i haven't tried it since this morning, I didn't manually save (it may have saved automatically, I didn't check) but going down to the second level of the dungeon caused a white screen for me. I tend to clear out whole levels before going down to the next one, so an auto save is highly possible

Is there such thing as autosave in D1 after you change levels? Not sure, just asking?

refractionpcsx2 commented 5 years ago

Although i haven't tried it since this morning, I didn't manually save (it may have saved automatically, I didn't check) but going down to the second level of the dungeon caused a white screen for me. I tend to clear out whole levels before going down to the next one, so an auto save is highly possible

Is there such thing as autosave in D1 after you change levels? Not sure, just asking?

I don't know personally, the last time I played D1 before this, I was about 15, I'm now 37 xD

sskras commented 5 years ago

Is there such thing as autosave in D1 after you change levels? Not sure, just asking?

@tomekk01, there was no such thing IIRC. Every save needed to be player initiated, manual.

refractionpcsx2 commented 5 years ago

Is there such thing as autosave in D1 after you change levels? Not sure, just asking?

@tomekk01, there was no such thing IIRC. Every save needed to be player initiated, manual.

In that case, the white screen happens regardless of saving. (apologies if I've misunderstood where people were going with this)

tomekk01 commented 5 years ago

Although i haven't tried it since this morning, I didn't manually save (it may have saved automatically, I didn't check) but going down to the second level of the dungeon caused a white screen for me. I tend to clear out whole levels before going down to the next one, so an auto save is highly possible

Is there such thing as autosave in D1 after you change levels? Not sure, just asking?

I don't know personally, the last time I played D1 before this, I was about 15, I'm now 37 xD

yes, same thing for me - that was actually first game I bought more than 20 years ago as teenager :D - and now it's playable in the browser :)

d07RiV commented 5 years ago

There's two different errors. One was in shareware version when going down to level 2 - the game sometimes crashed because it was trying to load the Butcher, which does not exist in shareware files (there aren't supposed to be any quests). I fixed that error yesterday, so that part should be working normally.

The other error is that I'm seeing a lot of save files with corrupted town data. When you play the game, it saves every level you visit in your save file as a "temporary" level (so when you go back, everything is the same). When you actually save the game, it replaces all "permanent" levels with temporary ones. I'm not sure at which point the town level breaks, as I've never been able to reproduce the problem. It seems to only result in the town being broken, not other levels - at least in the saves I've looked at so far.

If anyone runs into this, try to describe the steps you took before - creating different characters, switching between them etc might all be relevant.

d07RiV commented 5 years ago

Somehow another file is overlapping the town data, this seems like a lead.

d07RiV commented 5 years ago

I made a small fix that removes some inconsistencies in save file handling, but I doubt it is related to the issue.

outpost34 commented 5 years ago

Thanks for the fixes! Last I played the white screen error disappeared. I made a new character though lol.

d07RiV commented 5 years ago

Well yes, the error is with particular save files and I really have no idea how that could happen, I've read through the saving code 50 times over and can't spot any problems (and most of it is still identical to the original code).

If anyone manages to reproduce it in a reliable manner, that would be great.

ghost commented 5 years ago

@d07RiV could this be because the save game container memory pointers?

sskras commented 5 years ago

As I know nothing about WASM and haven't followed diabloweb history, I would like to add: if pointer concept is used here, what is its width – 32 or 64 bit?

Eg. devilution is 32-bit only app while devilutionX may be compiled as 64-bit. And the latter had a lot of bugs in 64-bit mode (since the original code wasn't machine portable) during a time, esp. in regard with save files.

EDIT: it needed quite a lot of patches to cope with this.

athalas88 commented 5 years ago

I have this issue too. First I tried a shareware version, made a character. After that i played the full version and on that I made the same character. Anytime I try to go back to town, it crashes, even with town portal or on foot from the level 1. Now I will try a new character, hope it will help.

d07RiV commented 5 years ago

@OrangBuangan I doubt it, there are a few pointers in player struct but those are overwritten during load. What's happening is the MPQ block table breaks somehow, and the files end up overlapping. I'm also seeing some archives with way more files than they're supposed to have, no names though so can't tell what they are.

This is 32 bit, WASM does not support 64 bit currently (max memory is hard capped at 2GB so there's no point).

@athalas88 can you remember what you did on the new character before it started crashing? I'm fairly sure spawn and full versions shouldn't interfere with each other as they use different files.

d07RiV commented 5 years ago

Okay I did some further digging, and it seems the fix I made 2 days ago should have solved this problem (saves made before that might still be affected).

Reproducing on the old version is really easy - create a new character, enter church without saving, then save. Now you can't leave the church.

I'm going to close this on assumption that the problem is gone.

thk12 commented 5 years ago

ty! and keep up the good work

athalas88 commented 5 years ago

Hi. I just wanted to thank you! Now works perfectly! :)

Athalas

thk12 notifications@github.com ezt írta (időpont: 2019. aug. 5., H 15:59):

ty! and keep up the good work

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/d07RiV/diabloweb/issues/14?email_source=notifications&email_token=AMZZHPEAPUMIG5LHLXVLASLQDAW5PA5CNFSM4II6DYPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3R44JQ#issuecomment-518245926, or mute the thread https://github.com/notifications/unsubscribe-auth/AMZZHPCRS773SK3XNW4IHG3QDAW5PANCNFSM4II6DYPA .