Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Zarax on November 10, 2002, 04:01:29 am
-
Hello, what about setting up a more effective way of managing tables?
With the current configuration the increased limits cause slow downs on older PCs and they haven't really a good performance.
The problem can be solved in a rather simple way, wich would allow to have nearly no table limits and ensure faster loading times.
My proposal it's simple:
Instead of having 2 or 3 huge text files, any entry should be a separate file.
The standard tables will override this setting.
The only problematic issue would be that FRED and FS would have different ways of loading the tables.
This way, FRED will look for every file in the tables folder (this may slow it down a bit), but FS will look ONLY at the specified files that are involved in a mission (wich at best are 25% of ingame models), loading only the needed stuff.
It's a fair load of work, but it would solve the problem of having increased table limits.
-
Independence War 2 uses, essentially, a seperate table file for each weapon, projectile and ship. It preloads a few generic ship types when you launch into space, and then loads the table/mesh information for the ship types for the current misison, this way, you don't have any huge tables, nor do you ever load data for things you don't use.
-
I don't know how easy this kind of support would be and what would be the easiest way to implement this.
But I have an idea:
ships.tbl, weapons.tbl and other .tbl files are still used.
But now you can add references to another .tbl file.
So basically you can use just single ships.tbl and weapons.tbl file or you can add references into them to point to another file.
If you use references to another file, you don't need to use full pathnames. Instead FS2 looks for "ships" and "weapons" folders that are under "tables" folder.
In \data\tables\ships folder there are files like ulysses.tbl, orion.tbl, ravana.tbl and so on.
In \data\tables\weapons there are files like subach.tbl, prometheus-r.tbl, cyclops.tbl and so on.
If you use similar references in other main tbl files, FS2 looks for appropriate folder and file. For example, if you use references in music.tbl, FS2 looks for \data\tables\music\brief1.tbl for example.
Normal ships.tbl entry would look like this:
$Name: EA Aurora
$Short name: Aurora
$Species: Terran
+Type: XSTR("Heavy fighter", -1)
+Maneuverability: XSTR("Excellent", -1)
+Armor: XSTR("Light", -1)
+Manufacturer: XSTR("Mitchell-Hyundyne", -1)
+Description: XSTR("Short Range Defense Operations" , -1)
$end_multi_text
.
.
.
.
.
But if you want to use references, it could look like this:
$Name: EA Aurora
$Ref: aurora.tbl
Rest are in \data\ships\aurora.tbl file.
Regular table entry will take around 72-75 lines of space, this alternative method would take only two lines for every ship and weapon. References are in ships.tbl and weapons.tbl file, but if particular ship is not used in a mission, FS2 will skip it entirely. It will look for names that a mission uses.
If particular mission has only Orion, Ulysses, Medusa, Dragon, Demon and Lilith class ships. FS2 searches only for those references and loads them up.
Of course it can already do that. I really don't know anything about current FS2 mission loading methods.