Wikification of ESX format

Discuss and help improve OpenMW's infrastructure: Website, Forums, issue tracker and everything having to do with keeping the lights on with OpenMW.
lazydev
Posts: 68
Joined: 16 Dec 2012, 14:03

Re: Wikification of ESX format

Post by lazydev » 25 Feb 2013, 21:08

Would be nice to order subrecord types alphabetically...

User avatar
Zini
Posts: 5536
Joined: 06 Aug 2011, 15:16

Re: Wikification of ESX format

Post by Zini » 25 Feb 2013, 21:14

Not really, since the order of sub-records does matter.

But I just noticed that the record type list on the main ESX page is incorrectly titled "Sub-record types". so I assume you actually meant records instead. In this case sorting would be okay.

lazydev
Posts: 68
Joined: 16 Dec 2012, 14:03

Re: Wikification of ESX format

Post by lazydev » 25 Feb 2013, 21:19

Aye, I meaned the things like BSGN, CREA and so on, which are now called sub-records.
Btw, i did the sorting for the currently listed types.

User avatar
Greendogo
Posts: 1382
Joined: 26 Aug 2011, 02:04

Re: Wikification of ESX format

Post by Greendogo » 25 Feb 2013, 21:21

Zini wrote:Not really, since the order of sub-records does matter.
It might be smart to point this out in the description, because that's not at all obvious (to a newb, like me at least).

ezzetabi
Posts: 407
Joined: 03 Feb 2012, 16:52

Re: Wikification of ESX format

Post by ezzetabi » 27 Feb 2013, 11:01

I wanted to add a note about variable format on the esx files, I am fairly sure that integers are little-endian; string can be fixed max-length or variable length in both cases are null-terminated. Is that right?

Secondly, do you know the float variables format? Like in the SKIL record.
The "usual" 4 bytes float is:
1 bit for the sign,
8 bits for the exponent,
23 bits for the mantissa.
Is that true for Morrowind too?

lazydev
Posts: 68
Joined: 16 Dec 2012, 14:03

Re: Wikification of ESX format

Post by lazydev » 27 Feb 2013, 12:44

About integer format, it can be found on this page, but there is nothing about floats...

User avatar
Zini
Posts: 5536
Joined: 06 Aug 2011, 15:16

Re: Wikification of ESX format

Post by Zini » 27 Feb 2013, 13:45

That is a standard IEEE 754 single precision float. Pretty much the only type of 4 byte float format that is still in wide use. As such I don't think it is worth documenting. Everybody knows that IEEE 754 is meant we someone talks about floats.

ezzetabi
Posts: 407
Joined: 03 Feb 2012, 16:52

Re: Wikification of ESX format

Post by ezzetabi » 27 Feb 2013, 14:46

I was just surprised by the fact that imorrowind uses little endianness even in floats, see this piece of morrowind.esm:

Code: Select all

00029060   00 44 41 54  41 03 00 00  00 FF 00 00  53 4B 49 4C  .DATA.......SKIL
00029070   AB 00 00 00  00 00 00 00  00 00 00 00  49 4E 44 58  ............INDX
00029080   04 00 00 00  00 00 00 00  53 4B 44 54  18 00 00 00  ........SKDT....
00029090   03 00 00 00  00 00 00 00  00 00 20 40  00 00 80 3F  .......... @...?
000290A0   00 00 80 3F  00 00 80 3F  44 45 53 43  77 00 00 00  ...?...?DESCw...
000290B0   42 6C 6F 63  6B 20 73 6B  69 6C 6C 20  61 6C 6C 6F  Block skill allo
The line 29090 contains the increment steps: The number is 0x00002040 that read normally would be a strange very small number, instead read as 0x40200000 is 2.5 as expected.

I thought it deserved to be mentioned, but guess not.


EDIT:
Definitely not, also in my system it is the same:

Code: Select all

#include <stdio.h>
int test_float_size[sizeof(float) == 4 ? 1 : -1];
int main() {
    float T = 2.5;
    unsigned char* pT = (unsigned char*) &T;
    fprintf(stdout, "%x %x %x %x\n", pT[0], pT[1], pT[2], pT[3]);
    return 0; }
This little C program outputs 0 0 20 40 as in the morrowind.esm file. Sorry guys, fake alarm.

User avatar
Zini
Posts: 5536
Joined: 06 Aug 2011, 15:16

Re: Wikification of ESX format

Post by Zini » 07 Mar 2013, 14:17

It seems we are about half done with the wikification. From what I see we are still missing:

* LTEX
* NPC_
* ARMO
* CLOT
* REPA
* ACTI
* APPA
* LOCK
* PROB
* INGR
* BOOK
* ALCH
* LEVI
* LEVC
* LAND
* PGRD
* SNDG
* DIAL
* INFO

Also, has anyone given any through to this yet:
And we also could use some way to mark up different sections for different versions, i.e. an obsolete tag for sub-records that are used in MW, but ignored by OpenMW and a version x tag, that indicates that the record is recognised from version x of the file format on.
?

User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Wikification of ESX format

Post by scrawl » 27 Mar 2013, 16:01

Just figured out what NAM9 in CELL is for, also XCHG was missing which turns out to be enchantment charge. Added to wiki and sending pull request.

Post Reply