View Single Post
  #11  
Old 12-21-2007, 07:43 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by cavedude View Post
As for mobs in the water... there currently is no way for us to tell where water exists in the map.

I spent a couple of days working on the water detection and it's looking good (albeit frustrating
at times working with the WLD data!).

I modified Azone to build the BSP tree from the 0x21 fragment as well as process the 0x22 and 0x29 region
fragments. I then wrote a function which given hard-coded X,Y,Z co-ordinates would walk the BSP tree to
the leaf node those co-ordinates are in and return whether or not the co-ordinates are in a special region (water, lava).

I then transplanted the code into Daeken's Openeq (aka freaku) source so I could fly around
zones and test it better with a visual on-screen indication of whether the code thought I was under water.
It seems to work well (I would say flawlessly, but it needs more testing).

Next step is to optimise it/tidy up the code , mod azone to write out a 'water map' file and then put some code
into EQEmu to make use of it. This could be used for fishing quite easily by projecting forward and down from
the player and testing whether the hypothetical end of the fishing line is under water.

One thing I noticed is that although some zone files have the 'special regions' flagged as either water
or lava, some don't, so I will probably have to make azone accept another parameter telling it whether
to mark the regions as water or lava by default if there is no indication in the WLD file of what the region
is.

I have only tested zones in S3d format so far, so I don't know whether this can be adapted to work with newer zones in EQG format.
Reply With Quote