Load GRFs only when they are needed

Got an idea for a new feature in TTDPatch? Post it here.

Moderator: TTDPatch Moderators

Post Reply
User avatar
Jezulkim
Chairman
Chairman
Posts: 844
Joined: 04 Jan 2004 09:40
Location: Finland/Suomi

Load GRFs only when they are needed

Post by Jezulkim »

This would improve the game loading time a lot. When I left only few files in my newgrf.cfg (TTO set, ttd patch files)the game loaded in ~10 seconds, but with full config file it can easily go to ~2 minutes.

So, my suggestion is this:

If you have files A, B and C in your newgrf.cfg like this and none of the use the grfid FF FF FF FF.

A ! (a big file 5mb, this one is not loaded in any saved game)
B !
C

And this is what should happen:

1) Title screen doesn't use any of those files so they are not loaded yet.
2) You load a saved game with file B activated. TTDpatch loads that file.
3) You decide to start a new game, because you finished that saved game. Now TTDpatch will only load file C.
4) The file A was loaded zero times and the size of file A was 5mb, because we didn't load it, we saved some time.
Image
In order to protect the visitors of this site,
TTO Full Conversion!
This post has been lol 1337 times.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

It's not possible. All files must be initialized first before any of them is activated. Therefore, once one file is activated (which happens when the title screen loads), no further files can be loaded.

The only thing I can suggest is that you make several newgrfw.cfg files, and select between them with the -Xn command line option, so you only load the one which you'll need in any one session.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7419
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Post by Redirect Left »

To make it simpler is it possible to add a switch into the Patch that you can use to switch between them insted of editing the comand lines.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
Jezulkim
Chairman
Chairman
Posts: 844
Joined: 04 Jan 2004 09:40
Location: Finland/Suomi

Post by Jezulkim »

Patchman wrote:It's not possible.
Aww, that's too bad. I think I'll just have to clean my newgrf.cfg of the unused grfs. And I checked the loading time it was 1 minute and 1 second :).
Image
In order to protect the visitors of this site,
TTO Full Conversion!
This post has been lol 1337 times.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Captain_Kirk76 wrote:To make it simpler is it possible to add a switch into the Patch that you can use to switch between them insted of editing the comand lines.
The "newgrfcfg" line does the same thing, but in ttdpatch.cfg.
Jezulkim wrote:
Patchman wrote:It's not possible.
Aww, that's too bad. I think I'll just have to clean my newgrf.cfg of the unused grfs. And I checked the loading time it was 1 minute and 1 second :).
Besides, even if it was possible to not load them, it's impossible to know whether it should activate without loading it. You wouldn't even know which GRFIDs correspond to which file, much less whether it's meant be active or not.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Jezulkim
Chairman
Chairman
Posts: 844
Joined: 04 Jan 2004 09:40
Location: Finland/Suomi

Post by Jezulkim »

Patchman wrote:You wouldn't even know which GRFIDs correspond to which file, much less whether it's meant be active or not.
Well, if you could load only the action 8... but since it's not possible to load files after starting TTDP that'd be useless.

But anyway, I got my loading time reduced to 15 seconds after cleaning :)
Image
In order to protect the visitors of this site,
TTO Full Conversion!
This post has been lol 1337 times.
Post Reply

Return to “Suggestions”

Who is online

Users browsing this forum: No registered users and 5 guests