A Delay in the loading screen?

Issue: a Delay in the loading screen?
Crash (y/n): No
Platform (Windows/Mac/Linux): Windows 7
Description: I Am not sure about this,but its happening recentely,i loaded my save file after editing it for a sandbox (just the cash,for trying to find bugs in building,finded one,i tought it was my drive,since i didn’t updated for a long time) and after a long loading i finded a very curious thing,yes,i finded a delay at the final part of the loading,where the name of the MMO Appears and the gameplay starts,but suddenly after the name of the mmo showing it stopped,and stayed black,a long time after,it loaded completely and the gameplay starts,i was like:“its because i edited my save file for finding bugs” but remembered that it happened other time,at a diferrent save file and a funny fact is that it happened when the save file was 5 and more Megabytes

When you say “delay”, do you mean that everything freezes, or does the background continue to animate, and the map just not appear when it looks like it should?

During the load screen, the game checks how fast the load is proceeding and makes predictions about when the load will complete. When we think the load will complete within the next two seconds, we start the “end of load” visual sequence.

Occasionally, this prediction gets it wrong, and we incorrectly trigger the “end of load” sequence several seconds early, and the load just takes a couple more seconds before the map is ready to draw. At some point I’ll need to make this prediction more accurate, but for the moment it’s not a really serious problem, in my opinion.

Does this sound like what’s happening for you? That is, the background continues animating during this “delay”, and the delay doesn’t happen every time?

Yes,the background continue to animate and the map just not appear when it looks like it should
and yes,the delay don’t happen every time,but still,its happening very frequently last days,but also,it takes more time than just a couple more seconds,minutes is the better explanation

Okay, ‘minutes’ is a surprise; I’ve never seen it take more than an extra two or three seconds, when it has gotten the prediction wrong (for me, it happens perhaps once or twice per week… and I do a lot more loads than most people do!).

Could you zip up your saved game and upload it somewhere, so I can investigate a little? I’m curious to see what’s taking so long to load… (I guess I should really implement some way to submit a saved game for testing, from inside the game, to make that process easier.)

Also, could you let me know your CPU type and speed?

Informations about my CPU:
Pentium® Dual-Core CPU E5700 @ 3.00GHz 2.99 GHz
and here is my save game,also,i deleted other save games 'cause i placed the wrong name in some,but ended deleting them all :stuck_out_tongue: (Also some of them were with the same bug)
https://drive.google.com/file/d/0B5rQwQHhXljUOUc4WWROaWoxQ0U/view?usp=drive_web

Ok i could reproduce,i quickly took a photo,but i got more time than i expected,heres how it works (in astop motion?):


ITS NOT FREEZED,i just taked a photo,the background was moving,minutes later the game loaded

Everything that follows is just me writing down my thought process. :slight_smile:

The E5700 is a pretty slow CPU, and the slowest part of the game load is building the world map, which is entirely done on the CPU.

Like dual-core i3 and i5 hardware, the E5700 only supports two hardware threads. During our load, MT2 really wants to use at least three threads. We use one thread for drawing the loading screen, one for actually performing the load, and at least one more thread for building the map geometry (and we use more than that, if there are more hardware cores available for them to run on).

The problem on a two-hardware-thread system is that I have three threads going when the hardware only supports two. This means that I’m using more threads than the hardware supports, and as a result, the threads are swapping around between hardware cores, and sleeping when they don’t have control of one of the cores; they aren’t running consistently. All my predictions about when the load will complete are based upon the assumption that the threads are running constantly, so they’re going to be wrong if the threads sleep sometimes.

But being off by a minute? That doesn’t sound like the prediction being slightly wrong; that sounds like the load sequence has triggered the end sequence entirely early. Maybe before the map build has even properly kicked off (a minute is in the ballpark of how long I’d expect the map to take to build on a low-power CPU like this one, so that seems likely to me). Maybe I haven’t properly fenced the period in between when we start building map data and when the first prediction comes in? Or something like that? The thread swapping is likely making whatever the problem is happen more frequently.

So I need to do some digging and figure out whether I’ve done something thread-unsafe that might be resulting in invalid load-time predictions being read by the loading process.

Side-note: Minute-long load times are unacceptable, in my opinion. We have two big slow processes in the load right now; loading the text-format save file (once it gets big), and creating the map data (always).

I can address the “loading the text-format save file” thing by either moving to smarter text parser (I set up the basics of one in bison about a year ago; maybe I should look at that again?), or by moving to a binary file format, which doesn’t require parsing at all.

Generating the map geometry is trickier. The eventual thing to do there, probably, is to move that process over to the graphics card, instead of doing it on the CPU. There are all sorts of technical hurdles to overcome in making it able to happen there, but… it ought to be several orders of magnitude faster, if I can make it work.

But for this bug report, I think that the problem is likely to be just triggering the end-of-load visual sequence early, before the map data has even properly begun being built. So I’ll investigate that. The other “make it all run faster” things are for another day. :slight_smile:

Well,im not sure if i had to request this,but i really can’t test with this big loading screen,one example of how it were annoying was at the “Inn crash” and i always was opening for testing the inn seeing if there was anything about it and the paths,well,it were fixed,but still,it were very annoying with my tests,after this i must say about when you need to exit for personal problems or just because you don’t wan’t to test all the day and then you close,some hours later when you’re coming back for testing you need to wait MOOOOOOOOOOOOOOOOOOOOOOOORE loading screens :frowning:
this is not a critic or saying the game is bad about this,im just saying that it so hard to test when you need to wait hours to open,if you do not want to make the “go faster in loading” thing,its okay,just requesting for helping me at testing (and others)

Earlier you said:

Do you truly mean that loading is taking literal hours, now?

You still haven’t provided an actual timer duration for how long the load is taking for you.

But with that said, please understand that right now I’m focused on game features. I’m unlikely to spend much time on optimisation until later in development; it’s just a waste of time to invest time into trying to speed things up right now. Those things might change tomorrow, negating any improvements I might make.

Optimisation will be a priority at some stage; we’re just not there yet. If the loading times are too high for you at the moment, I completely understand if you need or want to stop testing for a while. You’ll always be welcome back, when progress has been made, or if you just feel like dipping your toes in the water again at some point in the future.

no,im talking that
the loading screen is big but sometimes,the animation for the map appears takes a couple minutes to finish

@FrancoGamer, please update to the latest build of the game and load into the game once; it’ll measure how long the various processes in the loading screen take for you, and tell me the result. That’ll help me a lot!

From the load stats, the loading duration for you looks like this:

To load the save file, 5 seconds.
To create the map geometry, just under 19 seconds.

That’s down a lot from the “minutes” and “hours” previously reported, from the versions which had slow loading on Windows. I’m still going to be thinking about whether I can’t push map geometry building onto the GPU instead of relying on the CPU to make that a little (or more likely, a lot) better, but… these numbers don’t look absurdly awful to me, in this version.

I Think its because i got a new computer…WAIT 5 SECONDS? THEN I LEFT THE PC FOR 1 HOUR FOR THIS?

I have no idea what you’re trying to say; whether you’re trying to be funny, or whether you’re saying that the issue isn’t resolved, or whether you’re saying that it IS resolved.