Page 1 of 1

Any way to have heat seeker act their part?

PostPosted: Thu Oct 02, 2008 8:31 am
by chuck_starchaser
In PU we have heat-seeker missiles, but they don't behave as such.
In the original Privateer game, the only way you could get a heatseeker
to lock on a bogie was to get *behind* the bogie.
In PU, heatseeker get a lock from any angle.
VS has heatseekers, right? Do they work like heatseekers?
If so, how do we fix ours?
TIA

Re: Any way to have heat seeker act their part?

PostPosted: Thu Oct 02, 2008 10:42 am
by Deus Siddis
chuck_starchaser wrote:In PU we have heat-seeker missiles, but they don't behave as such.
In the original Privateer game, the only way you could get a heatseeker
to lock on a bogie was to get *behind* the bogie.
In PU, heatseeker get a lock from any angle.
VS has heatseekers, right? Do they work like heatseekers?
If so, how do we fix ours?
TIA


IMO, yes to all of the above. All VS ships have 'hot' thrusters on all sides (unlike modern spacecraft like the shuttle that only have simple low power 'cold' gas thusters besides the actual rockets engines on the back). And then there's the waste heat dissipation issues too (radiator surfaces).

Realism aside, as a player of VS I've never noticed heatseekers needing a backside firing solution, they seem to just need for you to be within range of the target for long enough, and I think to be facing the target within a certain angle range too.

If this is not for the realism conflicts, it is probably because while missiles in VS are currently horribly overpowered, a modern technology inspired limitation like this would make the weapons that suffered it totally useless. This comes from being able to pull off "shelton slides" in VS, where you can turn your would-be vulnerable backend away from incoming missiles at your ship's max angular acceleration while still keeping your momentum (all because drag is still 0 no matter what your silhouette from your direction of travel) and you still can maneuver out of the missile's path with your lateral thrusters.

That's my understanding of VS' story anyway, WC of course has its own direction of game play mechanics and balance.

PostPosted: Thu Oct 02, 2008 12:43 pm
by chuck_starchaser
Exactly. All realism considerations aside, PU has a canon to deal with. In the original game of Privateer, and in all WC games for that matter, heatseekers needed a backside solution, and so that is what PU needs.
So, re-framing the question: Where do I start looking to implement this?
Would I need a special "missile AI" for heatseekers only?

PostPosted: Thu Oct 02, 2008 2:41 pm
by jackS
Locking behavior isn't missile specific at present except in terms of range and time required to lock. You'd need to recode how we do missile locking, not just the missile behavior script.

PostPosted: Thu Oct 02, 2008 11:03 pm
by chuck_starchaser
Hmmm... Okay. So, where would be the locking code? Is that python or c++? (Hope it's C++...).

PostPosted: Fri Oct 03, 2008 9:45 am
by chuck_starchaser
chuck_starchaser wrote:Hmmm... Okay. So, where would be the locking code? Is that python or c++? (Hope it's C++...).


We were just thinking about FF missiles. This might benefit VS as well.
Right now FF missiles aren't terribly useful. They do ackquire a new target while in flight, if the first is
destroyed before it gets to it; but that's not a terrible benefit for the loss of damage power.
What idea one of us came up with is to,
a) Make them work like in the original game, where you could fire them while facing away from your target; or even
fire them without a target and let them pick one; and
b) Make them smarter: Have them prioritize targets by current damage points, AND include sub-units in their
priority list, so that if there's a damaged bogey they might pick that one and finish it; and otherwise, if there's only a
capship around, they might target a turret or other sub-system.

PostPosted: Fri Oct 03, 2008 6:38 pm
by chuck_starchaser
Code: Select all
void FF_missile_AI()
{
  static target_t *target = 0;
  while( 1 )
  {
    //if missile doesn't have a target yet; or target was destroyed
    if( target == 0 || target->segfaults() ) //:-)
    {
      //select a new target
      float lowest_hit_points = 77777777.77f;
      for( size_t i = 0; i < 777; ++i )
      {
        target_t *t = pick_any_ship();
        if( t == 0 ) break; //who says there ought to be 777 ships around?
        //if it's an enemy, and is within range given remaining fuel,
        if( faction_relation(t->faction()) < 0.0 && t->range() < current_range(fuel) )
        {
          //if it's the weakest target found yet
          if( t->hit_points_remaining() < lowest_hit_points )
          {
            //tentatively make it the new target and update max wakness
            target = t;
            lowest_hit_points = t->hit_points_remaining();
          }
          //get the target's sub-units too, for good measure:
          target_t *s;
          while( s = t->get_next_subunit() )
          {
            if( s->hit_points_remaining() < lowest_hit_points )
            {
              target = s;
              lowest_hit_points = s->hit_points_remaining();
            }
          }
        }
      }
    }
    //assuming without assuming we have a target now...
    if( target )
    {
      if( target.range() < threshold )
         boom();
      else
        fly_towards( target );
    }
  }
}

PostPosted: Fri Oct 03, 2008 7:59 pm
by chuck_starchaser
Beta 2:

Code: Select all
void FF_missile_AI() //to be called at each physics frame, atom, whatever
{
  static target_t *target;
  //if missile doesn't have a target yet; or target was destroyed
  if( target == 0 || target->segfaults() ) //:-)
  {
    //select a new target
    float lowest_hit_points = 77777777.77f;
    for( size_t i = 0; i < 777; ++i )
    {
      target_t *t = pick_any_ship();
      if( t == 0 ) break; //who says there ought to be 777 ships around?
      //if it's an enemy, and is within range given remaining fuel,
      if( faction_relation(t->faction()) < 0.0 && t->range() < current_range(fuel) )
      {
        //if it's the weakest target found yet
        if( t->hit_points_remaining() < lowest_hit_points )
        {
          //tentatively make it the new target and update max wakness
          target = t;
          lowest_hit_points = t->hit_points_remaining();
        }
        //get the target's sub-units too, for good measure:
        target_t *s;
        while( s = t->get_next_subunit() )
        {
          if( s->hit_points_remaining() < lowest_hit_points )
          {
            target = s;
            lowest_hit_points = s->hit_points_remaining();
          }
        }
      }
    }
  }
  //assuming without assuming we have a target now...
  if( target )
  {
    if( target.range() < threshold )
       boom();
    else
      fly_towards( target );
  }
}