Separate models in to their own folders...

Ideas and suggestions for how to improve the Warzone 2100 base game only. Ideas for mods go in Mapping/Modding instead. Read sticky posts first!
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Separate models in to their own folders...

Post by aubergine »

Jorzi just made this for fun:

Image

Wouldn't it be great if there was a super easy way to get that in to the game?

My proposal is to split models and everything relating to them in to separate folders like this:

Code: Select all

models/
   bodies/
   propulsions/
   weapons/
   systems/
   structures/
   features/
   etc/
So the oil drums above would be in: models/features/oilDrums/

Their texture, model, .ini file and anything else related to them would be in that folder.

For backwards compatibility, a lookup table could be created so that when a model is called from one of the old locations the game redirects that request to the new location.

This would make it much easier to add new models, or change existing models. And for n00b modders like me, it would make it easier to find things as the folder names would be named in more logical ways that describes what's in them.

It would mean lots of extra files, with everything being split out in to separate folders, but ultimately the additional flexibility gained would be worth that IMHO.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Emdek
Regular
Regular
Posts: 1329
Joined: 24 Jan 2010, 13:14
Location: Poland

Re: Separate models in to their own folders...

Post by Emdek »

Flexibility is surely good, but assets "readability" would be also greatly improved. :-)
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.


Beware! Mad Qt Evangelist.
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Separate models in to their own folders...

Post by Jorzi »

Hmm what do you suggest for models using the same texpage? All in the same folder?
While I often make individual textures for each model (the only way if you use object space normal maps) another popular and very memory-efficient workflow is to make a central "doodles" texpage, containing vents, panels, barrels & stuff, and then "pick & mix" texture details for models.
ImageImage
-insert deep philosophical statement here-
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: Separate models in to their own folders...

Post by aubergine »

In terms of RAM and FPS, would it make much difference if they are duplicated?

If all the stuff relating to a model was in the folder with it, then you could change the model, texture, animation, etc., without worrying about adverse effects on other models.

For example, it would avoid that issue between the Ultimate Scav AI mod and ArtRev mod where there was some conflict in the textures for the oil resources.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Nameless
Trained
Trained
Posts: 176
Joined: 03 May 2010, 08:25
Location: Space, the Final Frontier

Re: Separate models in to their own folders...

Post by Nameless »

I think this is a great idea. I've taken a look at the source code before and always have had a heck of a time just trying to figure out what directory contains what. In fact something like that should be implemented across the entire source code..
If you're reading this; you're awesome.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: Separate models in to their own folders...

Post by aubergine »

In that case...

Code: Select all

assets/
   bodies/
      body.ini
      <bodyName>/
   propulsions/
      propulsion.ini
      <propulsionName>/
   weapons/
      weapon.ini
      <weaponName>/
   systems/
       ..... etc ......
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
bendib
Regular
Regular
Posts: 1016
Joined: 29 Aug 2010, 05:22
Location: Imeuta

Re: Separate models in to their own folders...

Post by bendib »

There is a noticeable increase in load time ever since images were permanently split back in what was it? RC2?
I think creating more files for the game to process is a bad idea.
Also known as Subsentient.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: Separate models in to their own folders...

Post by aubergine »

Caching easily solves such problems.

C++ has its source code strewn across countless files and folders, yet when it's all compiled properly it runs super fast.

Just the same with assets in wz. Splitting them isn't the bottleneck - that barely affects overall filesize (just a fraction of the size of the image data itself). All it did was highlight a bottleneck, most likely in physfs or image loading code. Investigate root causes before pointing the finger at anything.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO