View unanswered posts | View active topics It is currently Thu Jan 16, 2025 5:24 am



This topic is locked, you cannot edit posts or make further replies.  [ 31 posts ]  Go to page Previous  1, 2, 3  Next
 Speeding up loading 
Author Message
User avatar

Joined: Sun Oct 19, 2008 5:43 pm
Posts: 92
Post Re: Speeding up loading
What exactly happens during INI parsing? If it's just the creation of game objects, can't those objects be "cached" via serialization to avoid the need to parse INIs each time? The game can just check the "last modified" timestamp on each INI to determine whether the cache is obsolete.


Tue Jul 07, 2009 7:47 pm
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Post Re: Speeding up loading
Footkerchief wrote:
What exactly happens during INI parsing? If it's just the creation of game objects, can't those objects be "cached" via serialization to avoid the need to parse INIs each time? The game can just check the "last modified" timestamp on each INI to determine whether the cache is obsolete.


It sorta kinda somehow does... But not quite.

First time loading CC can take up to 20 seconds or more (With no mods), but after that, it takes about half as much time to load.

So something is definitely going on...


Tue Jul 07, 2009 8:02 pm
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Post Re: Speeding up loading
MaximDude wrote:
So something is definitely going on...

Or rather, something didn't go on. The data is still held in RAM until another application wants to use the RAM, which is then cleared out. Thus, if you don't use many other applications between the time you end the first CC session and begin the second, the data that's still in memory is used again instead of loading it from the HDD.


Tue Jul 07, 2009 9:39 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Post Re: Speeding up loading
CrazyMLC wrote:
Well, no, it like CC can just under stand it, it isn't decompressing it as it loads...
Well, I don't know. :/

Doesn't work like that. Programs can't be taught a new language and use it like humans can. The program has to know how to take the language it's being given, translate it into its native language and then use it, no matter what.


Tue Jul 07, 2009 9:42 pm
Profile WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Post Re: Speeding up loading
Advancements in neural networks may render that statement incorrect.

Exception aside, it might be nice to be able to load in files as how they are stored in CC's memory, so it does not have to process the inis.


Tue Jul 07, 2009 9:50 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Post Re: Speeding up loading
Well, the only other way it could be done would be to have a program that takes the inis and condenses them all into binary files for reading ahead of time. That would mean losing a lot of the flexibility of ini mods, though.


Tue Jul 07, 2009 10:02 pm
Profile WWW
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Post Re: Speeding up loading
it would also mean you'd have to compile your mod before testing. i dont want to have to do that every time i want to tweak one value Oo;


Wed Jul 08, 2009 5:47 am
Profile WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Post Re: Speeding up loading
Have it allow both ways.


Wed Jul 08, 2009 5:47 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Post Re: Speeding up loading
Or we could (this is a crazy one) not tell data to change the system, thus taking extra time for a benefit measured in scant seconds.

Honestly, I'd rather he fixed lua implementation and finished the damn game rather than doing something that'd take a while and have little to no benefit.


Wed Jul 08, 2009 6:11 am
Profile
User avatar

Joined: Wed Aug 27, 2008 6:44 am
Posts: 20
Post Re: Speeding up loading
Geti wrote:
it would also mean you'd have to compile your mod before testing. i dont want to have to do that every time i want to tweak one value Oo;


You already ARE compileing you mod every time every time you tweak one value. THAT is the reason it takes so long for slow computers to start up the game

It would be Nice to have a way to complie you mods before running the game to decrease loading times, but i have to agree with Grif and say that there is no point. If you dont like the "long" loading times, then do what i do and watch TV while you mod.


Wed Jul 08, 2009 12:14 pm
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Post Re: Speeding up loading
MooCow13 wrote:
You already ARE compileing you mod every time every time you tweak one value.
...
Really?
I always thought it was just loading C++ objects based on the .ini input...


Wed Jul 08, 2009 12:46 pm
Profile WWW
User avatar

Joined: Wed Aug 27, 2008 6:44 am
Posts: 20
Post Re: Speeding up loading
That could be true for the ini files, but what about Lua scripting, you can't have uncompiled complex scripts, it would cause massive lag.
Compiling just makes sence
-at least to me-


Wed Jul 08, 2009 12:57 pm
Profile
Banned
User avatar

Joined: Tue Feb 27, 2007 4:05 pm
Posts: 2527
Post Re: Speeding up loading
There's nothing to compile, people.

.ini files are not compiled they are interpreted.

The engine is C-based, but your text files are totally arbitrary. The game engine reads the ini files and interprets them into objects and formats that the game engine can understand.

I just love when people start talking about computer-related things they don't understand. Allstone is the only other person who seems to understand this.

Footkerchief wrote:
What exactly happens during INI parsing? If it's just the creation of game objects, can't those objects be "cached" via serialization to avoid the need to parse INIs each time? The game can just check the "last modified" timestamp on each INI to determine whether the cache is obsolete.
This is the only really good idea here, except for the fact that the objects would be destroyed upon program termination--as such removing the point of caching the objects.

Although the potential for using file hashing to check for changes provides interesting opportunities


Wed Jul 08, 2009 1:01 pm
Profile YIM
User avatar

Joined: Sun Oct 19, 2008 5:43 pm
Posts: 92
Post Re: Speeding up loading
ProjektTHOR wrote:
There's nothing to compile, people.
Footkerchief wrote:
What exactly happens during INI parsing? If it's just the creation of game objects, can't those objects be "cached" via serialization to avoid the need to parse INIs each time? The game can just check the "last modified" timestamp on each INI to determine whether the cache is obsolete.
This is the only really good idea here, except for the fact that the objects would be destroyed upon program termination--as such removing the point of caching the objects.


Objects destroyed on program termination? Not if they're serialized to disk. This is a common approach for games that interpret text files to game objects at startup, such as Dwarf Fortress.

ProjektTHOR wrote:
Although the potential for using file hashing to check for changes provides interesting opportunities


All you really need to do is check the modification timestamp. Hashing would be a nice extra to check whether a file modification produced an actual change or not, but it wouldn't be useful very often.

To clarify for everyone else: you would not have to precompile your INIs or anything strange like that. All this means is that the game would store the results of its previous loading process to avoid re-parsing. The only change for the player/modder would be faster loading times.

Grif wrote:
Or we could (this is a crazy one) not tell data to change the system, thus taking extra time for a benefit measured in scant seconds.

Honestly, I'd rather he fixed lua implementation and finished the damn game rather than doing something that'd take a while and have little to no benefit.


Serialization is very easy to implement, and the loading time for a heavily modified game can be several minutes. It's as worthwhile as anything else that makes modders' lives easier.


Wed Jul 08, 2009 5:41 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Post Re: Speeding up loading
ProjektTHOR wrote:
There's nothing to compile, people.

Lua can be compiled to VM bytecode.


Wed Jul 08, 2009 7:22 pm
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 31 posts ]  Go to page Previous  1, 2, 3  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.044s | 14 Queries | GZIP : Off ]