PDA

View Full Version : OpenZone and .map files for eqemu


unicorn97211
06-01-2006, 04:44 PM
Using the latest version of OpenZone i drew up my own zone. Then I ran into the problem i've read many posts about from windows users which is how to generate the los .map files for eqemu so that you can cast etc in the custom zone. I have the source for azone and as posted many times it throws a fit when you attempt to compile with VC++ 2003.NET. So I have some questions at this point...

Has anyone created a tool that will generate .map files from .s3d or .wld files that runs on windows? if so where can I d/l it?

Are the formulas in azone accurate enough that if I use them to write a windows version it will output .map files compatable with 7.x servers?

Can I just get a buddy with a linux box to compile azone for me then use that exe on windows?

Does the current azone source even work when compiled and executed on a linux box?

From a programmers viewpoint OpenZone is a very impressive peice of work, I was just surprised to find that for a windows user the OpenZone output is pretty much unusable since OpenZone doesn't export the critical .map file along with the s3d's.

I searched the forums high and low to no avail, feel free to point out any posts that contain info on how to generate .map files on a windows box.

Even some documentation on the .map file format would be great! I really don't feel like reverse engineering map.cpp if I have to write my own export function.

fathernitwit
06-02-2006, 02:05 AM
the map format is very simple if you look at map.h, it is a quadtree designed such that the on-disk format of the map is the same as the in-memory format of the map, to speed map loading.

The problem was not getting it to build on windows, but getting it to run on windows. I dont remember if it was the loader or the quad tree, but one of the two was crashing.

Your best bet is to either find a linux friend to do the conversion for you, or download vmware and setup linux for yourself. I guess its possible that cygwin might work, but I really doubt it.

unicorn97211
06-10-2006, 03:24 AM
I looked into the vmware option and found a windows app called coLinux. Got it running fairly easily then used it to run make on azone. After that I was successfully able to run azone on an OpenZone s3d I made! I copied the resulting map file over to my eqemu maps directory and bingo, I couldn't cast on a mob until it poked it's head over the top of the hill. I was able to cast through a building however. azone reported no errors while doing it's thing. I'll play with it some more so I can ask some educated questions about it's limitations.

I haven't seen any information about things like how thick a wall needs to be in order to prevent casting through it etc. Any links would be appreciated :)

Shadow-Wolf
06-10-2006, 11:22 AM
If im remembering correctly you shouldn't of had to do that that at all, I think OpenZone can export its own .map files.

Windcatcher
06-10-2006, 02:14 PM
This is an unfortunate consequence of two projects using the same extension for different files. The .MAP files that OpenZone currently exports are for use with the Admin Tool (and ShowEQ, though why anyone would want to do that is beyond me). Those .MAP files are intended to let you see an overhead graphical map of the zone so you can more easily place spawns when using the Admin Tool.

The .MAP files being discussed in this thread are for use by the server and have to do with LOS (line-of-sight) calculations. OpenZone doesn't currently export those.

I've decided to bite the bullet and try to add EQEmu .MAP file support (the LOS kind). When you export to .S3D, OpenZone 7.0 will also create a <zone>.map file in an \eqemu_maps subfolder (the archive will have this folder in it). The map.cpp and map.h files that come with EQEmu aren't all that well documented, but I think I understand what's going on now that I've spent a few hours looking at them.

One question I have is how small should the granularity be when making the .MAP files: what is the cutoff size when making nodes? I don't have the source to the original program that made them so I'm guessing here.

GeorgeS
06-11-2006, 02:32 PM
Thanks for this WC - this will help with spawns and LOS tremendously

GeorgeS

fathernitwit
06-18-2006, 09:44 AM
wind,

The full source of azone is in cvs, the interesting file is:
http://eqemulator.cvs.sourceforge.net/eqemulator/EQEmuCVS/utils/azone/azone.cpp?revision=1.4&view=markup

Overall it is just a simple quadtree, ignoring the Z axis, the only hard part is doing triangle-cube intersection, but im sure you have code for that somewhere, or can port the C++. The on-disk format was meant to match to in-memory format on the reader side, so azone does a bit of extra work to get everything packed together correctly.

There are a few different criteria from stopping the quadtree split, mainly number of triangles remaining in the box, or the size of the box. I also added an information-gain style termination criteria such that if splitting the box does not actually split up the polygons further, then we stop, but I cant remember if this did any good or not. All in all, the stopping criteria are rather arbitrary, changing them around or adding more should not hurt anything.

let me know if you have any issues.