Last modified 2 years ago Last modified on 01/21/10 20:53:07

File-System-Level

This is a proposal to make the file organization a bit more intuitive/logic.

File Name Conventions

  • Maps should have *.wzmap as extension instead of *.wz for a better distinguishability.
  • Mods should have *.wzmod as extension instead of *.wz for a better distinguishability.

Application Directory

Structure for the game-directory itself. Example places:

  • Win: "C:\Programms\Warzone 2100"
  • Lin: "/opt/games/warzone2100"
  • Mac: "/Applications/Warzone.app/Contents/Resources/data" (Mac .app bundles have their own structure)
\---Application-Dir
    |   dbghelp.dll
    |   oalinst.exe
    |   uninstall.exe
    |   warzone2100.exe
    |   
    +---data
    |   |   mp.wz
    |   |   warzone.wz
    |   |   
    |   +---fmv
    |   |       intro.ogg
    |   |       [...]
    |   |       outro.ogg
    |   |
    |   +---fonts
    |   |       DejaVuSansMono-Bold.ttf
    |   |       DejaVuSansMono.ttf
    |   |       fonts.conf
    |   |       
    |   +---locale
    |   |   +---cs
    |   |   |   \---LC_MESSAGES
    |   |   |           warzone2100.mo
    |   |   |           
    |   |   +---da
    |   |   |   \---LC_MESSAGES
    |   |   |           warzone2100.mo
    |   |   |
    |   |   [...]
    |   |   |
    |   |   +---de
    |   |   |   \---LC_MESSAGES
    |   |   |           warzone2100.mo
    |   |   |           
    |   |   +---en_GB
    |   |   |   \---LC_MESSAGES
    |   |   |           warzone2100.mo
    |   |               
    |   \---music
    |           menu.ogg
    |           music.wpl
    |           track1.ogg
    |           track2.ogg
    |           
    +---docs
    |   |   Authors.txt
    |   |   ChangeLog.txt
    |   |   dbghelp.dll.license.txt
    |   |   License.txt
    |   |   Readme.de.html
    |   |   Readme.de.txt
    |   |   Readme.en.html
    |   |   Readme.en.txt
    |   |   stderr.txt
    |   |   
    |   \---styles
    |           readme.print.css
    |           readme.screen.css
    |
    +---maps
    |       ExtraMap1.wzmap
    |       ExtraMap2.wzmap   
    |
    +---mods
    |   |   mods.cfg
    |   |   
    |   +---global
    |   |   |   aivolution.wzmod
    |   |   |   grim.wzmod
    |   |   |   music_1.0.AUTHORS.txt
    |   |   |   music_1.0.wzmod
    |   |   |   
    |   |   \---autoload
    |   +---multiplayer
    |   |   |   ntw.wzmod
    |   |   |   
    |   |   \---autoload
    |   \---singleplayer
    |       \---autoload
    \---tools

The following changes are made:

  • All game data is moved into the "/data" folder. Music, Fonts, FMVs, Locales are in their own folders, since they aren't updated frequently. This folder is reserved only for "official" files, so no mods should drop something here.
  • Documents and documentation will be found in "/docs" instead of loose in the root directory.
  • The "/mods" folder stays the same, but gets an additional sub folder. Mods are categorized into 3 categories: Global for mods which are for both, single player and multi player. Single- or multi player/skirmish-only mods. The "/mods/<gametype>/autoload" folder is intended for mod packages which should be auto-loaded. However, Giel said that he wants to get rid of these folders, so there is a configuration file "/mods/mods.cfg" where auto loading can be defined or a certain loading order for mod-stacking.
  • new folder called "/tools". A reserved folder for tools (surprise!) which can/will be shipped with future releases. Like an launching app, scripts or a map editor.

Profile / Settings Directory

Structure for the per-user profile directory. Example places:

  • Win: "C:\Users\~USER~\Documents\Warzone 2100 2.1"
  • Lin: "~/.warzone2100"
  • Mac: "~/Library/Application Support/Warzone 2100 2.1"
\---User-Dir
    |   config.cfg
    |   keymap.map
    |   netplay.log
    |   
    +---cache
    |   +---forces
    |   \---players
    |           Player.sta
    |           
    +---maps
    |       ExtraMap1.wzmap
    |       [...]
    |       ExtraMap1.wzmap
    |
    +---mods
    |   |   mods.cfg
    |   |   
    |   +---global
    |   |   \---autoload
    |   +---multiplayer
    |   |   \---autoload
    |   \---singleplayer
    |       \---autoload
    +---music
    +---savegame
    \---screenshots

The following changes are made:

  • The normal "config" file has been renamed to "config.cfg", to make it more clear that this file stores config values. On this way you can also open this file with a double-click on windows system, when a text-editor is bound to the *.cfg extension. (also take a look at the config proposal on this page)
  • The "multiplay" folder has been renamed to "cache". Since AIvolution stores some cache files there, this directory could be used as a caching-directory for all kind of mods. (Whats about customized SQLite databases as well, when the props-files are replaced?)
  • "/multiplay/custommaps" has been moved and renamed to "/maps". A simple folder where people can drop custom map files. It could also be used as storage for automatic downloaded maps. (from other players, for example)
  • Added a "/mods" folder, which has exactly the same structure like in the application dir. This should be used for user- and automatically downloaded mods. In the case of conflicts, the mods in the user directory should always override the global mods.
  • "/screendumps" becomes "/screenshots", which should simply a little bit more familiar to users.

Specifications

All following examples use the JSON-Syntax. This would mean that we would need to implement a JSON parser and writer. Since there are quite some small-footprint libraries out there,...

config.cfg

Proposal for a more intuitive config file:

// This is the configuration file for Warzone 2100.
// Please don't edit it manually, unless you know what you do! 

{
    // Video Settings.
    "Video": {
        "width":            800,
        "height":           600,
        "bpp":              32,
        "framerate":        60,
        "gamma":            22,
        "showfps":          false,
        "texturesize":      128,
        "shake":            false,
        "visfog":           true,
        "fog":              true,
        "fullscreen":       true,
        "shadows":          true,
        "colouredcursor":   false,
        "sequences":        false,
        "subtitles":        true
    }, 

    // Audio Settings.
    "Audio": {
        "sound":            true,
        "playaudiocds":     true,
        "voicevol":         100,
        "fxvol":            100,
        "cdvol":            50,
    }  

    // Network Settings.
    "Network": {
        "lobbyserver":      [   "lobby.wz2100.net",
                                "lobby2.wz2100.net", // Fallback 1
                                "lobby3.wz2100.net"  // Fallback 2
                            ],
        "lobbyport":        9997,
        "gameport":         9999
    } 

    // Game Settings.
    "Game": {
        "gamename":         "My Game",
        "playername":       "Commander",
        "debugmode":        false
    }
}

mods.cfg

Disclaimer: This is a very raw idea for a mods.cfg configuration file. It feels quite too complex and there is probably room to optimize or simplify this, while achieving the same functionality. Meta-Mods should probably extend these on their own.

// This file handles all mod loading.
// Please don't edit it manually, unless you know what you do!
// For more information about this file tale a look into:
//
//   <path to game>/docs/en/mods.html

{
    // Mods for single- & multi player.
    "global": {
       
       // These mods will be automatically loaded every time!
       "autoload": [
           "music.wzmod",
           "highrestextures.wzmod",
           "morepolymodels.wzmod"
       ],
       
       // Optional mods. 
       // You can load mod(-stacks) by providing the commandline switch 
       // "--mod=config1[,config2,...]" or (might be later implemented) in the
       // in-game mod selector.
       //
       // Format: 
       //      "<configname>": [<mods to load>]
       //
       "config": {
           "sampleconfig1":      ["example.wzmod"],
           "sampleconfig2":      ["mod1.wzmod", "mod2.wzmod", "mod3.wzmod"]
       }
    }

    // Single player mods.
    "singleplayer": {
        
       // These mods will be automatically loaded every time!
       "autoload": [
           "rebalance.wzmod"
       ],
       
       // Optional mods. 
       // You can load mod(-stacks) by providing the commandline switch 
       // "--mod=config1[,config2,...]" or (might be later implemented) in the
       // in-game mod selector.
       //
       // Format: 
       //      "<configname>": [<mods to load>]
       //
       "config": {
           "sampleconfig1":      ["example.wzmod"],
           "sampleconfig2":      ["mod1.wzmod", "mod2.wzmod", "mod3.wzmod"]
       }
    }

    // Multi player mods.
    "multiplayer":{
        
       // These mods will be automatically loaded every time!
       "autoload": [
           "aivolution.wzmod"
       ],
       
       // Optional mods. 
       // You can load mod(-stacks) by providing the commandline switch 
       // "--mod=config1[,config2,...]" or (might be later implemented) in the
       // in-game mod selector.
       //
       // Format: 
       //      "<configname>": [<mods to load>]
       //
       "config": {
           "sampleconfig1":      ["example.wzmod"],
           "sampleconfig2":      ["mod1.wzmod", "mod2.wzmod", "mod3.wzmod"]
       }
    }
}

modinfo.cfg

This is/should be a file, each mod delivers inside the root of their *.wzmod package. This file contains basic information about the mod:

// ----------------------------------------
// Modinfo for: My Example Mod
// ----------------------------------------
{
    // General mod informarion.
    "modname":         "My Example Mod",
    "description":     "Does nothing",
    "version":         "1.0",
    "creationdate":    "2008-11-24",
    "last-change":     "2008-11-25",

    // Dependencies; change this, if it is not valid JSON syntax
    // (although we probably won't use it anyway)
    // A mod could depend on a map as well (such as a certain script that
    // defines special areas which fit to that map only); it could depend
    // on certain other things as well which could be added later
    //
    // For a dependency it is necessary for the mod/map/thing to have a
    // "modname", so that recognition of a mod is not dependent on the file name
    "mod-dependency": {
                       "modname": "Harakiri",
                       "version": ">=2.7"
                       "version": "=<3.2"
                      },
    "mod-dependency": {
                       "modname": "Big Heads",
                       "version": ">=0.0.5"
                      },
    "map-dependency": {
                       "mapname": "Big Game Hunters Ultimate",
                       "version": "2008.11.04"
                      },

    // Author information. Possibility 1.
    "authors":         [   
                           "Me <me at example dot com>", 
                           "Friend <friend at example dot com>", 
                       ],
    "url":             "http://www.example.com/",

    // Author information. Possibility 2.
    "author":          "Kreuvf <kreuvf at example dot com>",
    "author":          "another Kreuvf <kreuvf at another example dot com>",
    "co-author":       "Fvuerk <fvuerk at elpmaxe dot com>",
    "acknowledgment":  "Nice guy for his excellent textures",
    "acknowledgment":  "The community of example.com for their feedback",
    "url":             "http://www.example.com/", 

    // Licence information. Possibility 1:
    "license":         "GPL",
    "license-note":    "Image x.png and y.png are (c) by OtherFriend and not GPL",
    "creationdate":    "2008-11-24",

    // Licence information. Possibility 2:
    // Would render license-note unneccessary
    "license": {
                {
                 "part":        "AI scripts",
                 "license":     "GPLv3+",
                 "license-url": "http://www.gnu.org/licenses/gpl-3.0.html"
                },
                {
                 "part":        "textures",
                 "license":     "CC-by-sa 3.0",
                 "license-url": "http://creativecommons.org/licenses/by-sa/3.0/"
                },
                {
                 "part":        "GUI icons",
                 "license":     "Public domain"
                },
                {
                 "part":        "superheavy_melon_gun.pie",
                 "license":     "GPLv2",
                 "license-url": "http://www.gnu.org/licenses/gpl-2.0.html"
                }
    "publication-date":"2008-11-29",

    // Minimum required Warzone version. You have 2 types for this field:
    //   1)  "<major>.<minor>" 
    //             Mod requires warzone version >= <major>.<minor>
    //   2)  "r1234" 
    //             Mod required warzone revision/build >= r1234
    // Perhaps for showing people in-game as "version suggested by the mod-author(s)"
    "gameversion":     "2.1",

    // Define where the mod is available. (true, true = global)
    // To prevent user mistakes.
    "singleplayer":    true,
    "multiplayer":     false

    }
}

mapinfo.cfg

This is/should be a file, each map delivers inside the root of their *.wzmap package. This file contains basic information about the map:

// ----------------------------------------
// Mapinfo for: My Example Map
// ----------------------------------------
{
    // General mod informarion.
    "mapname":         "My Example Map",
    "description":     "Makes fun!",
    "version":         "1.0",

    // Author information.
    "authors":         [   
                           "Me <me at example dot com>", 
                           "Friend <friend at example dot com>", 
                       ],
    "url":             "http://example.com/",

    // Licence information.
    "license":         "GPL"
    "license-note":    "",
    "creationdate":    "2008-11-24",

    // Minimum required Warzone version. You have 2 types for this field:
    //   1)  "<major>.<minor>" 
    //             Mod requires warzone version >= <major>.<minor>
    //   2)  "r1234" 
    //             Mod required warzone revision/build >= r1234
    "gameversion":     "2.1",

    // Some additional information.
    "maxplayers":      8 
}

Colour support

This is a proposal for adding basic colour support, so those colours are shown ingame in description texts or whatever. These specification may also be used in-game for different colours of a text-message (e. g. in AI scripts, to have a light red "HELP!!!!").

Requirements

  • Make sure to not allow extreme colours
  • Make sure to not allow colours that are unreadable as they are very similar to the background colour
  • Colours should be easy to use

Proposal

This proposal is based on the following principles:

  • Allow certain colours only
  • Colours are mixable
  • The actual colour depends on the GUI theme
    • brighter, if background is dark
    • darker, if background is bright
  • " will need to be escaped, use the escape character for " to escape colour tags

It is assumed that \ is the escape character. Furthermore it is assumed that there are no grayish themes (=background and text colour are quite similar).

Colours

\r for red, \g for green, \b for blue. \R for intensive red, \G for intensive green, \B for intensive blue.

A colour is intensive if it can be read better with the current theme.

The actual colours shown on screen depend on the GUI theme. <!-- Sorry for the abusive use of divs and spans -->

Dark theme: \r for red
\r\g for yellow
\r\b for purple
\g for green
\g\b for teal
\b for blue
\r\g\b for gray

\R for intensive red
\R\G for intensive yellow
\R\B for intensive purple
\G for intensive green
\G\B for intensive teal
\B for intensive blue
\R\G\B for almost white

Light theme: \r for red
\r\g for yellow
\r\b for purple
\g for green
\g\b for teal
\b for blue
\r\g\b for gray

\R for intensive red
\R\G for intensive yellow
\R\B for intensive purple
\G for intensive green
\G\B for intensive teal
\B for intensive blue
\R\G\B for almost black

It should be noted that a specific colour has a different appearance on another background.

Additionally to the combinations here, intensive and non-intensive colours should be mixable. This should give users enough possible colours, while preserving the aforementioned requirements. As the unmentioned combinations could add some weird results as well, it is recommended to check every colour before implementing them (almost black for example does not behave as expected, it's an exception!).