Difference between revisions of "Talk:WORLD.DAT"

From UFOpaedia
Jump to navigation Jump to search
m (oops I was wrong, BladeFire was right :D)
Line 22: Line 22:
 
:Wonder how it defines the countries since this file only seems to designate terrain types. Maybe indexed all the polygons in this file? Be tough to find it then...
 
:Wonder how it defines the countries since this file only seems to designate terrain types. Maybe indexed all the polygons in this file? Be tough to find it then...
  
Oh, and there's a couple mistakes. The terrain type is just a short or unsigned short (there's only 12 types, though values go from 0-10 and then include 12, skipping 11) and its when QuadData[3]['''0'''] is -1 when it designates a triangle.
+
Oh, and one thing. When QuadData[3]['''0'''] is -1 when it designates a triangle (and actually QuadData[3][1] is 0 as well).
  
 
I'll probably put this info on the page article here soon though. --[[User:Pi Masta|Pi Masta]] 19:42, 5 April 2007 (PDT)
 
I'll probably put this info on the page article here soon though. --[[User:Pi Masta|Pi Masta]] 19:42, 5 April 2007 (PDT)

Revision as of 03:05, 6 April 2007

  // World.Dat = World Map Terrain
  
  typedef struct worlddat
  {
     short         QuadData[4][2]; // Coordinates of quadrilateral
     unsigned long texture;        // Terrain texture of quad
  } WorldDat;
  
  #define MaxQuads 768      // Observed values, XCOM = 666, TFTD = 733

QuadData/8 = realworld latitude and longitude numbers.

if QuadData[3][1] = -1 then the shape is a triangle and that entery is not used. (for you non programers QuadData[0] is the first so [3] is the forth.)

This may not be usefull for the wiki but I once wrote a program to detect what world.dat entry a givin ship was located in and therefor what texture/terrain file used to create the battlescape map. I have the function if anyone is interested in the math.

--BladeFireLight 21:24, 20 January 2007 (PST)


Gah, I just spent the last 20 minutes or so figuring this file out, wish I would have seen this before.
Wonder how it defines the countries since this file only seems to designate terrain types. Maybe indexed all the polygons in this file? Be tough to find it then...

Oh, and one thing. When QuadData[3][0] is -1 when it designates a triangle (and actually QuadData[3][1] is 0 as well).

I'll probably put this info on the page article here soon though. --Pi Masta 19:42, 5 April 2007 (PDT)