Loading problems...

Loading problems...

Hi, can anyone tell me what kind of error it is and if so how i could solve it?
the game i'm developing, from a certain point on, has a hard time loading the saves, or they remain on black screen or this error appears. i've tried to lighten the quality of the images, to make the code lighter, to see if some sounds were giving the problem, but nothing worked. i'm wondering if it's not a problem of some loading script or similar, because i really don't know where to beat around the bush anymore...
It's hard to tell as I'm not using VNM

However, _this is not defined means you are trying to access something that hasn't loaded yet or isn't available, hence the "undefined".

The error seem to point at index.html at line 2 column 11
Care to share what's at that location?

_this is usually used inside functions to maintain original context, so it could be it hasn't been correctly initialised. (Aka, declaring a variable after calling the function that uses that variable)

If it is used in a function, and it has been correctly initiated, try binding it using .bind(this)
Simply add var _this = this; in your function

Maybe share the code you are using that is generating this error?


Overall, it could be the script loads faster than the game state, triggering undefined errors as it tries to call for objects that aren't ready to use.
I think it's between these lines that the problem lies, but I'm not sure, I admit I'm not very familiar with codes and scripts in general ^^", I'll also attach what I "think" is the script that gives problems ^^"
The file provides no evident clues (to me) of something being undefined.

What scripts are you using to "load" ?
It really looks like the gamestate isn't ready

Again, I'm not familiar with VNM architecture, if it's script based I could maybe help, but if it's linked to the software someone else would need to step in. 😅


EDIT :
After looking it up a little bit, before you load the game, try and place this piece of script :
JavaScript:
const _VNM_GameState_Load = VNM.GameState.load;
VNM.GameState.load = function (object) {
    try {
        _VNM_GameState_Load.call(this, object);
        console.log("Game loaded succesfully!");
    } catch (error) {
        console.error('Error during game state load:', error);
    }
};

This should at least tell us if the issue is coming from the gamestate when attempting to load it, or if it lies somewhere else.
I imagine that it is like RPG maker, i.e. you programme everything without writing codes, but it still has scripts in it, (forgive me if I'm talking nonsense, but as you may have guessed, I'm not very experienced in programming with codes XD)

however this is the MAIN code of the game, I BELIEVE the loading system is here...?
This looks like something I can work with indeed ^^

I changed the script to try and catch any potential error.
Make a backup of your original file, and try this new one instead, launch the game and see if the error message has changed.

If the error is dued to loading, this new file should be more precise about what part causes the issue.


And don't worry about not being comfortable with scripting, that's the reason VNM and RPG Maker exist ^^
To make it easier for non-scripters to create. 🙂
thank you very much for your help, I appreciate it so much ;_;!! I will try it as soon as possible and update as soon as I have the test results!!!
I tried replacing the original code with the new one, now the game remains fixed on a black screen as soon as it is opened.
I tried replacing the original code with the new one, now the game remains fixed on a black screen as soon as it is opened.
on the other hand, no errors are reported XD
Here is a newer version with stops logs to see what is loaded, where it stops and if any error occurs.

The black screen could potentially mean certain files are corrupted or not present.
Did you press F12 and look at the console?


Anyway, try this new file, run the game a few times, and share the logs (F12) for detailed debugging. 🙂
If it's a black screen, try a few more times to see if you can trigger an error.


We'll get this fixed 😀
I did some tests. no more error messages came out, but always from one point on the loading started to slow down more and more and then stopped many times in a black screen.
in any case, when i test it on VNM the loading is fast and smooth. in fact i only noticed this problem when i exported the game, because on the program testing it doesn't give me any problem ...
small note: now i don't get the english translation anymore and the game starts in italian (my native language XD)
i made some videos to show how slow a load is and how fast it is on the program while i test it
Since my beta testers have never had such problems, I might believe it to be a problem with my PC, but I have these problems on every computer I have in my house D:

It can be a variety of things, the console log (F12) is needed to debug this as I set a bunch of detailed markers in it, to see what and where it happens.

Gradually slowing down is typical of memory leaks, or ressource managment.
Keep an eye on CPU and RAM during playtests to see if those skyrocket.


Without the logs, I can't do much more than guessing though.
don't worry, in fact thank you very much for your help! you've been very kind! \^.^/
some of my beta testers, are trying to see if it could be the 'skip' command that could cause certain problems, perhaps sending scenes forward too fast could prevent certain variables or resources from loading correctly...
I suspect either loading issues or memory leaks.
The file I sent is full of checkpoints to see where exactly its blocks, what part is having troubles.

You seem like you don't want to share the logs, so I can only wish you good luck 🙂
I suspect either loading issues or memory leaks.
The file I sent is full of checkpoints to see where exactly its blocks, what part is having troubles.

You seem like you don't want to share the logs, so I can only wish you good luck 🙂
oh no, I would more than willingly share logs, I just have no idea what to show or how clearly VNM's debug console works ^^"
I haven't the faintest idea what certain errors indicate (not to mention that when pressing f12, there is no command to log ^^")
the only thing I could do is check CPU and memory with the task manager, but there were no spikes, everything remained very constant
There are quite some issues it would seem...
I haven't the faintest idea what certain errors indicate (not to mention that when pressing f12, there is no command to log ^^")
the only thing I could do is check CPU and memory with the task manager, but there were no spikes, everything remained very constant
The images you shared are part of what's called a console log. 🙂

It looks like it can't access much of the loading, hence the load has aborted

In the bottom left corner, there is a Issues and Console box, could you copy and paste everything that's in that console section?
It is likely to hold some more data
1722599766662.png
clicking on console leaves me on the exact same page where there are these lists of errors and I have not found a way to copy and paste the contents of the files._.
I could only make a video where I can show you file by file

This is strange, not a single mention of my checkpoints...
Did you replace your main.coffee file with the one I gave? (It's 100% the same thing, it just add console messages for debugging)

If you are playing in a browser, clear the cache and refresh the page to ensure using the new main.coffee file.


Since you are talking about beta testers, could you share a copy after trying the above ?
Wait, I think that was the console of the backup version -__-"
this is the version with your code!

sure, can i send you the copy of the game in a private message?

I'm sorry to say I'm at a loss here, it's like the game didn't even get passed the main constructor initiation.

Yes, in DM is fine 🙂

Hopefully someone with more VNM knowledge will be able to help though.

Original thread: https://forums.rpgmakerweb.com/threads/loading-problems.170787/