The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Distance Accuracy
Author Message
Nachtmusique
Journeyman
*

Posts: 89
Likes Given: 0
Likes Received: 6 in 6 posts
Joined: Mar 2012
Reputation: 0



Post: #1
Distance Accuracy
I'm wondering how sphere calculates "distance." I am working on a system for a turn based tactical strategy game within UO and need an accurate way of handling distance. As is is now, I have had situations where I took exactly eight steps from the target and yet DISTANCE=11 or 4 steps and DISTANCE=6. Any suggestions?
10-17-2013 08:19 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #2
RE: Distance Accuracy
[Image: ucr0.png]
10-17-2013 08:54 AM
Find all posts by this user Like Post Quote this message in a reply
Nachtmusique
Journeyman
*

Posts: 89
Likes Given: 0
Likes Received: 6 in 6 posts
Joined: Mar 2012
Reputation: 0



Post: #3
RE: Distance Accuracy
Thanks, for the explanation. If anyone wants a little script to find the "simple distance" (the minimum number of steps to reach the target), here's a script:

[Function simpledist]
local.xdif=<eval SQRT(<eval <eval <p.x>-<src.p.x>> * <eval <p.x>-<src.p.x>>>)>
local.ydif=<eval SQRT(<eval <eval <p.y>-<src.p.y>> * <eval <p.y>-<src.p.y>>>)>
IF (<local.xdif> > <local.ydif>
return <eval <local.xdif>>
ELSE
return <eval <local.ydif>>
ENDIF
(This post was last modified: 10-18-2013 11:37 AM by Nachtmusique.)
10-18-2013 11:33 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)