1. If you're looking for help-related things (for example, the key rebinding tutorial), please check the FAQ and Q&A forum! A lot of the stickies from this forum have been moved there to clean up space.
    Dismiss Notice

Incorrectly vectoring projectiles - fixable

Discussion in 'Starbound Discussion' started by witless, Dec 19, 2013.

  1. witless

    witless Poptop Tamer

    Certain special projectiles, like "fast" and orbitalcannon veer way off target. To fix this, a single global needs to be changed, in assets/default_movement.config:


    "speedLimit" : [100, 100],


    This should be set to:

    "speedLimit" : [200, 200],

    This will fix the "projectiles/guns/fast" projectile type in particular.


    For even faster projectiles, this could be changed to even higher. Warning: speed values above 250 will cause collision detection problems with single tile objects and projectiles that are too small.


    "speedLimit" : [1000, 1000],
     
    DeadlyLuvdisc likes this.
  2. DeadlyLuvdisc

    DeadlyLuvdisc Oxygen Tank

    Care to explain why the speed limit causes projectiles to veer off course?

    Like, I know sometimes code just does weird things, but any idea why?
     
  3. witless

    witless Poptop Tamer

    there's a certain amount of pixels a projectile is allowed to go (100 in horizontal/vertical) and the game distributes what's resolved first (horizontal) and then the angle is calculated. instead of realizing the maximum speed

    for example, if a 200 speed projectile is aimed at a 30 degree angle,

    the game calculates (sqrt(3) / 2) * 200 for horizontal which is speed value 173
    (read up on your right triangles to see why this is)

    the game engine truncates that to 100 because that's the horizontal speed limit.

    the game then calculates (1 / 2) * 200 for vertical, which is 100, which is exactly at the speed limit and thus not modified.
    (again, read up on your right triangles to see why this is)

    so the projectile is now traveling 100 speed horizontal and 100 speed vertical. the projectile ends up going at a 45 degree angle.
     
  4. DeadlyLuvdisc

    DeadlyLuvdisc Oxygen Tank

    They must have just overlooked this detail then. Very nice catch. Interesting and helpful solution, too. I've often wondered how projectiles effected the function of the gun, since the game isn't transparent about it. It just shows the image of the projectile, and doesn't say anything about stats. Maybe they'll fix these little details eventually.
     

Share This Page