Libraries

Freeform discussion about anything related to modding Transcendence.
Post Reply
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Starting in 1.08c (coming soon) I've added the concept of "extension libraries". A library is very much like a module except that it is included by reference instead of by value. Libraries should become the main method for sharing design types across extensions.

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"/>
I DON'T NEED LIBRARIES. DO I NEED TO DO ANYTHING DIFFERENT?

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;"/>
HOW DO I CREATE A REGISTERED LIBRARY THAT DOWNLOADS AUTOMATICALLY?

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.
User avatar
Ttech
Fleet Admiral
Fleet Admiral
Posts: 2767
Joined: Tue Nov 06, 2007 12:03 am
Location: Traveling in the TARDIS
Contact:

This is great news! This is going to make things much better in the long run!
How long will the compatibility layer stay in place because there are at least several adventures that have been user created that won't get updated quickly.
Are you planning on using Libaries specifically for adventures or will there be other libraries such as dsf or large item packs that contain items usable by the player and other ships in the game? Will there be folder structures in the Extenions folder being added such as Mods, Libraries, Modules? It seems to be it will be the same, but still curious nonetheless.
Sorry for all the questions but this is great news! I'd be interested in testing out the automatic libraries if you needed.
Image
Image
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

How long will the compatibility layer stay in place because there are at least several adventures that have been user created that won't get updated quickly.

The compatibility layer will exist indefinitely for all extensions that mark themselves as version 1.1 and below.

Are you planning on using Libaries specifically for adventures or will there be other libraries such as dsf or large item packs that contain items usable by the player and other ships in the game?

Not sure yet. I think the main purpose of adventures (for me) is to add new reusable content. But DSF makes perfect sense as a library.

Will there be folder structures in the Extenions folder being added such as Mods, Libraries, Modules? It seems to be it will be the same, but still curious nonetheless.

Not for now; I think the current best-practice of using a folder for an extension should continue with libraries. One advantage of libraries is that you don't need to know where they live--since the caller refers to the library by UNID, the user can put the library anywhere in the Extensions folder.
ronelm2000
Miner
Miner
Posts: 41
Joined: Mon Mar 19, 2012 1:14 am

Just a question:

Say you MIGHT want your library to be dependent on / references only a certain version of another library. Is it possible?

How will libraries & extensions handle several overrides for a specific UNID? (Possible example: Commonwealth Militia Star Carrier) Which goes first: libraries or extensions? (Honestly, I haven't tested enough extensions to even know which will override which)

Also, can I use different libraries but use same UNIDs for its members? (Say I have a BasicLibrary (0x3AAA9001) that uses 0x3AAAA??? and AdvLibrary(0x3AAA9002) that also uses 0x3AAA???) If so, it may be possible to actually conserve UNID use right? (Of course it's virtually impossible to use all UNIDs assigned to a single player right?... Right? :? )
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

ronelm2000 wrote:Just a question:
Say you MIGHT want your library to be dependent on / references only a certain version of another library. Is it possible?

Yes. A library also has a "release" number and you can reference UNID+release number. If you don't reference a release number you get the latest. Saved games always refer to the release number that they were created with. [Though that feature will come in 1.09]

How will libraries & extensions handle several overrides for a specific UNID? (Possible example: Commonwealth Militia Star Carrier) Which goes first: libraries or extensions? (Honestly, I haven't tested enough extensions to even know which will override which)

Libraries go first and extensions override. In general, an extension C that refers to library B can override library B. And if library B refers to library A, then it can override library A.

Also, can I use different libraries but use same UNIDs for its members? (Say I have a BasicLibrary (0x3AAA9001) that uses 0x3AAAA??? and AdvLibrary(0x3AAA9002) that also uses 0x3AAA???) If so, it may be possible to actually conserve UNID use right? (Of course it's virtually impossible to use all UNIDs assigned to a single player right?... Right? :? )

Yes, you can. But if an extension ever uses both libraries then the result is undefined. [I.e., one type will override the other, but there is no guarantee of which.]
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5421
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

Is there going to be a UNID space reserved for libraries?

From what it sounds like, Core libraries are 0x0, ? is in 0x1-0x9, Registered extensions are 0xA-0xC, Unregistered extensions are 0xD-0xE, Dynamic UNIDs are 0xF

Maybe Unregistered libraries could take 0xC, and Registered libraries take 0x9 or something like that. Perhaps all paid content could be 0x8 or something separate like that, so you'd know right off the bat when you are referencing paid libraries.
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'Varalyn 'nonBinary))
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB | 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 8700, 32GB, 6500XT
Workstations & Render machines: Threadripper 3990X, 128GB, 6900XT | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970 | R7 3700X, 32GB, A6000
Gaming Systems: R9 5950X, 32GB, 6700XT
Office Systems: Xeon 5318Y, 256GB, A4000
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
Post Reply