PDA

View Full Version : Range between targets?


Qrgauth
07-28-2005, 06:44 PM
<div></div><hr><blockquote><strong><font color="#ffcc00">*** Gameplay ***</font></strong><p>- Spell range is now less sensitive to targets being above or below you, which should result in less "out of range" messages in situations where you are obviously in range of the target. Please note that NPCs also benefit from this fix.</p><hr></blockquote>Every object in the game appears to have a /loc in 3-space... you can see your own /loc by typing /loc, oddly enough.To calculate the distance between objects in a three-dimensional space, it's SQRT((X1-X2)^2+(Y1-Y2)^2+(Z1-Z2)^2).  It's not magic.  It's not difficult.  It's about Grade 7 math in Canada.  Children, theoretically too young to play this game, could calculate the range between objects accurately with a $0.99 calculator.  It's an exact calculation - there's no estimating required.So why can Sony's developers not figure this out and just do the calculation in the code?  This shouldn't ever have required an update, it should have be right from day 1 because it is the simplest of algorithms.This was a problem in EQ1.  It's less of a problem (but evidently still there) in EQ2.  Other games seem to handle the Z-axis, why can't Everquest?  Perhaps a dev can explain this?

Darmash
07-28-2005, 08:39 PM
<div></div><div></div><div></div>The euclidian distance is not the only one used in geometry. There are formulas that are easier to compute who are distances - mathematically speaking (yes, you need a grade of sorts to know that). A distance is any relation between points that meets the 3 following criteria : 1) d(a, b) = d (b, a) 2) d(a, b) = 0 => a = b 3) d(a, c) <= d(a, b) + d(b, c) Following these rules, the distance that is (I think the most) often used in 3D calculations is |x2 - x1| + |y2 - y1| + |z2 - z1| . It complies to the rules before. This is very fast to compute for a server, much faster than computing square roots, and therefore is very popular. Remember a server basically has to compute every (mob, player) distance every tick to know for proximity aggro. On EQ1, the way that z was not taken into account in a lot of places (especially outdoor zones) makes think that the formula even forgot the z axis (like when you attacked a bird in South Karana below the bird houses). The indoor engine used more sophisticated algorithms, including the pathfinder to determine if a mob had to aggro through a wall or not, and this didn't work very well in EQ1. Much better in EQ2. My 2 cents <p>Message Edited by Darmash on <span class=date_text>07-28-2005</span> <span class=time_text>06:42 PM</span>

Almeric_CoS
07-28-2005, 08:59 PM
<DIV>Maybe you could consider more possibilities before you assume that the EQ2 devs are dumber than a middle school algebra student?</DIV> <DIV> </DIV> <DIV>I don't pretend to know everything goes into spell range calculations, but I do know that when you have to things like line-of-sight into account (aka pathing), the formula is bound to be notably more complex than than just <EM>SQRT((X1-X2)^2+(Y1-Y2)^2+(Z1-Z2)^2).</EM></DIV> <DIV> </DIV> <DIV>I certainly hope you don't think it's laughably-simplistic to make that waypoint wisp appear when you need to find something.  The same thing that makes the wisp is also deciding if your mob is in range of your attacks.</DIV> <DIV> </DIV> <DIV>:smileymad:</DIV>

Qrgauth
07-28-2005, 10:20 PM
<div></div><div></div><div></div><div></div><div></div><span><blockquote><hr>Almeric wrote:<div></div><div>Maybe you could consider more possibilities before you assume that the EQ2 devs are dumber than a middle school algebra student?</div><div> </div><div>I don't pretend to know everything goes into spell range calculations, but I do know that when you have to things like line-of-sight into account (aka pathing), the formula is bound to be notably more complex than than just <em>SQRT((X1-X2)^2+(Y1-Y2)^2+(Z1-Z2)^2).</em></div><hr></blockquote>Line of sight and pathing have nothing to do with range.If you have a bow that shoots 100 feet, and a mob is 100 feet away, you should be able to hit it unless it's blocked by an obstacle.  The range to the mob is 100 feet.  The bow or the spell doesn't path around corners like a rat in a maze.  That there's obstacles in the way is not relevant to the calculation of range.Obstacles and pathing are another issue altogether.  The waypoint wisp is also not relevant to the calculation of spell range.Please read before responding.Darmash raises an excellent point about approximating the distance for speed of electronic calculation.  I don't doubt that something similar to what he suggests is actuallywhat is happening.  Unfortunately, because it is an approximation (it is A distance, but the SHORTEST distance necessarily), errors can be introduced.So the question that might be asked is: Is it cheaper to spend development money tweaking the code to better approximations, or would it be cheaper to do an exact calculation and spend money on hardware that can handle the increased calculation (or is optimized for the calculation)?</span><div></div>====<hr><font color="#ff99ff">Almeric wrote:</font><font color="#ff99ff"> </font><font color="#ff99ff"> </font><font color="#ff99ff">I certainly hope you don't think it's laughably-simplistic to make that waypoint wisp appear when you need to find something.  The same thing that makes the wisp is also deciding if your mob is in range of your attacks.</font><font color="#ff99ff"> </font><hr>Actually, it is laughably-simplistic.  You can buy routing GPS that will essentially give you a "wisp" to guide you between arbitrary points pretty much anywhere on the earth for $100 - whether you choose to have it "path" along roads, or just give you the shortest straight line there.  This sort of technology is old, well-known, and well-tested.  If the routing calculations can work for the planet earth, surely a small version can work in little game zones. <p>Message Edited by Qrgauthil on <span class=date_text>07-28-2005</span> <span class=time_text>02:39 PM</span>

Almeric_CoS
07-29-2005, 01:10 AM
<DIV> <DIV><BR> <BLOCKQUOTE> <P></P> <HR> <P></P> <P>Qrgauthil wrote:</P> <P><SPAN><BR>If you have a bow that shoots 100 feet, and a mob is 100 feet away, you should be able to hit it unless it's blocked by an obstacle. </P> <P><FONT color=#ff0000>Look, you're writing your own answer here.  What part confuses you?  YES, OBVIOUSLY it is easy to do the simple formula using coordinates and a straight line to find distance between player and mob.  Duh.</FONT></P> <P><FONT color=#ff0000>But line of sight absolutely factors in.  Ever look straight at a mob whose foot is in a cave wall and the game tells you that you can't see your attacker?  Not the same as an out-of-range message, but they're heavily related.  A mob can be 5 feet from you and well within autoattack range, but the computations from uneven terrain are causing it to get messed up.</FONT></P> <P><FONT color=#ff0000>Your problem is that you're oversimplifying the process down to that 7th-grader computation.  Who says they never used that simple formula all along?  Maybe they did, but at the same time there was also a second computation for LOS issues.  Or maybe, to save processor time, they generated a complex formula that handles BOTH at the same time.  Save processor time, but with a drawback that certain terrains were going to artifically shrink ranges.</FONT></P> <P><FONT color=#ff0000>As I said before, I don't pretend to know what their real formula is, but you're being naive and childish to make the assumptions you're making.  And besides, they're FIXING IT, so why must you be so insulting when they're in process of making it better?</FONT></P> <P><BR></SPAN><BR>Actually, it is laughably-simplistic.  You can buy routing GPS that will essentially give you a "wisp" to guide you between arbitrary points pretty much anywhere on the earth for $100 - whether you choose to have it "path" along roads, or just give you the shortest straight line there.</P> <P><FONT color=#ff0000>You...MUST be joking?  You're comparing a road-mapping algorithm to free-form movement?  A routing GPS will guide you along a finite set of lines from point A to point B.  On the other hand, you could take an uncountably-large number of different routes to get just from the TS/Antonica doors to the TS dock.  Those GPS programs don't care if you're in the dead center of a lane or if you're leaning an extra few inches to the right.  When deciding if you're within the hard-cap limit of a 100-foot bow shot in EQ2, however, such things absolutely matter.</FONT></P> <P><FONT color=#ff0000>If you're going to bash, at least get a reasonable analogy, please.</FONT></P> <P></P> <HR> </BLOCKQUOTE><BR></DIV></DIV>

LordDragone
07-29-2005, 01:25 AM
<DIV>The issue <A href="http://eqiiforums.station.sony.com/eq2/view_profile?user.id=8785" target=_blank><SPAN>Almeric</SPAN></A> is refering to has happened to members of my group as well. Their characters will be literally standin on top of or mingled with their target and get the "Cannot see target" or "Out of range" message. THAT is the problem they are trying to correct with program changes. Also a GPS unit does not take into account  the altitude of the target just the road you are on while the program running combat factors in (in theory) everything, up down, front back, side to side all of it and if there is so much as a tiny rock in the way you will get those messages.</DIV>

Qrgauth
07-29-2005, 02:35 AM
<div></div><blockquote><font color="#ff3300">Their characters will be literally standin on top of or mingled with their target and get the "Cannot see target" or "Out of range" message.</font> </blockquote> <font color="#ff3300"> <font color="#ffffff">Exactly.  That has nothing (or should have nothing) to do with pathing.  It's calculating the distance to target and the intervening obstacles incorrectly.   That's NOT the same thing as calculating where a directing wisp would go, or where the mob would wander.</font> </font> <blockquote><font color="#ff3300">Also a GPS unit does not take into account  the altitude of the target just the road you are on while the program running combat factors in (in theory) everything, up down, front back, side to side all of it and if there is so much as a tiny rock in the way you will get those messages.</font> </blockquote> <font color="#ff3300"> <font color="#ffffff">Actually, it can depending on the particular versions used, but most people don't usually bother because it's not super important for driving.  A GPS (or routing software, MapQuest, etc.) calculates routing based on vector marked terrain data (be it roads or what have you).  There is NOTHING that prevents a game zone from being similarly derived and have the same algorithms used to determine pathing, which, incidentally, has nothing to do with calculating the range from point A to point B by the shortest distance or whether there are obstacles that block line of sight.  In fact, it should be much simpler because the game zones are a LOT smaller.</font> <font color="#ffffff">Let me make it absolutely clear for Almeric:</font> <font color="#66ff00" size="5"><b>Pathing != improperly calculated range to target generating errors. </b><font color="#ffffff" size="2">This thread isn't about pathing.  Please, start another one and we can argue about pathing until the cows come home (assuming they can find the way due to messed up pathing).</font><b> </b></font></font><div></div><p>Message Edited by Qrgauthil on <span class=date_text>07-28-2005</span> <span class=time_text>06:36 PM</span>

Silverfrost
07-29-2005, 04:03 AM
<DIV>Hey there,</DIV> <DIV> </DIV> <DIV>You're correct that straight line distance calculations are simple <img src="/smilies/3b63d1616c5dfcf29f8a7a031aaa7cad.gif" border="0" alt="SMILEY" />  However in EQ2 NPCs are not always where you think they are, which is the source of problems sometimes (i.e. the art is offset from the /loc for various reasons, and you would rather be interacting with the art than with an abstract point somewhere).</DIV> <DIV> </DIV> <DIV>BTW, if you think GPS is easy I would submit that you take another look <img src="/smilies/3b63d1616c5dfcf29f8a7a031aaa7cad.gif" border="0" alt="SMILEY" /></DIV> <DIV> </DIV> <DIV><A href="http://www-astronomy.mps.ohio-state.edu/~pogge/Ast162/Unit5/gps.html" target=_blank>http://www-astronomy.mps.ohio-state.edu/~pogge/Ast162/Unit5/gps.html</A></DIV>

Kyralis
07-29-2005, 04:28 AM
GPS roadmap calculations involve very simple searches along well-defined pathways. Game pathing is arbitrarily complex pathing in a free-movement area with only a few spots you *can't* go, rather than a few you *can*. The task of doing pathing in an efficient manner is orders of magnitude more complex. <div></div>

SavinDwa
07-29-2005, 04:33 AM
<DIV>Qrgauthil,</DIV> <DIV> </DIV> <DIV>I really think you are tremendously over simplifying the problem.  And thank the lord that we are not dealing witrh PvP yet.</DIV> <DIV> </DIV> <DIV>Firstly, I can tell you from testing that the message out of range message can be triggered by a line of sigth issue.  I have had that message from mobs standing next to me.   But... back to why i don't think its as simple as you think.  let me give an example:</DIV> <DIV> </DIV> <DIV>You are in Thundering Steepes and you are in a group fighting a Giant.  What is the distance to the Giant?  I'm sure we have all run into this problem.  Exactly where is the measurement from and to?  I have a ranger and its weird trying to work out where to stand to be outisde mele range so you can fire your bow, then you move back to where you were to close to fire you bow and the system says you are out of mele range.  So ... what is the from-to point?  Lets say my ranger is behind the Giant is it from my chest to the Giants back?  Their front?  What about from the side? arm? body?</DIV> <DIV> </DIV> <DIV>OK, lets assume it pciks two points somehow and measures it.  How does it know if their is an obstruction in the way?  hmm... I guess it needs to find the shortest distance bewteen me and the target that hass not obstruction ... but if I can only see the hand does it count?</DIV> <DIV> </DIV> <DIV>Of course there is also the fun answer to the formula you gave .. anyone using that formula with a real bow would get quite a shock because it won't give the right answer.</DIV> <DIV> </DIV> <DIV>Lets say you wrote a little program you tell it the maximum velocity that the arrow will leave the bow at. You program will calculate the optimum elevation of the shot it will also need the ccoordinates of both the bow shooter and the target.  The orgram just needs to answer in range or out of range.  Do you think the formula will work?  I think gravity might want to argue the point (I will assume zero wind, humity etc LOL)</DIV> <DIV> </DIV> <DIV>My point is that the game is making an approximation anyway, just as your formula would do.  Because any 6 year old in Canada knows that a person standing at 0,0,0 firing a bow at a person at 10,10,10 might be out of range while the person at 10,10,10 might be in range when firing at the person at 0,0,0 .... you have got to love Newton .... </DIV> <DIV> </DIV> <DIV>However, LOL if the arrow was travelling at near the speed of light ...... hmmm</DIV> <DIV> </DIV> <DIV>approximations are fine if they get us close I guess.  Your formula works well without gravity, humity, friction and hopefully is not near any black holes.LOL </DIV>

Syndic
07-29-2005, 05:40 AM
<span><blockquote><hr>SavinDwarf wrote: <div>approximations are fine if they get us close I guess.  Your formula works well without gravity, humity, friction and hopefully is not near any black holes.LOL </div><hr></blockquote>Yeah becuase I can't remember the last time I had a humid day in EQ2. <img src="/smilies/3b63d1616c5dfcf29f8a7a031aaa7cad.gif" border="0" alt="SMILEY" /> I'm sorry but I agree with the OP, the calculation for distance should be a direct line, then check whether any obstacles.  If not then guess what your in range.  As to the points used they tend to use the feet, or an area slightly above that,  this is how you get the can not see target even if the only part missing is the mobs feet. Personally I've never really noticed any OOR messages that have bothered me too much in EQ2, if I'm OOR I either move a little closer, or if I'm already on top of the mob I just pull it over to a new standing position and go again. What I would really love to see resolved is the cannot see target when its elbow is through a wall.</span><div></div>

Almeric_CoS
07-29-2005, 07:11 AM
<DIV>*bow Silverfrost*</DIV> <DIV> </DIV> <DIV>Like I said, I have no idea how they do it, I just know that it's more complicated than what the average layperson would expect.</DIV> <DIV> </DIV> <DIV>Oh, and that the devs are smarter than a 7th-grade Canadian child <img src="/smilies/8a80c6485cd926be453217d59a84a888.gif" border="0" alt="SMILEY" /></DIV>

Hand
07-30-2005, 01:46 AM
<DIV>Go Buckeyes  :smileyvery-happy:</DIV>

eshokes
08-01-2005, 08:12 PM
<P>Were not in the vacume of space in some remote far off distance future world?</P> <P>I would love to see a dirt devel, twister, hurricane blow through occasionally and add to the realism. Adding the calculations to compensate for weather conditions are probably not that far off with the advances in computing power the everyday pc has acquired and continues to advance at a dizzying rate.</P> <P>I can only hope to live long enough to put my virtual helmet/glasses on and leave this real world behind a few hours and truely explore the human imagination.</P>

Malack
08-03-2005, 06:26 PM
<BR> <BLOCKQUOTE> <P></P> <HR> <P>Qrgauthil wrote:</P> <P><FONT color=#ff3300><FONT color=#ffffff>A GPS (or routing software, MapQuest, etc.) calculates routing based on vector marked terrain data (be it roads or what have you).  There is NOTHING that prevents a game zone from being similarly derived and have the same algorithms used to determine pathing</FONT></FONT></P> <HR> </BLOCKQUOTE> <DIV>The GPS won't make you drive through someone's back yard; in the game, it's perfectly acceptable and realistic for a mob to jump a fence to get to you.</DIV> <DIV> </DIV> <DIV>The game would be unplayable if every possible route to every possible point had to be documented (as data) the way you're suggesting.</DIV>