EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   OpenEQ::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=609)
-   -   Looking for more zone format information (https://www.eqemulator.org/forums/showthread.php?t=16088)

jbb 09-28-2004 07:14 PM

Looking for more zone format information
 
I'm trying to draw placeable objects over the basic terrain mesh.
I can load and draw the models from a EQG file without too much problem, and I've figured out from the ZON resource in the EQG file where to draw them, but I can't seen to work out which model to draw at each point.

Has anyone worked this out yet?

daeken_bb 09-30-2004 11:18 AM

I worked on it a bit and still haven't figured it out... I'll let you know if I figure anything out.

jbb 09-30-2004 06:48 PM

I found some more information on .ZON files.
I have to go to work now so this is just a quick post, I'll write it up properly later.

There is a 28byte/7 long header.
7 longs (a, b, c, d, e, f, g)
a is a magic number
b is always 1
c seems to be the length of the name table
d seems to be the number of 4 byte entries in an unidentified table follwoing the names
e seems to be the number of placable objects in the ZON file

Next is a model name table which consists of a whole lot of null terminated strings in the form



name, name, name, name.MOD
Where the names are one or more internal names for the model file name which follows.

Then there is a section which I've not identified.
And then the objects which are a big array of

struct Object
{
long id; // Not sure how to use this
long model_name;
float x, y, z; // World coordinates of object
float r1, r2, r2; // Rotations about the 3 axis
float scale; // Multiplier of the scale of the object
}

If the 28 byte header is longs a, b, c, d, e, f, g etc. you can find this table by going to location c + d * 4 + 28 in the file. I think "c" is the size of the string table and "d" is the number of 4 byte entries which preceed the objects in the ZON file. "e" is the number of entries in the object table.

The model_name long in the objects is an offset into the string table, so add 28 to the start of the ZON file and use it as an offset from there. This is a pointer into the name table at the start to the "name" of the model to put in the world at that point.


After the objects is another table, something to do with lighting I think but I've not really looked at that yet.

My wireframe render in another posting seems to work with the objects where I expect so I think this is basically right.

daeken_bb 09-30-2004 10:27 PM

Wow, nice work man :)

I'll work on implimenting placeable objects into OpenEQ tonight :D

DeletedUser 10-01-2004 07:22 AM

As you can see in the screenshot it's partly working.
The palm trees look about right. The other trees have semi-transparent textures which I don't yet render properly so probably would be right. On the other hand there is a strange blob above the towers which looks very wrong.

I guess I'll have to load up EQ live and go take a look what's really there and try to figure out what is wrong.

http://img80.exs.cx/img80/5641/render10.th.jpg

jbb 10-01-2004 08:11 AM

Also, TER files and MOD files seem to have the same format. The TER file is just the model for the basic terrain. In all the ZON files I've seen the TER file is the first entry in the objects list, so you don't have to load the terrain and the objects separately. Although the x, y, z coordinates of the objects seem to be relative to those of the first entry for the TER file. I don't know if that is just a special case or if there is some way to tell that the location of an object is relative to another one rather than absolute coordinates.

jbb 10-01-2004 08:42 AM

I think I'm getting there.
Anguish looks a lot more impressive with the objects :-

http://img75.exs.cx/img75/2013/render11.th.jpg

Although looking at these statues by the door I'm missing some polygons still.

http://img75.exs.cx/img75/605/render12.th.jpg

But the door object fits in it's hole perfectly here so the positioning and scaling looks right anyway

http://img75.exs.cx/img75/4962/render13.th.jpg

daeken_bb 10-01-2004 08:56 AM

Actually, I've seen the TER file be listed far into the ZON file. I don't remember which zone it was, but it has happened. Might be something to look into.


All times are GMT -4. The time now is 06:23 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.