Jump to content

MAP file structure


AlexKimov

Recommended Posts

Glossary 

mn - magic number

DATETIME - date and time 4 bytes

UINT -     integer 4 bytes

UINT16 - 2 bytes

BYTE -   1 byte

FLOAT - real number 4 bytes

char -     chars array

 

Sections

1. MAP Header (file id)

2. MaterialList section

3. GeometryList section

4. PortalList section

5. OccluderList section

6. LightList section

7. VFogList section

8. ObjectList section

9. RoomList section

10. TransitionLineList section

11. PlanningLevelList section

 

File structure

1. File Header

1.1 MAP Header (file id)

HEX "0D 00 00 42 65 67 69 6E 4D 61 70 76 2E 30" | TEXT "....BeginMapv4.0"

UINT chars_count

char BeginMapv4.0_string

1.2 MAP file dates

DATETIME File_create_time

Section size - 21 bytes

1.2 MaterialList section

2.1 Section header

 UINT SectionSize
 UINT MN
 UINT chars_count  
 char Version_string 
 UINT version_number

 UINT chars_count  
 char MaterialList_string

2.2 Materials

UINT Materials_count
//--Array of materials--
UINT SectionSize
UINT MN
UINT chars_count  
char Version_string 
UINT version_number

UINT chars_count  
char MaterialName_string

FLOAT Opacity
FLOAT Faceted
            
FLOAT Red
FLOAT Green
FLOAT Blue
FLOAT mn
      
FLOAT Red
FLOAT Green
FLOAT Blue
FLOAT mn
   
FLOAT Red
FLOAT Green
FLOAT Blue
FLOAT mn

FLOAT SpecularLevel
BYTE 2Sided

2.3 Textures

UINT Textures_count
//--Array of textures--
UINT SectionSize
UINT MN
UINT chars_count  
char Version_string 
UINT version_number

UINT chars_count  
char TextureName_string

BYTE mn
UINT chars_count 
char TextureFileName_string

UINT AdvTransparencyType
UINT Tiled
FLOAT SelfIllumination

 

3. GeometryList section

 UINT SectionSize
 UINT MN

 UINT chars_count  
 char Version_string 
 UINT version_number

 UINT chars_count  
 char GeometryList_string

 UINT RoomsCount;

    //--Array of rooms--
    UINT SectionSize;
    UINT mn;

    UINT chars_count
    char version_string
    UINT number

    UINT StringLength
    char name_string

    UINT SectionSize;
    UINT mn;

    UINT chars_count
    char version_String
    UINT number

    UINT StringLength
    char room_name_string

    BYTE chars_count
    BYTE ModelName       
      UINT Verticie_Count;      
      //--Array of Vertice--     
      if Verticies_Count not 0  
          FLOAT X
          FLOAT Y
          FLOAT Z
       
      UINT Room_Object_Count
      if RoomObjectCount not 0
        BYTE mn
        BYTE isUseDetailedDarkmap;
        BYTE DetailTexture
        UINT MaterialIndex
        UINT Textured
        if isTextured not 0
          UINT TextureIndex
          UINT DetailTextureIndex

        UINT MN;   
        UINT SelfIlluminationMap
        UINT SpecularMap
        UINT BumpMap
        UINT ReflectionMap
        UINT MapCount
  
        UINT FacesCount; 
            //--  Array of face normals  --    
            FLOAT X;
            FLOAT Y;
            FLOAT Z;
            FLOAT mn;

            //-- Array of FaceIndicies
            UINT16 P1
            UINT16 P2
            UINT16 P3            
            //-- Array of TextureIndicies                            
            UINT16 P1
            UINT16 P2
            UINT16 P3
 
        UINT TextureVerticiesCount
        UINT TexturesCount

            //-- Array of Normals
            FLOAT X
            FLOAT Y
            FLOAT Z

            //-- Array of TextureCoordinates
            FLOAT U
            FLOAT V

            //-- Array of something
            FLOAT X
            FLOAT Y
            FLOAT Z
            FLOAT W

.....

 

 

 


 
   4. PortalList section

         
UINT SectionSize;
UINT mn

UINT chars_count
char version_String
UINT number

UINT chars_count
char PortalList_String       

   UINT Count

   //-- Array of portals --         
    UINT SectionSize;
    UINT mn

    UINT chars_count
    char version_String
    UINT number

    UINT StringLength
    char room_name_string

    BYTE chars_count
    BYTE portalName       

      UINT Vertices_Count
        // -- Array of Vertices
        FLOAT x
        FLOAT y
        FLOAT z  
   
      UINT Room_Number      
      UINT Oposite_Room_Number 
      BYTE mn

5. OccluderList section

UINT SectionSize;
UINT mn

UINT chars_count
char version_String
UINT number

UINT StringLength
char OccluderList_string  

...

Edited by AlexKimov
  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Wow! To my shame I have to admit that I had completely overlooked AlexKimov's posts until now. This may require further confirmation, but it looks like this friendly fellow has performed a comprehensive analysis to decipher MAP, QOB, and RSB internal file structures and was nice enough to share his findings with us all. This information essentially opens up ways to reverse-engineer the file formats in question and make many of their integral properties easily editable, either manually via hex editing, or through newly created utilities that could be derived from this data! So, off to the drawing boards we go... :)

Thank you, RussiaGhost, for bringing this to my attention, and thank you very much, AlexKimov, for this impressive work!

  • Like 3
Link to comment
Share on other sites

If it has helped to create an exporter of game formats back into 3d max prices would then nebylo these codes. Maybe it is useful to who knows how to program the utility.

If developers have given us all the full code of the game to be able to add new scripts to change the AI to add new animations, and so it would be very cool. Or at least plugins but

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

The issue with modifying the exporter and gr.exe/.dlls is technically its in violation of EULA and you could never release it. 

Officially.

The source code as far as im aware (I didnt do it.) is accessible. has been since the games launch.

The plugin for max needs some minor updates. Rsb plugin for photoshop requires 32bit photoshop. 

Since I updated to the cloud Ive been only getting 64bit and forced to use the rsb converter which I hate. 

 

On a more serious note! Having access to the source code potentially allows asset modders to attach unseen and unknown code to their models. 

If this is the case and the source code has it...  Flashbangs and smoke may be possible. 

Edited by pz3
  • Like 1
Link to comment
Share on other sites

AFAIK, reverse-engineering a file format to create a new import/export utility doesn't break the EULA. It's exactly what Mike Shell and others have done since the Stone Age with all converters, exporters and other tools etc. Seriously, if Ubisoft dared interfering now, after 15 years of completely neglecting the fan base, I'd say it's time to nuke them from orbit for good.

Where on earth is the GR and IGOR source code available?!? First thing I'd do is lift the compiler ceiling above 64kb to allow for some serious scripting!

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...