Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 12-31-2007, 10:59 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by narcberry View Post
I don't think that BSP trees are the best data model for lava and water ...
Well, my thinking is that the client has to traverse the BSP tree when it renders the graphics, checks for collision detecion, Line of sight to mobs etc, so it is no extra overhead 'for the client' to check for water/lava, since it has already traversed the tree to the leaf node for those purposes.

Now, maybe/quite possibly the SOE *servers* have a different, more efficient mechanism for water detection, perhaps 3D Matrices as you suggest, but we can't know, (unless any ex-SOE programmer's who are reading this would like to add something )

Last edited by Derision; 12-31-2007 at 07:02 PM..
Reply With Quote
  #2  
Old 12-31-2007, 11:11 AM
narcberry
Sarnak
 
Join Date: Mar 2005
Location: Idaho, USA
Posts: 94
Default

Quote:
Originally Posted by Derision View Post
Well, my thinking is that the client has to traverse the BSP tree when it renders the graphics, checks for collision detecion, Line of sight to mobs etc, so it is no extra overhead 'for the client' to check for water/lava, since it has already traversed the tree to the leaf node for those purposes.

That makes sense.
__________________
Thanks for answering my questions.
My Website
Reply With Quote
  #3  
Old 01-10-2008, 09:53 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I PM'ed FNW details of the reworked patch for this along the lines he asked for, but I don't think he's been around for the last week, so I will post it here as well in case anyone
else wants to test the updated version.

----------------------------------------

I reworked the Water Detection patch. Diffs against the 1070 source are at:

http://www.rama.demon.co.uk/Reworked-water.patch

It affects these files

Code:
entwisd@rama ~/EQEmu-0.7.0-1070 $ patch -p0 < /tmp/Reworked-water.patch
patching file ./common/ruletypes.h
patching file ./utils/azone/Makefile
patching file ./utils/azone/awater.cpp
patching file ./utils/azone/awater.h
patching file ./utils/azone/wld.c
patching file ./utils/azone/wld.h
patching file ./zone/command.cpp
patching file ./zone/forage.cpp
patching file ./zone/makefile.common
patching file ./zone/mob.cpp
patching file ./zone/mob.h
patching file ./zone/watermap.cpp
patching file ./zone/watermap.h
patching file ./zone/waypoints.cpp
patching file ./zone/zone.cpp
patching file ./zone/zone.h
And adds these rules:

Code:
+RULE_BOOL ( Watermap, CheckWaypointsInWaterWhenLoading, false ) // Does not apply BestZ as waypoints are loaded if they are in water
+RULE_BOOL ( Watermap, CheckForWaterAtWaypoints, false) 		// Check if a mob has moved into/out of water when at waypoints and sets flymode
+RULE_BOOL ( Watermap, CheckForWaterWhenMoving, false)		// Checks if a mob has moved into/out of water each time it's loc is recalculated
+RULE_BOOL ( Watermap, CheckForWaterOnSendTo, false)		// Checks if a mob has moved into/out of water on SendTo
+RULE_BOOL ( Watermap, CheckForWaterWhenFishing, false)		// Only lets a player fish near water (if a water map exists for the zone)
+RULE_REAL ( Watermap, FishingRodLength, 30)			// How far in front of player water must be for fishing to work
+RULE_REAL ( Watermap, FishingLineLength, 40)			// If water is more than this far below the player, it is considered too far to fish
I thought about adding a test in zone.cpp so that if none of the rules where true, it wouldn't
try and load the water map, but I didn't do that.

Originally I only had the water detection in waypoints.cpp in CalcPosition2 and UpdateWaypoint, however
while I was reworking it, I also put it in the other places BestZ is calculated.

This caused an issue in the SendTo routine. What my code does is turn flymode 1 on when a mob is in water to
stop it sinking to the floor.

It appears the SendTo routine can be (always is) called before the spawn packet has been removed from the
queue and sent to the clients. In this case, the client ignores the flymode packet because the mob doesn't
exist for it yet.

This causes problems because all the water checks assume that if the mob has remained in water since the
last check, that the flymode 1 has already been put on the mob. This is so that unnecessary appearance packets aren't sent to the clients.

I therefore don't attempt to set flymode or set the mob's inWater flag in SendTo.

The other bug I noticed while reworking this is that the DeltaZ
in the spawn update packet is being ignored. I.e. if you watch the mobs pathing in water, they always
move horizontally and then jump up or down when they get to their waypoint (or when another position update packet is sent).

I don't know whether this is a side effect of flymode 1, or whether it's something else, e.g. maybe the offset
for DeltaZ in the spawn struct is not correct and it's something that is only noticeable in water. I
only have the 6.2 client so don't know if it works differently with Titanium. Whatever the problem is,
I couldn't find a way around it.
Reply With Quote
  #4  
Old 01-11-2008, 05:42 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Do you think this patch will work on 1071? I saw it out and yours not there.
Reply With Quote
  #5  
Old 01-11-2008, 09:11 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by Angelox View Post
Do you think this patch will work on 1071? I saw it out and yours not there.
Should work fine, the only file that my patch touches that has been changed in 1071 is ruletypes.h, but my patch still applies fine and everything compiles (haven't actually fired up a server with 1071+WaterPatch, but it should work OK).
Reply With Quote
  #6  
Old 01-12-2008, 03:54 AM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

It's running TGC on with 1071 without any problems. I have the pathing support disabled, as bestz is too cpu intensive when you have 100 zones loaded, but fishing is working perfectly.

The only issue was azone wouldn't create maps of zones without water/lava, and without maps, fishing works anywhere in the zone. So, I just commented out the lava/water check in azone and recompiled to have it spit out those maps.
Reply With Quote
  #7  
Old 01-12-2008, 03:58 AM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Oh, I guess I should also mention I also have this code running on my internal test with is based on 1071, with bestz fully enabled, and it works fine there.
Reply With Quote
  #8  
Old 01-12-2008, 11:25 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by cavedude View Post
It's running TGC on with 1071 without any problems. I have the pathing support disabled, as bestz is too cpu intensive when you have 100 zones loaded, but fishing is working perfectly.
Thanks for the feedback.

I spent 5 or 10 minutes fishing on TGC and didn't catch a thing, although it seems to detect water well enough (my fishing skill was low, and then my pole broke!)

Regarding BestZ, I appreciate your problem. My pathing correction tool is coming along quite well. I'm only working on developing it for outdoor zones at the moment (using LOIO as a test subject) as they are easier to fix semi-automatically (i.e. click a button to correct ground collisions or paths that are too high above the ground).

Maybe in a couple of weeks it will be in a state where I can use it produce a (nearly) complete set of corrected grids for a mostly outdoor zone (say LOIO, Frontier Mountains or Field Of Bone) that are free of hopping mobs without the need for the runtime BestZ correction. I've already proved to myself that I can do it for a couple of test grids, but there are still some glitches/bugs I need to work through.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:09 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3