Lag and script error

Ok, I managed to upload my game to my server. It's there. I've playtested. A few friends also playtested it. It can be found here: http://letraimpressa.com.br/iason/ -- (in Portuguese, sorry -- but I'll translate it soon).


Two problems I've noticed:


Lag issues


It's a small game, with few events, few maps, but sometimes it lags a lot. The main culprit are two maps where there's an overlay to obscure part of the player's vision, but it also occurs in other parts, even dialogues (once the game froze when trying to display the character "ê" on a sentence, and I've saw another lag when trying to display the value of a variable).


I've found that, if I saved the game and then reloaded the page, when I loaded the savagame the lag disappeared (for a while--eventually the game lagged once more).


Script error


This is strange. Three friends of mine were not able to play the game: as soon as they hit the webpage they see a "Error" message (the line below simply describes as "Script error." -- hardly a friendly message). Other players (myself included, in two different computers) had no problem.


EDIT: Another friend received the following message: "Your browser does not support Web Audio API." -- this occurred using IE, the previous error happened using Chrome.


How to correct this?
Well, I'm afarid I can't really help, but I have tried the game on Firefox and Chrome (Windows 8.1).


Firefox 45.0.1.


When I try to enter the game from the title menu, I immediately get this error:

UnknownError
[Exception... "Illegal value" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://letraimpressa.com.br/iason/js/rpg_core.js :: Bitmap.prototype._drawTextOutline :: line 1041" data: no]



Chrome 49.02...


Seems I can play the game without issues... no lags, very smooth. Was on the dungeon too.
On my grandpa's computer (Chrome), the game couldn't find the font at first. F5 and it loaded. Took ages to load the title screen. F5 and it loaded. Rinse and repeat seven or more times until I was able to reach the dungeon...

Chrome 49.02...


Seems I can play the game without issues... no lags, very smooth. Was on the dungeon too.

The greatest lag issue happens inside the dungeon when you go north and then choose the right passage on the following map. It's there the overlay is on. If you can be so kind, could you please test that?
Okay, I think I know what you are meaning now. This map is almost unplayable. Very slow... like a slide show with many dropped frames. 🙁


Just a note: Your battle system was like the hell on my laptop keyboard. Somebody wants to unknot my fingers? 😉
Okay, I think I know what you are meaning now. This map is almost unplayable. Very slow... like a slide show with many dropped frames. 🙁


Just a note: Your battle system was like the hell on my laptop keyboard. Somebody wants to unknot my fingers? 😉

The fix for that lag is: as soon as the game start lagging, go back and save the game at the statue on the previous map. Press F5, load the game again, and now there's no lag.


But this is madness... Asking a player to save and reload after 10 minutes or so is the same as asking him not to play the game... And so far I don't know why is this happening.
For the lag, how are you applying the overlay? If  you are using a parallel process to do that and it has no wait command it will lag as it is running 60x a second.
For the lag, how are you applying the overlay? If  you are using a parallel process to do that and it has no wait command it will lag as it is running 60x a second.

No, not like this.


On the previous map, after the transfer, I use a Fade out, and then Show Picture, Fade in. This should ensure the overlay appears before the player sees the new map. It occurs a single time.


When you exit the map, after the transfer, Fade out, Erase Picture, Fade in.
Hmmm...I may have to run it myself and see. When you said overlay I was thinking like a fog that follows the player, which I don't think this would do. But who knows. More to come (hopefully) in a few days...

Original thread: https://forums.rpgmakerweb.com/threads/lag-and-script-error.59199/