OK,
well I am going to make the assumption that the LOS crap in the zone server works for now... so the issue is getting map files from the zones...
I have used DZoneConverter to get a .wld file (which is strangely in the old file format, not the luclin file format)... I have a wld file reader reading that guy in... now to produce a map. (I decided to go for wld->map, and skip an intermediate format, unless somebody tells me a reason otherwise.)
I have taken a look at the map format, and it appears to be a simple quad tree.
It startes with two unsigned long counters of vertexes and faces.
Then, theres an array of vertexes, followed by an array of faces (which use the vertexes), followed by a recursive quad tree structure, dividing x and y.
structures for vertex and face (from map.h)
Code:
struct VERTEX {
unsigned long order;
float x, y, z;
};
struct FACE {
unsigned long a, b, c; //vertexs
float nx, ny, nz, nd;
};
the quad tree starts with:
Code:
struct nodeHeader {
float minx;
float miny;
float maxx;
float maxy;
unsigned long nfaces;
};
if nfaces is not 0, then it is immediately followed by an array of unsigned longs representing offsets into the faces array which are faces in that node of the quad tree.
if nfaces is 0, then it is a branch node. The next byte contains basically a bit-based counter of which nodes that quadtree node is split into. And it is then followed by recursive instances of nodes, starting with a node header.
So, the file format isnt going to be that bad... I will code up a quad tree tomorrow. It isnt going to be an 'optimal' quad tree... but it shouldent be too difficult to get done. I just hope DZoneConverter is actually spitting up the correct .wld file...