Author Topic: New map file system  (Read 2004 times)

0 Members and 1 Guest are viewing this topic.

Offline Unknown Target

  • Get off my lawn!
  • 212
  • Push.Pull?
New map file system
Here's an idea: why not make FS2 look into a specific sub-directory for maps? Let's say the model name is Fighter. FS2 would look at that, and say, ok, let's go to /data/maps/Fighter to find the maps for this ship.

I was just thinking about this, because for one fighter I have about 8 maps, including shine and glow maps. It'd be a lot easier to organize if each ship had it's own specific directory.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
how about add a mat chunk to the pof format. so ships would need only 1 file for graphics. it would store all the glowpoints and textures for that ship. it would increase redundant data though, some ships share glowpoints/tiles. that might be too much of a hassel to code and just one more thing to do when modding. but i think freespace would load everything regaurdless of that folder you put things in.  i really dont have any problem with the current schema. i take it a step further and make sure ships and textures use the same name for easy referance. i think volition's art guys didnt bother to name the ships, just giving them a number and save the names for the story department, but for a modder thats confusing.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
you could just throw everything into a VP file, includeing the model and a tbm.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Unknown Target

  • Get off my lawn!
  • 212
  • Push.Pull?
I'm not going to compile a VP every time I need to test a model out :)

Plus, it'd be easier for single ship mods to be added in.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: New map file system
Quote
Originally posted by Unknown Target
I was just thinking about this, because for one fighter I have about 8 maps, including shine and glow maps. It'd be a lot easier to organize if each ship had it's own specific directory.

I think that I've commented on this before but I don't feel like searching for the other post.  Basically this is possible but I seriously doubt it will ever happen.  The reason: it's too slow.  We can't cache files like that since they are an unknown element in CFILE.  That means the storing files that way in a VP is a big issue so those files couldn't be distributed in a VP like that and fixing CFILE to allow for it is really more trouble than it's worth.  Doing a mass search and cache of all files in all directories (cause it's not going to stop with this one request) will cause numerous problems, not the least of which will be slower searching for every file open and slower startup.  If we avoid the mess of a cache then every model that get's opened would have to hit the HD and physically search either before or after the current physical search and the cache search.  If it comes after the cache search then most of the general slowdown could probably be avoided but anything stored in those directories would be really slow to find.

If it's a choice between doing that and having people just organize their stuff in VPs then I say go with VPs.  That's what I do and it works well.  Dumping stuff in data/ just causes problems even if data/ is in a mod dir.  Weening people off of the stupid notion of dumping everything in data/ is the better thing to do.  Having stuff go into a ship specific map dir does little more than add to that problem.

Now that I've said that, it's easy to do what you want to do... use a moddir.  Create a folder named whatever your model is and put all of the fighter specific files in there.  If it's the first moddir that you specify then the IBX file(s) will be generated and in the right place already.  When you're done creating the model and have all of the bugs worked out then just make a VP of that moddir and you've got the POF, the maps, any other artwork, tbm (if it's needed), and a ready to use IBX file in one nice and neat package.  Zip up the VP file and put it up for download thereby saving everyone that tries it out the hassle of dealing with multiple files and slow loading since the IBX file is already included.  This should make it pretty simple for you and really simple for everyone else.

If you are making many models for a mod then the same basic thing applies, just without the distribution part.  You can create a moddir for various ship types so that you don't have a ton of folders for each model but can still organize things a bit better and make finding what you want quicker and easier.  You've also got a much better group of organized files this way which should make packaging considerably easier.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
8 maps for a single flighter is a lot. :wtf:

There are a couple problems with individual fighter files (beyond what taylor said). First, it would require updating the bitmap system, because it'd be real easy to accidentally make a file called "hull" for one fighter, then do the same for another; in the current system, only the first one would be used as freespace would assume they were the same file. To fix this, a new or a special bitmap loading function would have to be created.

Second, it becomes more complex for textures on multiple fighters. You end up with half the textures in the fighter dir, and any common textures in the maps directory.

It should be possible to just follow some sort of naming convention with your fighters - ie losna, losna-glow, losna-shine, etc etc. Then just sort the directory by name and all the files for different ships will be grouped together.
-C

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
thats what i do, i use strict naming conventions to give my mod dir the apearance of sanity.

i think by 8 maps he means 2 textures both with glow, shine, and env maps if your not using any tieling its fairly easy to combine multiple maps in truespace with a little free plugin called uvtweak. select by material (i forget the command) and then use uv tweak to translate the uv map for those faces exactly 1 square over. then you double the texture area to cover both uv areas (you will need to translate the texture area a half a square to fit perfectly), then in a paint program combnt the two textures so there side by side. if your using a format that requires square textures then id sugest streatching the image vertically to make it square. if your using a format like dds it will still save you some texture memory. you can also combine 4 textures into one this way. i remember i used this on one of my ships but i cant remember which one.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Unknown Target

  • Get off my lawn!
  • 212
  • Push.Pull?
8 textures - cockpit, hull, pilot, canopy, and cockpit-shine, hull-shine, pilot-shine, cockpit-glow, hull-glow, pilot-glow. That's...ten textures. And it's not like I'm abnormally using them: I just don't have the space on one texture to fit everything, so I have to use multiples.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
thats where you jack up the texture resolution. use a 2048^2 if you have to thats like using 16 512^2 maps. its not anything you cant do wth ts6's uv editor. max has a similar editor too, if that dont work, just use lith. uv space is scalable. its possible to model a 10000 poly ship so that no polygon shares uv space with another.
« Last Edit: May 17, 2005, 01:05:05 pm by 766 »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

  

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Unless Bobb has changed something with the texturing system, that means your fighter will take 11 texture passes instead of 3. (AFAIK) Or in other words, it's taking ~4 times as long to render as it could be.
-C