Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Tools

Archive::Tools Archive area for Tools's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 09-16-2004, 11:50 AM
daeken_bb
Discordant
 
Join Date: Mar 2003
Location: Chambersburg, PA
Posts: 469
Default Omens Of War .MOD File Format

Just successfully rendered a .MOD file
I have only tested with placeable objects so far, but this has checked out so far.

Code:
struct Header {
  char magic[4]; // Constant at EQGT
  uint32 version; // Constant at 2.
  uint32 list_length; // This is the total length of the material list that follows
  uint32 object_count; // This is the number of materials in the list (NOT the number of elements)
  uint32 vertex_count; // Number of vertices
  uint32 poly_count; // Polygon count
  uint32 unk; // Unknown.  Constant at 0... number of bones?
};
After the header comes a list of materials and their properties.
Each element is a null-terminated name followed by a null-terminated value.
If the name starts with 'e_' it is a property of the previous material named, otherwise it's naming a new material and its associated base texture. If the base texture named starts with e_, leave the base texture empty and treat this name as its own variable. In the case of having no base texture, simply use the first e_ entry value as the texture, but make sure you also set the e_ entry in your material data.

Now comes the one portion of the file that I have yet to figure out. My theory is that it is a BSP or octree, but I have yet to test it. To skip it, seek to 3 + (vertex_count * 32) + (poly_count * 20) bytes before the end of the file. I'll work on figuring this out when I get a chance, but my knowledge of BSPs and octrees is so limited its not even funny.

Next comes the vertices. You should decode these and store them in a zero-indexed array.

Code:
struct Vertex {
  float x, y, z; // Vertex location
  float i, j, k; // Normals?
  float u, v; // Tex coords, clamped to [0,1]
};
After that comes the triangles. The v0, v1, and v2 fields index the vertex array. The group field indexes the object type list if greater than or equal to zero, else it means the object is invisible I _think_.

Code:
struct Triangle {
  unsigned long v0, v1, v2; // These are vertex indices
  signed long group; // Texture/material group id.
  unsigned long flags; // This seems to flag if you can walk through the polygon or not.
};
Then after that is simply 3 null bytes, then the end of file.

Happy Hacking,
Lord Daeken M. BlackBlade
__________________
Keep me unemployed and working on OpenEQ, PM me about donating

Check out my deviantART page at http://daeken.deviantart.com/
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 09:29 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3