The advantage of libraries is that we can re-factor the base resources in Transcendence.xml to make them more re-usable. Ideally, I would like to split up Transcendence.xml into three pieces:
1. A set of core types defined in Transcendence.xml. These will be only the minimal set of resources used by all adventures and extensions.
2. A library called "Human Space" (UNID = 0x00100000) which contains the core types in Human Space, including the majority of items, ships, and stations found in the base game (levels 1-10).
3. The Part I adventure, "Stars of the Pilgrim" (UNID = 0x00200000). This adventure uses the Human Space library and adds a topology and other things.
In general, the difference between 2 and 3 is that 3 has all of the content specific to the Domina & Oracus storyline. For example, the storylines of the Heretic Quarantine, the Antarctica, and the Huari home system are properly part of Stars of the Pilgrim. But the Heretic system, the Commonwealth Fleet, and the base Huari are all included in the Human Space library.
Ideally, the Human Space library should define the generic items, ships, and stations that can be used by any adventure, regardless of storyline. A specific adventure (like Stars of the Pilgrim) should then add and/or override types to tell the appropriate story. For example, the Human Space library should include the Commonwealth Fleet, but it should only include generic missions. Stars of the Pilgrim should then be able to add new missions like the Antarctica mission.
I even think we should move all Domina powers to Stars of the Pilgrim, so that people are able to write adventures in which the main character is not a pilgrim. [Of course, there are some game-balance issues to work out: the game gets harder without Sustain.]
One problem with this scheme is that it will take a while to re-factor everything into this new world. For example, some of what I describe above requires a mission system built-in to the game. Moreover, we have to deal with older adventures that were written before libraries were introduced. Thus we need a method for backwards compatibility.
In 1.08c, there will be an additional library:
4. A compatibility library (UNID = 0x00700000) which contains all of the types currently defined in the game. If an adventure or extension does not specify a library, then we automatically assume that it wants to include the compatibility library.
Further in the future, I expect to release other libraries that people can build on:
5. A library called "Ancient Races" which defines all of the alien races, items, ships, and stations found in the galaxy. This library will be the base for Part II. This library will be free when released, but it will not ship with the game. Instead, it will be automatically downloaded from the Multiverse when needed.
6. A library called (for lack of a better name) "Human Space 2". This library will be an expansion for Human Space and will include more ships, items, and stations, plus new enemies. It will be the base of a new adventure centered on Sol. This library will probably not be free--it will be bundled with the Sol adventure and sold through the Multiverse. [Other adventures, including free ones, will be able to use the library, but only if the user already owns it.]
I know there is a lot of info here and some of it is vague, so I've composed a FAQ that may or may not help:
OK, WHAT EXACTLY IS A LIBRARY?
A library is just a new kind of extension. Unlike other extensions, libraries are not loaded automatically. They are only loaded when another adventure or extension asks for it. There is only one copy of a library on the machine at any given time and all other extensions can share it.
THAT SOUNDS LIKE A MODULE. WHAT'S THE DIFFERENCE?
Unlike a module, a library has an UNID, and an extension or adventure loads the library by UNID (instead of by filename). Also, registered libraries can be automatically downloaded from the Multiverse. If an adventure requires a registered library (by UNID) and the library doesn't exist on the machine, then it will be downloaded automatically (this won't work with unregistered libraries, unfortunately, but you can always distribute them like normal extensions).
HOW DO I CREATE MY OWN LIBRARY?
It's basically just like creating an extension. The only difference is that you must use the <TranscendenceLibrary> root element. I've posted some info on the wiki about them: http://wiki.neurohack.com/transcendence ... extensions
HOW DO I USE A LIBRARY?
Just like a module. Add a <Library> element referring to the library by UNID. E.g.,:
Code: Select all
<Library unid="0x00700000"/>
An extension or adventure that does not use libraries should work the same without changes.
If you use a library (with the <Library> element) then (for now) you must include the compatibility library:
Code: Select all
<Library unid="&unidCompatibilityLibrary;"/>
For now, you can't. The ability to create registered libraries is not quite ready, and even then it will start with a closed group of beta test developers.
As always, I'd be happy to hear any feedback or questions.