Legend+of+Spyro+Series

This series includes the following games "A New Beginning" "The Eternal Night" and "Dawn of the Dragon", though only ANB and EN were developed by Krome Studios (http://www.kromestudios.com) and those will be the ones discussed on this page. The model converter on this page applies to both The Eternal Night and A New beginning.



Instructions for using the model convert posted above: 1. Put the folder named 1 in your C directory of you computer. 2. In that folder put in the file called DATA_P2.RKV from your the disc of the PS2 version of A New Beginning or The Eternal Night. 3. Rename that file to 1.RKV 4. Go to the start menu in windows and go to the Command prompt, and type in the following (you must use a lowercase w): C:\1\1.exe -w C:\1\1.bms C:\1\1.rkv C:\1 5. Press enter, and wait for the models to be converted (will take a few mintues). 6. Open the .3ds models in any program that supports the .3ds format (like blender, 3d studio max, Cinema 4D ect)

1.You can use the script called "LOSrkvMarch.bms" to extract all of the files from DATA_P2.RKV 2. You can then use the script called "LOStexConverter.bms" on the TEX files to convert the textures into PS2 formatted TXD files, which can be opened by this program: http://www.thegtaplace.com/downloads/f457-ps2-txd-viewer Be sure you turn the texture filter off for this game.

=BNI Scripts= BNI files contain scripts. Each BNI file has a 0x44 Byte header. The first 32 bytes are the ASCII path to the original source file. The next 4Byte Integer always seems to be 0x00000064 Followed by the 4ByteInteger Number of ScriptDefs Followed by the 4ByteInteger Size of file (not counting the 0x44 Byte header) Followed by the 4ByteInteger To Start of ASCII String Pool (not counting header) Followed by the 4ByteInteger To Start of Higher Level Reference Pool (not counting header) Followed by the 4ByteInteger To Start of Unknown Reference Pool Type #1 (not counting header) Followed by the 4ByteInteger Number of References in the Type #1 Reference Pool Followed by the 4ByteInteger To Start of Unknown Reference Pool Type #2 (not counting header) Followed by the 4ByteInteger Number of References in the Type #2 Reference Pool Here are some experimental scripts that convert the BNI files into ASCII (text) files.

This is the old program use the newer one above. You can use the program below to automatically extract and convert models from The Eternal Night. In order to use it you must have Python3 Installed. (Python2 will not work) You can install Python by going to Python's website: http://python.org/

1. Install Python3 if not already installed 2. To use it, unzip the file called SpyroENmodelextractor.zip 3. Go to the start button in Window's and go to the command prompt (In Windows Vista this is under programs, then Accessories, then Command prompt. 4. Type out the path to where you installed Python3 and where the Python.exe is located. For example it could be  C:\Python3\python.exe  Now add the path to rkv2x.py  Mine for example is in the following:  D:\r\r\rkv2x.py  So you should have typed so far:  C:\Python3\python.exe D:\r\r\rkv2x.py

Now add the path to where your DATA_P2.RKV file is located (Mine is 431 MB, it is on the Eternal Night DVD, you can get it by putting game disc into any computer that can read DVD's)  for example I put mine in the following spot: G:\EternalNight\DATA_P2.RKV

So now you should have typed: C:\Python3\python.exe D:\r\r\rkv2x.py G:\EternalNight\DATA_P2.RKV

Then add the word nosort: So what you should type in is: C:\Python3\python.exe D:\r\r\rkv2x.py G:\EternalNight\DATA_P2.RKV nosort

Press enter and wait for the files to be extracted. It will take a few minutes as there are over 10,000 files

5. Go to the newly created folder in your base directory called RKVextracted Mine for example is C:\users\mike\RKVextracted

Select the MDG files that you want to convert to 3DS format

6. Put them in your base directory for example mine is C:\users\mike

7. Also Put a copy of the blank.3ds that can in the zip, in your base directory for example mine is C:\users\mike

8. Enter the following in Command Prompt: C:\Python3\python.exe D:\r\r\mdg3x.py Press enter

9. The converted models will now be found in your base directory in the newly created folder called MDGextracted for example mine is C:\users\mike\MDGextracted

10. Import the models you want into any 3d editing software that supports the .3DS format which is standard on almost every model editing software. Delete the vertexes found at position 0,0,0 this is needed so that the model shows up correctly.

I use the free program called "Blender": www.blender.org

To import in Blender I start blender then: I go to file, Import, 3d studio (.3ds) I click it and then naviagate to the folder where the models are for example mine is: C:\users\mike\MDGextracted Then I click import.

Feel free to ask if you have any questions or need help on what to type. Below is a fan made model:

Below is the Young Cynder model from the game.

Below is a fan textured oldCynder from A New Beginning.



The Spyro Body texture that is used in the game. The texture is correct, but the color were not converted correctly.

Textures

The Textures come from .tex files, see this guide for converting the 4/8-bit textures in the game.

Here are some textures that were converted (also includes some failed convert attempts).

Models The data for the model files (.MDG) uses sub groups of 3d points, to compute Faces implicitly. Each sub group has at least 3 vertexes and at most 16. All MDG files begin with a header MDG, and can be searched for in cheat engine by typing MDG under a text search. All of the files begin at an offset that ends in zero (aka XXXXXXX0).

MDG Format: The main part of the file should (maybe always) begins at byte 0x28

Mesh section file format of MDG files:

Each mesh is divided into submeshes.

Submeshes in turn are composed of the following components: 00 80 02 6C 1Byte#Vertexes (We will call this "XX") 00 00 00 4ByteUnknownWeight#1 CD CD CD CD 4ByteUnknown 4ByteUnknownWeight#2 4ByteUnknownWeight#3 4ByteUnknownWeight#4 4ByteUnknownWeight#5 4ByteUnknownUnknown 02 80 XX 68 {4ByteFloatVertexTriStrips(X,Y,Z)} The next section may or may not be present for each Tristrip Chunk: (0E 05 00 01 Unknown Data) End of unknown optional section 03 80 XX 6E {4ByteUnknownBytes} Either This Header: 04 80 XX 6D With This Section: {2ByteIntegerUVcoords(U,V)+4ByteUnknowns} OR This Header: 04 80 XX 65 With this Section: {2ByteIntegerUVcoords(U,V)} 05 C0 XX 6E Or This {1ByteColorMappings(Red,Green,Blue)+80} FF FF 00 01 00 00 00 14

The vertexes in each subgroup are connected to each other, one right after each other in triplets to form the faces, eg 0-1-2, 1-2-3, 2-3-4..... Normals are not stored as floating point numbers. MDL files accompany most models with collision detection bounding boxes.

Level Terrain CM files:

[[file:level.blend]]
These are custom files that contain information about hills mountains and other terrain features The first part of the file is made up of XX amount of 14-byte arrays: Ver1, Ver2, Ver3, 8byteUnknown Where to get each face you connect the first, second, and third vertexes in each array together.

The second part of the CM files are the actual vertexes: verX, verY, verZ UKN1 UKN2 UKN3 FF Where the vertexes are 4byte floats and the unknowns (UKN) are bytes.

The games engine: As stated on Krome's website, these titles use the Proprietary Merkury engine. Games using this engine often use vasts amount of text inside the data file (Data_P2.RKV) to define characters attributes such as the following: Enemy Name = Crystal Dragon Max health = 340 Rendering: Fog = 12 Fog load=23.56 And File names: Cynder.mdg Cynder.tex Cynder.anm

Files extensions on the DVD:
.RKV (Archives the larger one has the video's and music/sound and the smaller one contains levels models textures and other game data) .IRX (Files that operate with the PS2's hardware, such as Memory Cards) .ELF (The executable program, for the game)

File extensions inside the main .RKV files:
.RKV Sub-Archives .ang .anm Animations .bbi .bni .BPK (this always appears to be capitalized) .cgr .fnt .FontInfo (The F and I always appears to be capitalized) .inc .mdg 3d Models .mdl Collision Boxes for the corresponding 3d models. .min .pkg .sbk Audio Data (Contents can be extracted with [|PSound]) .sub .tex Bitmap Textures .tmp .txt Text file