How to calculate the sphere of influence radius of the sun and other stars?

I am creating a space exploration game and I'm gathering formulas for determining how the player's spacecraft will act in space. One thing I need to know is how to calculate how far a spacecraft can be from a star when its orbital speed will be larger than the escape velocity.

Is there a formula for calculating this sphere of influence/heliosphere radius? Or should I check if the orbital speed is larger than the escape velocity?

• This question makes no sense. Escape velocity is, rephrasing, velocity at a certain distance to a single central mass that is sufficient to guarantee that you won't be pulled back by its gravitational influence even as your distance approaches infinity. Having escape velocity means that even without additional propulsion you would have escaped the gravitationally attracting body for good, putting you on a hyperbolic escape trajectory relative to it. Sphere of influence is the radius at which the central body gravitationally dominates over attraction of other bodies in its neighborhood. May 2 '15 at 20:17

$F=\frac{GMm}{R^2}$ where $G$ is gravitational constant, $M$ is mass of the planet, $m$ is mass of your orbiter and $R$ is the distance between them.
To make maps of influences you can use $F=\frac{M}{R^2}$ for a planet because $G$ and $m$ are the same for all planets. You can make sphere-of-influence spheres with this formula. The active planet is the one which has strongest $F$ at given point, so spacecraft will orbit around it.