Ship Movement: Difference between revisions

From VGA Planets Wiki
Jump to navigationJump to search
(Created page with "Tables taken from Infolist v3.1 created by Eden Tan. == Normal Movement Formula == <pre> Normal_x = rnd(warp^2/(way_x^2 + way_y^2) * way_x) - .5 Normal_y = rnd(warp^2/(way_x^2 +…")
(No difference)

Revision as of 05:20, 5 June 2011

Tables taken from Infolist v3.1 created by Eden Tan.

Normal Movement Formula

Normal_x = rnd(warp^2/(way_x^2 + way_y^2) * way_x) - .5
Normal_y = rnd(warp^2/(way_x^2 + way_y^2) * way_y) - .5

NOTE: These formulas are correct for approximately 90% of movements 


Hyperjump Formula

final_x = ERND(x+350*dx/ERND(sqrt(dx^2+dy^2)))
final_y = ERND(y+350*dy/ERND(sqrt(dx^2+dy^2)))

NOTE: ERND() is a rounding function which rounds normally to the nearest 
      integer, except when the the number to be rounded ends in exactly 0.5.
      Then, it rounds to the nearest even number, e.g. 8.5 rounds to 8 and
      9.5 rounds to 10.  The innermost ERND() can be just a simple RND()
      (round to nearest integer) since the square root of an integer will
      never end in 0.5.  Formula courtesy of Andrew Sterian.