Pages: [1]
  Print  
Author Topic: Pak load order  (Read 7188 times)
sago007
Posts a lot
*

Cakes 61
Posts: 1637


Open Arena Developer


WWW
« on: February 21, 2012, 11:02:06 am »

I have noticed that the game has problem loading paks in the right order if they are distributed between homepath and basepath. One should especially notice that joining an 0.8.8 server with the 0.8.5 patch located in the homepath will fail even though all files are present.
The engine will load the 0.8.5 patch after the 0.8.8 patch in this case even though it should be loaded before.
This was not noticeable as long as there was only one patch and that was the last file loaded anyway.

In case of problems please check if pak6-patch085.pk3 is in the homepath.

I personally believe files in homepath should take priority over files in basepath but only if they have the same filename. 
Have other noticed this too?
Logged

There are nothing offending in my posts.
Gig
In the year 3000
***

Cakes 49
Posts: 4166


WWW
« Reply #1 on: February 21, 2012, 11:40:54 am »

I have not yet had time to try to connect to any 0.8.8 server.

I'm not completely sure about the sequence the game uses when loading files.
AFAIK, files located in homepath are loaded after files located in basepath... but I thought about this while having two files with the same name (e.g. you have modt.cfg file in both basepath and homepath: homepath wins).... and I don't really know all of the possible cases (e.g. files in pk3 have higher priority than files outside?).

Maybe it loads everything from basepath and only after that starts reading files in homepath. This way, in the situation you mentioned: 0.8.8 patch in basepath (manually installed) and 0.8.5 patch in homepath (probably autodownloaded).... would cause problems!!!!!
And even if you have double 0.8.5 patch (in both basepath and homepath), but 0.8.8 in basepath only... I suppose it would be the same... problem!
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
grey matter
Member


Cakes 8
Posts: 381

>9k


« Reply #2 on: February 21, 2012, 11:50:57 am »

You should read the comments in qcommon/files.c.
Quote from: code/qcommon/files.c
e.g. the qpath "sound/newstuff/test.wav" would be searched for in the following places:

home path + current game's zip files
home path + current game's directory
base path + current game's zip files
base path + current game's directory
cd path + current game's zip files
cd path + current game's directory

home path + base game's zip file
home path + base game's directory
base path + base game's zip file
base path + base game's directory
cd path + base game's zip file
cd path + base game's directory

home path + BASEGAME's zip file
home path + BASEGAME's directory
base path + BASEGAME's zip file
base path + BASEGAME's directory
cd path + BASEGAME's zip file
cd path + BASEGAME's directory

Homepath has priority over basepath (cd path is not of interest for OA). If there are multiple pk3s in one path, containing the same file, the one with its name later in the alphabet has priority (that's why there are so many zzz-*.pk3). Pk3 files have priority over "unzipped" files.
Logged

This space is for rent.
GrosBedo
Member


Cakes 20
Posts: 710


« Reply #3 on: February 21, 2012, 12:01:59 pm »

Maybe it loads everything from basepath and only after that starts reading files in homepath. This way, in the situation you mentioned: 0.8.8 patch in basepath (manually installed) and 0.8.5 patch in homepath (probably autodownloaded).... would cause problems!!!!!
And even if you have double 0.8.5 patch (in both basepath and homepath), but 0.8.8 in basepath only... I suppose it would be
the same... problem!

Yes from my experience I concur with you Gig: all basepath files are loaded first, then homepath files "overwrites" the memory. So your hypothesis is probably the exact scenario that's happening. And that's bad, so there should be an announcement that people needs to delete the autodownloaded patch when updating manually their installation.

Pk3 files have priority over "unzipped" files.

From my experience that's not true: if you unzip a mod's vms in the basepath/vm folder, it takes precedence over any pk3 file (should it be in basepath, I don't know what happens if there's a pk3 in homepath, I guess it would overwrite again?). This is how server-side mods work.
Logged
Gig
In the year 3000
***

Cakes 49
Posts: 4166


WWW
« Reply #4 on: February 21, 2012, 12:04:47 pm »

Yes, I did not mention alphabet order, but I know it.

It seems the alphabet order works only inside a specific folder, and not between folders: from what Sago said, it seems that a pk3 in homepath will always have priority over any pk3 in basepath, not counting their names. Right?

PS: I'm not sure that pk3'd files had priority, but don't want to say something wrong, thus I should make more tests (e.g. creating custom killing sprees files and placing them in different folders).

PPS: I'm not sure I get the difference between
home path + base game's zip file
and
home path + BASEGAME's zip file
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
grey matter
Member


Cakes 8
Posts: 381

>9k


« Reply #5 on: February 21, 2012, 12:19:25 pm »

PPS: I'm not sure I get the difference between
home path + base game's zip file
and
home path + BASEGAME's zip file

Here's more of the quote. Just read the text in code/qcommon/files.c, it precisely answers all of your questions and assumptions.

Quote from: code/qcommon/files.c
Additionaly, we search in several subdirectories:
current game is the current mode
base game is a variable to allow mods based on other mods
(such as baseq3 + missionpack content combination in a mod for instance)
BASEGAME is the hardcoded base game ("baseq3")
"Base game" is controlled by the fs_basegame cvar, which defaults to "" - meaning none.
Logged

This space is for rent.
sago007
Posts a lot
*

Cakes 61
Posts: 1637


Open Arena Developer


WWW
« Reply #6 on: February 21, 2012, 12:23:14 pm »

You should read the comments in qcommon/files.c.
I just did. Thank you.

Pk3 files have priority over "unzipped" files.
From my experience that's not true: if you unzip a mod's vms in the basepath/vm folder, it takes precedence over any pk3 file (should it be in basepath, I don't know what happens if there's a pk3 in homepath, I guess it would overwrite again?). This is how server-side mods work.
I believe qvm and dll-files are special cases. I have noticed that txt, cfg and dat files cannot overwrite the cfg, txt and dat files in the same directory, that is why I use name the files in the pk3-file "maps_dm.cfg.org", so that the user can create a file named "maps_dm.cfg" and not get his files overruled.

I must admit I find this order of loading files rather unpleasant. It makes the filenames completly unreliable and the auto-download system rather annoying.
I can understand why a mod will need to overrule everything but not homepath.
Logged

There are nothing offending in my posts.
GrosBedo
Member


Cakes 20
Posts: 710


« Reply #7 on: February 21, 2012, 12:25:01 pm »

Very informative thread. It would have saved me a lot of testing time in the past!

@sago: I quite agree that the current pak loading order is rather unreliable, it would be touchy to modify it but quite rewarding if it works out well!
Logged
Gig
In the year 3000
***

Cakes 49
Posts: 4166


WWW
« Reply #8 on: February 21, 2012, 01:58:18 pm »

Maybe it would be better to do not "fork" from ioquake3 in pak loading lists.. should we propose something to the ioquake3 team?
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
GrosBedo
Member


Cakes 20
Posts: 710


« Reply #9 on: February 21, 2012, 02:08:18 pm »

Maybe it would be better to do not "fork" from ioquake3 in pak loading lists.. should we propose something to the ioquake3 team?

I don't think they will accept such a big change when their engine is being used in many other games.

And now OA engine is quite enough forked, as long as we keep a log of the changes, there shouldn't be any problem to update to the latest revision of the ioquake3 code. And it seems very unlikely that ioquake3 will ever touch this part of the code, so it should be safe, if done right, to change the pak loading order.

Anyway we have the advantage when modifying the engine to have a complete game behind on which we can test and try the code. This isn't really the case for ioquake3 (do they still test over quake 3 arena assets? this does not sound very adapted...).
Logged
Gig
In the year 3000
***

Cakes 49
Posts: 4166


WWW
« Reply #10 on: February 21, 2012, 05:59:58 pm »

As a first step, I placed a note here:
http://openarena.wikia.com/wiki/Download_Mirrors
It's the "important note" in the first section.
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Pages: [1]
  Print  
 
Jump to: