Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Reorganize the game folders  (Read 1324 times)

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Reorganize the game folders
« on: May 17, 2010, 03:39:52 am »

The current folder structure has only two top-level folders ('data' and 'raws').  This means that it takes two clicks to get into important folders like data/init, data/save and raw/objects.  Since these folders are accessed much more often than other folders, they should be top-level folders in their own right.

There's also a lot of detritus in the DF main directory.  Exported screenshots and Legends text shouldn't be in the same location as the readme and log files.  compress_bitmaps.bat can easily be modified to operate on the new "exports" directory rather than the main directory.

Here's my proposed reorganization:

  • exports
  • graphics
    • fonts (previously "data/art")
    • creatures (previously "raw/graphics")
  • init
    • macros
  • libs (only applicable on Linux/Mac)
  • licenses (for the SDL license, optipng license, etc.)
  • movies
    • initial_movies
  • raw (previously "raw/objects")
  • save
  • sound
  • text
    • announcement
    • help
    • dipscript
    • speech

Side note: it's great that raw/objects gets copied into the saves now, but is there any reason why this is done for raw/graphics as well?  Most graphics packs are used in conjunction with a specific tileset, so it's weird that the graphics get copied but the tileset doesn't.  Also it makes it difficult and annoying to start using graphics on an existing save.
« Last Edit: May 17, 2010, 04:00:12 am by Footkerchief »
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: Reorganize the game folders
« Reply #1 on: May 17, 2010, 08:09:32 am »

I think it would be trouble to those big mods, which add a lot of new creatures and graphics with them. (E.g Deon's genesis mod)
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Reorganize the game folders
« Reply #2 on: May 17, 2010, 08:38:40 am »

I think it would be trouble to those big mods, which add a lot of new creatures and graphics with them. (E.g Deon's genesis mod)

Prepacked mods already have to get updated for every new version.  On top of that existing trouble, a one-time folder reorganization wouldn't be a big deal.  And besides, that's all the more reason to do this now, rather than 2 years down the road when there are 10x as many mods.  Do you really want to be stuck with the same crappy folder structure forever?
Logged

HebaruSan

  • Bay Watcher
    • View Profile
Re: Reorganize the game folders
« Reply #3 on: May 17, 2010, 09:32:10 am »

The point about mods is a good one. What about trying to increase the separation between the engine and the content?
  • config.txt (priviously init/init.txt, now moved to root and renamed)
  • macros
  • exports
  • lib (also put optipng here)
    • licenses
  • games (if you have multiple folders under this, then you pick one in a new menu when starting or loading a game)
    • mod_name (default "vanilla", other mods could be unpacked alongside)
      • rules (previously "raw/objects")
      • media
        • images (previously data/art and raw/graphics)
        • movies
        • sound
        • text
      • save (rather than copying the raws into the saves, why not move the saves under the mods?)
... and of course, for the Mac we should get only a single bundle "Dwarf Fortress.app" with all of this encapsulated inside of it. :)
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: Reorganize the game folders
« Reply #4 on: May 17, 2010, 10:07:07 am »

I think it would be trouble to those big mods, which add a lot of new creatures and graphics with them. (E.g Deon's genesis mod)

Prepacked mods already have to get updated for every new version.  On top of that existing trouble, a one-time folder reorganization wouldn't be a big deal.  And besides, that's all the more reason to do this now, rather than 2 years down the road when there are 10x as many mods.  Do you really want to be stuck with the same crappy folder structure forever?
True, but your idea does not say what to do with the graphics, copy tilesets? or leave everything? On the other hand if you still need to tinker with init.txt for graphics then it does not matter, that is the mods still change game.
The point about mods is a good one. What about trying to increase the separation between the engine and the content?
  • config.txt (priviously init/init.txt, now moved to root and renamed)
  • macros
  • exports
  • lib (also put optipng here)
    • licenses
  • games (if you have multiple folders under this, then you pick one in a new menu when starting or loading a game)
    • mod_name (default "vanilla", other mods could be unpacked alongside)
      • rules (previously "raw/objects")
      • media
        • images (previously data/art and raw/graphics)
        • movies
        • sound
        • text
      • save (rather than copying the raws into the saves, why not move the saves under the mods?)
... and of course, for the Mac we should get only a single bundle "Dwarf Fortress.app" with all of this encapsulated inside of it. :)
Also interesting proposition, but config is already split into 2. So footkerchief's init\<stuff thats configurable> sounds better.
As for games branch, other then renaming raws to rules sounding a bit strange,  idea is good. It would add tidiness to multimod installations.

Logged

numerobis

  • Bay Watcher
    • View Profile
Re: Reorganize the game folders
« Reply #5 on: May 17, 2010, 09:22:03 pm »

In Unix you would divide user data (/usr), config files (/etc), platform-dependent data (/lib), platform-independent data (/share), and documentation (/doc).  So that's what I have in mind as I propose:
* config
* data (all the graphics sets, intro movies, raws, etc)
* doc
* lib
* world

world had directories region1 and so on.  region1 has current, export, and backup.  backup has directories YYYY-S (S being a number 0-3, so that spring sorts before fall).

data holds default, and a directory for each mod.  Upon starting a game, you can decide on a list of mods to apply; upon loading a moddable file, check in the mod directories, and if not found, look it up in data/default/.  Each mod has the raws, graphics, and sounds it needs.

doc holds licenses and in-game documentation.  You still normally have a README, INSTALL, and LICENSE in the top-level directory; if the instructions are even moderately long (or in HTML), they refer to the versions in doc/
Logged