Record Store: Difference between revisions

From OpenMW Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ The world model is split in two parts: An immutable part and a mutable part. The record store represents the immutable part. The esm/esp file format contains a list of...")
 
(Corrected outdated info)
 
(2 intermediate revisions by one other user not shown)
Line 3: Line 3:


The esm/esp file format contains a list of records, where each record is composed of a type ID and additional data. Our world model does mirror this structure.
The esm/esp file format contains a list of records, where each record is composed of a type ID and additional data. Our world model does mirror this structure.
Individual records can by identified by a string ID, a numeric ID, a coordinate-pair or not at all (depending on the type).


For each type of record we have a struct in the ESM namespace: http://zinnschlag.github.com/openmw/namespaceESM.html
For each type of record we have a struct in the ESM namespace: http://zinnschlag.github.com/openmw/namespaceESM.html


For each type of record we also have a separate list (there are some variations depending on the record type):
For each type of record we also have a list of these records, instantiating the MWWorld::Store template. There are some variations depending on the record type.


* http://zinnschlag.github.com/openmw/structESMS_1_1RecListT.html
The class implementing the record store is named ESMStore (in the MWWorld namespace). The ESMStore merges records from multiple ESM/ESP files into a single store. The merging implementation can vary depending on the record type.
* http://zinnschlag.github.com/openmw/structESMS_1_1LTexList.html
* http://zinnschlag.github.com/openmw/structESMS_1_1LandList.html
* http://zinnschlag.github.com/openmw/structESMS_1_1CellList.html
* http://zinnschlag.github.com/openmw/structESMS_1_1ScriptListT.html
* http://zinnschlag.github.com/openmw/structESMS_1_1IndexListT.html


The record store is composed of these lists.
A const reference to the current ESMStore can be obtained from the MWBase::World class instance.


The class implementing the record store is named ESMStore (in the ESMS namespace), which is partially a misnomer. Currently this class is filled with the records from only one esm. But later multiple esms and esps will be merged into it.
==Dynamic Records==


A const reference to the current ESMStore can be obtained from the MWWorld::World class instance.
Some types of records can be generated dynamically during gameplay and then accessed via the record store like any other record.


There are some record types that are handled differently:
Examples:
* custom classes
* custom enchantments
* potions created by alchemy
* modifications to levelled lists via the console


==Cell==
==Cell==


A cell record consists of some header-type data fields and a collection of references. Of these only the header data is stored in the record store. The collection of references is mutable and as such needs to be treated separately.
A [[Cells|cell]] record consists of some header-type data fields and a collection of references. Of these only the header data is stored in the record store. The collection of references is mutable and as such needs to be treated separately.


==Info==
==Info==


==Land==
For every practical purpose each info record is a sub-records of a dialogue record. The OpenMW info storage implementation reflects this structure. The esm/esp format does not.

Latest revision as of 21:57, 15 July 2015

The world model is split in two parts: An immutable part and a mutable part. The record store represents the immutable part.

The esm/esp file format contains a list of records, where each record is composed of a type ID and additional data. Our world model does mirror this structure.

Individual records can by identified by a string ID, a numeric ID, a coordinate-pair or not at all (depending on the type).

For each type of record we have a struct in the ESM namespace: http://zinnschlag.github.com/openmw/namespaceESM.html

For each type of record we also have a list of these records, instantiating the MWWorld::Store template. There are some variations depending on the record type.

The class implementing the record store is named ESMStore (in the MWWorld namespace). The ESMStore merges records from multiple ESM/ESP files into a single store. The merging implementation can vary depending on the record type.

A const reference to the current ESMStore can be obtained from the MWBase::World class instance.

Dynamic Records

Some types of records can be generated dynamically during gameplay and then accessed via the record store like any other record.

Examples:

  • custom classes
  • custom enchantments
  • potions created by alchemy
  • modifications to levelled lists via the console

Cell

A cell record consists of some header-type data fields and a collection of references. Of these only the header data is stored in the record store. The collection of references is mutable and as such needs to be treated separately.

Info

For every practical purpose each info record is a sub-records of a dialogue record. The OpenMW info storage implementation reflects this structure. The esm/esp format does not.