#Cause of room load delay between step 0 and 1

27 messages · Page 1 of 1 (latest)

round drift
#

Hello. When I switch from my title screen room to the game room, it’s a noticeable delay between when the screen starts to render. Probably like 6 seconds.

I’d love to know what that delay is, but that’s not the critical question.

Question:

  • How can I wait till that delay is over?

Extra Context;

  • I can play a sound effect in step count 0 and a different one in step count 1 and it’s about 6 seconds between the two sound effects.
  • my room for the actual game is only using dynamically created objects in scripts. In other words, there’s only one persistent object that was dragged onto the room editor. Nothing else from the room editor. But that persistent object is what creates everything for the game.
dawn oak
#

noticeable delay
Well, usually a room switch shouldn't cause any delay

#

Unless either you:

  • Have some kind of expensive operation running in the new room
  • Made the delay on purpose
round drift
#

Could it be a sprite sheet loading thing? Sorry I mean texture pages? Like it takes too long to get them?

dawn oak
#

It could be anything

#

But we could start with texture pages, sure

#

If you go back from the game room to the title screen room

#

And then back into the game room, without closing the game

#

Does the delay disappear?

round drift
#

The delay is like 5% the length when going back into the game room after exiting to the title room in between. So something is cached?

dawn oak
#

Like 5%?

#

So, are you saying that the delay is mostly gone?

round drift
#

Correct. Sorry for being not clear.

dawn oak
#

All good

#

In that case, then at least a majority of the delay is caused by texture pages loading

#

The remainder would be something within your code

round drift
#

Wonderful. I’m guessing the next step would be implement a loading screen that prefetches the texture pages…?

Or do you have any other advice on how to make it so that the delay is on the pre-room load side instead of the post room load side?

And thank you so very much for your time.

dawn oak
#

It depends on the kind of game you have

#

For a client of mine, I've implemented an entire loading screen system, that would load texture pages that it needed, and unloaded the ones that weren't necessary.
This required a separate room, a separate room_goto switch function and a set of helper functions to mark texture groups for certain rooms

#

But that's because it's a whole visual novel with HD graphics and essentially 25GB of uncompressed RGBA texture pages

#

(width * height * 4. PNGS/JPGS aren't a representation of the true size every single texture would take up)

#

While some other games you could load every single texture page in memory, if it's say pixel art

round drift
#

I’ll give it a shot and see if it improves. Hopefully I’ll remember to report back. I’ve 25 years of professional dev experience (non game), but I have the memory of toddler. So if I forget to reply, let’s mark this as answered in that the frame rate drop was due to texture page loading. Thank you so much! 🙂

dawn oak
#

🫡

#

Good luck!

round drift
#

Update: a loading screen brought the delay to 0. Thanks a lot for the help @dawn oak 🙂

dawn oak