Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: ARSPR on March 30, 2006, 11:25:17 am

Title: Question about data folder and vp priorities
Post by: ARSPR on March 30, 2006, 11:25:17 am
I always have doubts about which file has the highest priority and will override the rest.

So imagine I've got a mod in MOD_Folder which also has a mod.ini with:

Code: [Select]
[multimod]
primarylist  = ,PRI-A,PRI-B,PRI-C;
secondrylist = ,SEC-A,SEC-B,SEC-C;

And in every folder I've got vps and of course data folders with a FILE.POF (or whatever) inside. (I'm going to name all the vps "aaa.vp" and "aab.vp" to show its alphabetical order).

Can anyone check if the following priority list is OK or post the correct priority list?

01. Freespace2\data
02. Freespace2\aaa.vp
03. Freespace2\aab.vp
04. PRI-A\data
05. PRI-A\aaa.vp
06. PRI-A\aab.vp
07. PRI-B in the same way
08. PRI-C in the same way
09. MOD_folder in the same way
10. SEC-A and then SEC-B and then SEC-C

OTOH. Is it needed the comma at the begining of "Primarylist  = ,PRI-A,PRI-B,PRI-C" as it happens with "Secondrylist" because of the launcher bug?
Title: Re: Question about data folder and vp priorities
Post by: taylor on March 30, 2006, 12:32:56 pm
In each case there is a recursive seach for files, then a recursive search for VPs (so I'm not listing each one even though it applies to all).

1) PRI-A  (files then VPs)
2) PRI-B  (files then VPs)
3) PRI-C  (files then VPs)
4) SEC-A  (files then VPs)
5) SEC-B  (files then VPs)
6) SEC-C  (files then VPs)
7) Freespace2  (files then VPs)

VPs are found in alphabetical, then directory/alphabetical order, so:

aaa.vp
bbb.vp
data/aaa.vp
data/bbb.vp

Files are found in the following order and file type/extension filter per root (same basic rule applies to directories and files inside of VPs):
/   (mve, avi, mpg)
/data  (cfg, log, txt)
/data/maps   (pcx, ani, eff, tga, jpg, dds)
/data/text   (txt, net)
/data/missions   (fs2, fc2, ntl, ssv)
/data/models  (pof)
/data/tables  (tbl, tbm)
/data/sounds  (wav, ogg)
/data/sounds/8b22k  (wav, ogg)
/data/sounds/16b11k   (wav, ogg)
/data/voice  ()
/data/voice/briefing  (wav, ogg)
/data/voice/command_briefings  (wav, ogg)
/data/voice/debriefing  (wav, ogg)
/data/voice/personas  (wav, ogg)
/data/voice/special  (wav, ogg)
/data/voice/training  (wav, ogg)
/data/music  (wav, ogg)
/data/movies  (mve, msb, avi, mpg)
/data/interface  (pcx, ani, tga)
/data/fonts  (vf)
/data/effects  (ani, eff, pcx, neb, tga, jpg, dds)
/data/hud  (ani, pcx, tga)
/data/players  ()
/data/players/images (pcx)
/data/cache  (clr, tmp, ibx)
/data/players  (hcf)
/data/players/single  (pl2, cs2, plr, csg, css)
/data/players/multi  (plr)
/data/multidata  (pcx, fs2)
/data/config  (cfg)
/data/players/squads  (pcx)
/data/demos  (fsd)
/data/cbanims  (ani)
/data/intelanims  (ani)
/data/scripts  (lua, lc)

If a file exists in one of those directories and doesn't end in an entension listed in the filter list for the directory then the file will just be ignored, even if that file would otherwise be supported.

Builds running on Linux and OS X will also search a special $(HOME) directory for all files and VPs first.   On Linux this directory is $(HOME)/.fs2_open and on OS X it's $(HOME)/Library/FS2_Open.
Title: Re: Question about data folder and vp priorities
Post by: ARSPR on March 30, 2006, 01:09:48 pm
Just to be sure:

A. MOD_Folder would be 3.5) in your list, (you forgot it). Am I right?

B. The searching order would be:

1.1 PRI-A files
1.2 PRI-A vps
2.1 PRI-B files
2.2 PRI-B vps (and so on)

NOT
1 to 7) PRI-A to Freespace2 files
8 to 14) PRI-A to Freespace2 vps


Taylor, thank you for your patience with FS2-illiterates like myself.  (You've got my answered-questions record, chased not far by Karajorma) :yes:
Title: Re: Question about data folder and vp priorities
Post by: taylor on March 30, 2006, 01:19:09 pm
re: A.  Oops, I did forget that one. :)  But yes you are right, it would be 3.5 in the list.

re: B.  Correct.
Title: Re: Question about data folder and vp priorities
Post by: karajorma on March 30, 2006, 01:34:32 pm
The primary list option isn't hugely useful. I think I've used it once and I can't even remember why :D

Still if you ever do have a reason why you'd need to override a mod folder it's there :)
Title: Re: Question about data folder and vp priorities
Post by: Wanderer on March 30, 2006, 01:55:38 pm
Hmm.. i just tried different mod.ini files

mod.ini
Code: [Select]
[multimod]
primarylist  = ,ModB;
secondrylist = ,Mediavps;

Resulted in following debug spew:
Code: [Select]
  -mod ,ModB, ModA, ,Mediavps
Building file index...
Searching root 'd:\games\freespace2\'
Searching root pack 'd:\games\freespace2\root_fs2.vp'
Searching root pack 'd:\games\freespace2\smarty_fs2.vp'
...
So according to the fs.log it didnt even check any of the mod directories

mod.ini
Code: [Select]
[multimod]
primarylist  = ;
secondrylist = ,ModB,Mediavps;

Resulted in following debug spew:
Code: [Select]
  -mod ModA, ,ModB,Mediavps
Building file index...
Searching root 'd:\games\freespace2\ModA\'
Searching root 'd:\games\freespace2\ \'
Searching root 'd:\games\freespace2\ModB\'
Searching root 'd:\games\freespace2\Mediavps\'
Searching root pack 'd:\games\freespace2\Mediavps\mv_adveffects.vp'
...
Searching root 'd:\games\freespace2\'
Searching root pack 'd:\games\freespace2\root_fs2.vp'
...
So IMHO something isnt working as it should with the primarylist..
Title: Re: Question about data folder and vp priorities
Post by: ARSPR on March 30, 2006, 02:10:18 pm

So IMHO something isnt working as it should with the primarylist..


As I've asked in my first post, maybe the initial comma isn't needed in Primarylist  :confused:
Title: Re: Question about data folder and vp priorities
Post by: Wanderer on March 30, 2006, 02:34:16 pm
OK.. then another attempt

mod.ini
Code: [Select]
[multimod]
primarylist  = ModB;
secondrylist = ,Mediavps;

Resulting debug spew:
Code: [Select]
   -mod ModB, ModA, ,Mediavps
Building file index...
Searching root 'd:\games\freespace2\ModB\'
Searching root 'd:\games\freespace2\ ModA\'
Searching root 'd:\games\freespace2\ \'
Searching root 'd:\games\freespace2\Mediavps\'
Searching root pack 'd:\games\freespace2\Mediavps\mv_adveffects.vp'
...
Searching root 'd:\games\freespace2\'
Searching root pack 'd:\games\freespace2\root_fs2.vp'
...
so it inserted an empty space before the mod directorys (ModA) name...  And didnt load anything from the selected mod directory (ModA)

Its a lot easier to just insert directories in correct order to the command line than to fool around with that mod.ini anyway.
Title: Re: Question about data folder and vp priorities
Post by: ARSPR on March 31, 2006, 10:56:10 am
The issue with the added space is also covered within this thread http://www.hard-light.net/forums/index.php/topic,39089.0.html. And I also posted the initial comma bug in Mantis (758) which it is related to it, (I notice now).

As it is said in the other thread, the problem is that launcher 5.3 inserts blank spaces when joining folder lists:
     PrimaryList + Extra Wrong Space + ActualModFolder + Extra Wrong Space + SecondaryList

At least in Windows, you can add a comma before SecondaryList (,MediaVPs,LightspeedNebulas;) so you will make FS2 looking in a folder called " " before secondary mods. As this folder usually never exists, FS2 SCP works fine. But in other OS this can cause other behaviours.

With PrimaryList space, it will cause that FS2 SCP will look in " ActualModFolder" rather than in "ActualModFolder". This folder will not exist and then you are not loading the mod itself.

I think the best way to solve this is making FS2_open.exe ignoring starting/ending spaces in the folder names. (But I know NOTHING AT ALL about coding ...)



PS to SCP guys, mainly Phreak: Mantis 758 has been closed as the available launcher code is for 6.0. Would you like me to add this info to it anyway?
Title: Re: Question about data folder and vp priorities
Post by: taylor on March 31, 2006, 11:06:30 am
I think the best way to solve this is making FS2_open.exe ignoring starting/ending spaces in the folder names. (But I know NOTHING AT ALL about coding ...)
This isn't an FSO bug though, it's a launcher bug.  An easily fixed launcher bug to boot, but no one gives a damn about it (the current launcher that is).  I'm working on a new launcher and it won't have this problem, plus fix all of the other bugs currently associated with the launcher.  I don't know that any coders actually care about the current launcher enough to spend time on it considering that the new launcher should be available in about month.
Title: Re: Question about data folder and vp priorities
Post by: karajorma on March 31, 2006, 11:41:06 am
That's the main reason I haven't taken a better look at it. By the time we had distributed launcher 5.4 to everyone it would be time to start with your launcher.

Speaking of which when are we going to have that chat about how the replacement for mod.ini will work?
Title: Re: Question about data folder and vp priorities
Post by: taylor on March 31, 2006, 12:00:22 pm
Speaking of which when are we going to have that chat about how the replacement for mod.ini will work?
Probably not until I get the first test version out to you.  I'm already on my third UI for the thing, second total rewrite, not to mention several features I've totally redesigned since I started coding, so I don't want get into details until I'm happier with where it's headed.  This is a rather large rewrite of functionality of the launcher and requires numerous game code changes as well.  I really just want to wait until I hack some more on the profiles feature.  That should be significantly better than the current mod.ini files, but I haven't exactly nailed down what all I plan to do with it at first.  I want to get it done as far as my basic thoughts go, then go over the changes and redesign anything that we can't all agree on.

Depending on how busy I am otherwise, considering that I'm not going to be bug fixing for a few months, I should have something for you by the end of April (or sooner).
Title: Re: Question about data folder and vp priorities
Post by: ARSPR on April 05, 2006, 02:02:52 am
In each case there is a recursive seach for files, then a recursive search for VPs (so I'm not listing each one even though it applies to all).

1) PRI-A  (files then VPs)
2) PRI-B  (files then VPs)
3) PRI-C  (files then VPs)
4) SEC-A  (files then VPs)
5) SEC-B  (files then VPs)
6) SEC-C  (files then VPs)
7) Freespace2  (files then VPs)

VPs are found in alphabetical, then directory/alphabetical order, so:
.....


I think all this info should be in Wiki. But where can I put it?
Title: Re: Question about data folder and vp priorities
Post by: ARSPR on April 19, 2006, 01:58:41 am
I've decided not been lazy and I've made the try myself. So I'm editing my previous post:

Hi, I'm trying to start learning about modding, tables and so on. And I've got another question about priorities.

Now, I know the priority about reading files. So I know which "weapons.tbl" will be read the first, and would be in fact the Applied One. But if you have two thousand xxx-wep.tbm files, how are their changes applied over the tbl? Do FS_open apply the same priority order?

I ask this because in this way the last changes, (and because of it final changes), would be from the last read file, so "FS2Folder > Last_vp > Last_tbm" would be in fact the most important one.

Or am I totally wrong, and priority order is reversed for tbm files to make the first read one the most important one?

Thank you


And as everyone could suppose I was totally wrong.  :no:  So to any new begining modder as lazy as myself:

1. Modular (.tbm) files are applied in reversed order so the highest priority changes go to PRI-A\data\tables\aaaaa-wep.tbl

2. Nevertheless, all the tables are also applied. You'll get less priority tbm settings if they're not overriden by highest priority ones.