Difference between revisions of "Content Management"

From Ultronomicon
Jump to navigation Jump to search
Line 93: Line 93:
 
* Keep user settings in a resource-map. ''Completed in Revision 1916.''
 
* Keep user settings in a resource-map. ''Completed in Revision 1916.''
 
* Keep key configuration in a resource-map. ''Completed in Revision 2705.''
 
* Keep key configuration in a resource-map. ''Completed in Revision 2705.''
* Keep Melee configuration in a resource-map.
 
 
* Allow loads of resource files to be placed into isolated submaps to keep values separated. ''Completed in Revision 3105.''
 
* Allow loads of resource files to be placed into isolated submaps to keep values separated. ''Completed in Revision 3105.''
 
* Allow saves to strip some or all of the common prefix to save only the "submap" component. ''Completed in Revision 3105.''
 
* Allow saves to strip some or all of the common prefix to save only the "submap" component. ''Completed in Revision 3105.''
* Merge all three into the main resource map.
+
* Merge user settings and key configuration into the main resource map, eliminating the now-redundant mapres.c routines. ''Completed in Revision 3108.''
** Right now, user and key data use mapres.c to handle all this. Those routines should be folded into getres.
+
* Turn melee data (teams, current situation) into resource maps like the other two.
** Old user configurations will be all of type UNKNOWNRES and be located in the wrong place. This will make auto-migration possible.
 
  
 
===Other work===
 
===Other work===

Revision as of 00:49, 16 February 2009

This page is guaranteed to be spoiler free. It is safe for you to read this page even if you have not completed playing The Ur-Quan Masters. Links you follow from this page do not share this guarantee unless they also include this text.


Introduction

The game still uses a virtual file system as before: see Content Management for information on this. However, starting in 0.6.4, the "layering" effect of the directory system is no longer used to index files.

Hey, my remixes don't work!

UQM 0.6.4 (SVN revision 2869) changed addon pack mechanics incompatibly. Your remix zips are still OK, but you will need to perform these steps:

  • Move the addons directory from content/packages to content/
  • Download the appropriate .rmp files from http://sc2.sourceforge.net/remix-rmp/ and put them in the same directory as the remix zips.
  • Ensure that the remix directory is, in fact, addons/remix.

Detailed description

Still needs to be done.

A typical layout

On Windows

A typical The Ur-Quan Masters installation on Windows looks like this:

C:\Program Files\The Ur-Quan Masters\uqm.exe
C:\Program Files\The Ur-Quan Masters\content\packages\uqm-0.6.0-content.uqm
C:\Program Files\The Ur-Quan Masters\content\packages\uqm-0.6.0-3domusic.uqm
C:\Program Files\The Ur-Quan Masters\content\packages\uqm-0.6.0-voice.uqm
C:\Program Files\The Ur-Quan Masters\content\addons\remix\uqm-remix-pack1.zip
C:\Program Files\The Ur-Quan Masters\content\addons\remix\uqm-remix-pack2.zip
C:\Program Files\The Ur-Quan Masters\content\addons\remix\uqm-remix-pack3.zip
C:\Program Files\The Ur-Quan Masters\content\addons\remix\remix1.rmp
C:\Program Files\The Ur-Quan Masters\content\addons\remix\remix2.rmp
C:\Program Files\The Ur-Quan Masters\content\addons\remix\remix3.rmp
C:\Program Files\The Ur-Quan Masters\content\version

On Mac OS X

A typical The Ur-Quan Masters installation on Mac OS X looks like this:

/Applications/The Ur-Quan Masters/Contents/PkgInfo
/Applications/The Ur-Quan Masters/Contents/Info.plist
/Applications/The Ur-Quan Masters/Contents/Frameworks/Ogg.framework
/Applications/The Ur-Quan Masters/Contents/Frameworks/SDL_image.framework
/Applications/The Ur-Quan Masters/Contents/Frameworks/SDL.framework
/Applications/The Ur-Quan Masters/Contents/Frameworks/Vorbis.framework
/Applications/The Ur-Quan Masters/Contents/MacOS/The Ur-Quan Masters
/Applications/The Ur-Quan Masters/Contents/Resources/The Ur-Quan Masters.icns
/Applications/The Ur-Quan Masters/Contents/Resources/content/version
/Applications/The Ur-Quan Masters/Contents/Resources/content/packages/uqm-0.6.0-content.uqm
/Applications/The Ur-Quan Masters/Contents/Resources/content/packages/uqm-0.6.0-voice.uqm
/Applications/The Ur-Quan Masters/Contents/Resources/content/addons/remix/uqm-remix-pack1.zip
/Applications/The Ur-Quan Masters/Contents/Resources/content/addons/remix/uqm-remix-pack1.zip
/Applications/The Ur-Quan Masters/Contents/Resources/content/addons/remix/uqm-remix-pack1.zip
/Applications/The Ur-Quan Masters/Contents/Resources/content/addons/remix/remix1.rmp
/Applications/The Ur-Quan Masters/Contents/Resources/content/addons/remix/remix2.rmp
/Applications/The Ur-Quan Masters/Contents/Resources/content/addons/remix/remix3.rmp

On Linux

A typical The Ur-Quan Masters installation on Linux looks like this:

/usr/local/bin/uqm        (wrapper script)
/usr/local/lib/uqm/uqm    (the actual executable)
/usr/local/share/uqm/content/packages/uqm-0.6.0-content.uqm
/usr/local/share/uqm/content/packages/uqm-0.6.0-3domusic.uqm
/usr/local/share/uqm/content/packages/uqm-0.6.0-voice.uqm
/usr/local/share/uqm/content/addons/remix/uqm-remix-pack1.zip
/usr/local/share/uqm/content/addons/remix/uqm-remix-pack2.zip
/usr/local/share/uqm/content/addons/remix/uqm-remix-pack3.zip
/usr/local/share/uqm/content/addons/remix/remix1.rmp
/usr/local/share/uqm/content/addons/remix/remix2.rmp
/usr/local/share/uqm/content/addons/remix/remix3.rmp
/usr/local/share/uqm/content/version

Current Development Status

The resource system (and thus the content directory) are in flux as the development team works on implementing a new resource system. This should remove a lot of the more brittle components from the legacy system and make addons easier to add, and mods to the source easier to make work. Detailed goals, milestones, and comments are in this section.

Top-Level Roadmap

This actually may migrate over time as we see what works and what doesn't, but it will at least mark where we've been and where we think we're going.

  1. Implement a generic string-based key-to-value system for doing resource lookups. Completed in Revision 1916.
  2. Drop requirement on binary resource indices by translating them to text. Completed in Revision 2003.
  3. Replace the integer-based resource system with string-based key mappings that are easier to extend. Completed in Revision 2963.
  4. Rework resource types to allow for a wider range of resources. Migrate all 3DO content into standalone addon packs. Completed in Revision 3104.
  5. Uniform API for all uses of the resource-map system, merging about six redundant subsystems into one. In progress.

Current goals

It's now feasible to start moving hardcoded data like the starship constants and the starmap itself into .rmp files. It's not clear how much of this is wise for 0.7.0 itself, but we should probably do at least a little to gather interest.

  • Keep user settings in a resource-map. Completed in Revision 1916.
  • Keep key configuration in a resource-map. Completed in Revision 2705.
  • Allow loads of resource files to be placed into isolated submaps to keep values separated. Completed in Revision 3105.
  • Allow saves to strip some or all of the common prefix to save only the "submap" component. Completed in Revision 3105.
  • Merge user settings and key configuration into the main resource map, eliminating the now-redundant mapres.c routines. Completed in Revision 3108.
  • Turn melee data (teams, current situation) into resource maps like the other two.

Other work

This is a bit more nebulous since we haven't advanced far enough to see what's a good idea and what isn't.

  • Massive, cathartic violence against the content directory structure, ending in convenient subprojects. Incomplete, but started in revision 2870.
  • Let .rmp files include other ones to make uqm.rmp less monolithic. This could also be used to automatically include addon packs (such as, say, a Cyrillic Font Pack) if necessary.
    • At the moment we just load all .rmp files in any given directory. This may be good enough.
  • The hack to make the remix packs work is kind of ugly. A more permanent fix would allow special variable expansion to map to wherever uio elected to put it, giving each extension its own space for files. Best of all would be a magic variable for "The home of the extension named X." Implementing this would give us full namespaces and namespace imports.
    • It's only ugly under the surface, though, and will only affect mod writers, and that rather minimally. The users just shove packages blindly into content/addons.
  • Online configuration of which extensions to use.
  • It would be nice to have an offline application for building extensions.
  • A more "self-aware" resource system should give us a much better handle on the remaining resource-related bugs.
  • Can we leverage this for improving save game formats?
  • Planet data is aliased in #defines and structure initializers when it should probably be in the resource map.
  • Ship data is *not* aliased, requiring a bunch of structure initializers that probably (though less probably than in the planet data case) should be name normalized.