Ambrosia Garden Archive
    • Measuring ProxRadius


      (corrected results)

      I did a lot of tests in EV: Nova 1.1 on Mac OS X 10.6.5, made a lot of sprites, fired a lot of weapons at a lot of ships, and counted a lot of pixels. This has led me to determine how the proximity radius of a weapon is calculated in a variety of circumstances, to an accuracy within a pixel or two. First the results for square sprites:

      Let W be the size of the weapon’s sprite in pixels, S be the size of the target ship’s sprite in pixels, P be the weapon’s ProxRadius, and D the distance at which the weapon will explode from ProxRad, measured in pixels between the centers of the ship and weapon sprites.

      The weapon will explode (if it’s eligible to) when its mask physically collides with the ship’s mask, in which case it will not launch submunitions. If that does not happen, then the weapon will explode (if it’s eligible to) when it gets close enough to the ship for its proximity radius to be triggered, in which case it will launch its submunitions. Here is how close it must be:

      Case 1: If S>32, then D = P+(S/3)-2
      Case 2: If S≤32, then D = max(P+(S/3)-2, (S/2)+(W/2)-1)

      For non-square sprites the results are rather strange. The game appears to go by the larger dimension, or perhaps the horizontal dimension as I did not test tall skinny sprites. Nor did I test when the larger dimension is less than 32 pixels. But in the cases I did test, the explosions were centered as above. However the non-square shots themselves did not terminate in the same location as the explosion appeared. The discrepancy was about half the difference between the width and height of the weapon sprite, but I did not check exactly.

      It’s also worth noting that AltSprites do trigger weapons to explode, but running lights do not. Furthermore, weapon turning rates appear to use the same units as ships, namely that a value of 10 corresponds to 30º/s, although I did not test that extensively.

      Edit: Fixed forumlæ. Not sure what I was thinking when I typed them up before, but probably being up all night had something to do with it. Anyway I’ve updated this post to reflect what is recorded in my tables of values in my notebook, and what I still see in-game today. Also, here is the plug-in I used for testing. Buy the weapons from any outfitter, accept the missions from any planet. The weapons are all secondary trigger, have graphics that show a circle of radius 20 at the center of a sprite of size given by the name of the weapon, and have ProxRadius shown in the weapon name. The range rings are every 10 pixels with highlights every 50 pixels. You might want to go to a sÿst where you won’t get attacked when you attack the mission ships.
      Attached File ProxRadius.zip (5.94K)
      Number of downloads: 2

      This post has been edited by Qaanol : 16 February 2011 - 11:22 PM

    • A few things bear noting here. For most target ships (over 32 pixels across) the distance away (from center to center of sprites) at which a weapon with positive ProxRadius will explode is the ProxRadius of the weapon minus 2, plus one third of the size of the ship.

      In practical terms, this factor of one third (rather than one half) the ship width may be a problem, because small ships may trigger the ProxRadius whereas large ships may collide with the weapon mask. The difference of course is whether submunitions are launched.

      If the ship is too small though, 32 pixels or less, then there is a minimum distance at which a weapon will explode, which is independent of ProxRadius. It is half the size of the ship plus half the size of the weapon, minus 1 pixel. This may be a significant distance away, if the weapon has a large sprite.

      Moreover, the minimum distance is truly independent of ProxRadius, meaning even when ProxRadius is zero or negative, the minimum distance remains unchanged. Conversely, if the ship is more than 32 pixels across, then a non-positive ProxRadius guarantees the weapon will only explode upon overlap with the ship’s mask.

      A ship smaller than or equal to 32 pixels across will trigger ProxRadius even for weapons with 0 or -1 in that field, if the ship and weapon have their centers closer than half the width of the ship plus half the width of the weapon.

      This post has been edited by Qaanol : 25 February 2011 - 01:11 AM