Title screens should not be loaded if "Show title screens" is off

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
mat
Posts: 61
Joined: Sun Sep 20, 2020 8:24 am

Title screens should not be loaded if "Show title screens" is off

Post by mat »

I realize that there is "Title screen" option in "Info screen" but when someone turned showing title screens off, they could be loaded at the time the user will consciously choose mentioned "Title screen" option.

I don't know if it should be treated as a bug or a new idea... Let it be the first one :)
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Title screens should not be loaded if "Show title screens" is off

Post by Holger »

No, this is not a bug! Or at least this is in fact intended behaviour! :D

- There are level sets with title screens (for example, in the EMC collection)
- You might not like to see title screens when selecting a level set that has title screens
- That's why there is an option for that in the setup menu to turn them off
- In any case, you can watch the title screens on the "title screen" page in the "info screen" menu
- You should be able to look at them there even if you have disabled them when loading a level set

So from my point of view, everything works as expected.

If you see any room for improvement, please let me know! :-)
mat
Posts: 61
Joined: Sun Sep 20, 2020 8:24 am

Re: Title screens should not be loaded if "Show title screens" is off

Post by mat »

Alright. I just wanted to save several seconds so that I can play the game a bit faster :D

About improvement: I can't come up with a reasonable idea at this moment. Maybe later...
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Title screens should not be loaded if "Show title screens" is off

Post by Holger »

When reading this again, I think I misunderstood you?!

Am I right that you meant that when showing title screens is disabled, R'n'D should just never load these title screens at all to save the time for loading them (unless explicitly asking for them in the info screen)?!

What I understood was "if title screens are disabled, also do not show them on the info screen"...!

But now I think you meant the first one! :?

Because, yes, R'n'D always loads all title screens, regardless of being instructed to display them after loading a new level set or not! I think that loading a few low-resolution PNGs should not hurt that much, though.

But this is in fact something that could be generally optimized, as it is true for *all* artwork files: They are always completely loaded into memory after selecting a new level set, and before the game continues, even if they will never be used (like title screens that are configured to be skipped).

Therefore, I've already thought about some sort of "lazy loading" every now and then (especially when doing tests with the R'n'D special edition "R'n'D Jue II", which contains a vast amount of artwork, most of it high-resolution). Not loading things before they are really required would probably speed up loading new level sets quite a lot. On the other hand, it would cause short interruptions whenever a new image or sound should be used that is not yet loaded into memory (and scaled to the required sizes). So tagging certain artwork as "always load this stuff" may help to prevent this... But it's only thoughts so far... :D
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Title screens should not be loaded if "Show title screens" is off

Post by filbo »

When I `strace` startup of R'n'D, it opens thousands of files even when its cache/artworkinfo.cache is completely up to date.

For instance it opens 878 levelinfo.conf files (in the process calling 1368 stat(), 878 access(), 878 open() calls).

With everything cached in memory (2nd consecutive run), it takes about 2 seconds to get from 'rocksndiamonds<enter>' to live UI.
mat
Posts: 61
Joined: Sun Sep 20, 2020 8:24 am

Re: Title screens should not be loaded if "Show title screens" is off

Post by mat »

Am I right that you meant that when showing title screens is disabled, R'n'D should just never load these title screens at all to save the time for loading them (unless explicitly asking for them in the info screen)?!
Yeah, I meant that one :D
On the other hand, it would cause short interruptions whenever a new image or sound should be used that is not yet loaded into memory (and scaled to the required sizes).
I was not thinking about lazy loadings of other resources. In theory, there could be loaded only that stuff which occurs in the current and next levels. Players (of course, not everybody) aren't going to solve previous puzzles because there is no need to complete already completed levels. Users know what to expect, there is no element of thinking newly.

I don't expect anything about optimizing those things because I realize that spending time on it may be a burning daylight (e.g. before loading necessary resources, the game would have to iterate over each level, starting from the current one, for checking which data needs to be loaded). That's why I used "In theory" :)
Post Reply