Author Topic: Strange missile tracking  (Read 6533 times)

0 Members and 1 Guest are viewing this topic.

Re: Strange missile tracking
Watch this trailer for X3:

http://www.youtube.com/watch?v=6IXffiOex24&feature=related

If people can get that missile barrage that starts at 0:32 that'd be freaking awesome. Because dayaamn, that looks sweet. That whole game looks pretty nice honestly.

 

Offline Polpolion

  • The sizzle, it thinks!
  • 211
Re: Strange missile tracking
Hmm.. they should take damage from the flak too... however flak doesn't really do that much damage especially as the target is so small and the shot deviation so large. In any case bombs have 50 hitpoints by default so they are quite durable already. Also there is the thing that bombs are immune to all weapons fire for the first 1.5s after they are fired.

      Yeah I thought they may have some set hitpoints.
      50 hitpoints is quite a bit but if the bomb was say, about half the size of a fighter it might need a few more depending upon the object's speed and general flight time.

I could have sworn someone cited a code reference saying that they were just a point that if a shot came within a certain distance of it, they blew up. Are you guys sure? I mean, I've destroyed plenty of them with two bolts from a subach (two bolts, not two shots with gun banks firing 2 shots each. One shot on a bank with two fire points.)

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Strange missile tracking
I think thesizzler's right.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Strange missile tracking
Pretty sure they work the way i described...

Code: [Select]
   if (wipA->wi_flags & WIF_BOMB) {
      if (wipB->wi_flags & WIF_BOMB) {    // Two bombs collide, detonate both.
         Weapons[A->instance].lifeleft = 0.01f;
         Weapons[B->instance].lifeleft = 0.01f;
         Weapons[A->instance].weapon_flags |= WF_DESTROYED_BY_WEAPON;
         Weapons[B->instance].weapon_flags |= WF_DESTROYED_BY_WEAPON;
      } else {
         A->hull_strength -= wipB->damage;
         if (A->hull_strength < 0.0f) {
            Weapons[A->instance].lifeleft = 0.01f;
            Weapons[A->instance].weapon_flags |= WF_DESTROYED_BY_WEAPON;
         }
      }
   } else if (wipB->wi_flags & WIF_BOMB) {
      B->hull_strength -= wipA->damage;
      if (B->hull_strength < 0.0f) {
         Weapons[B->instance].lifeleft = 0.01f;
         Weapons[B->instance].weapon_flags |= WF_DESTROYED_BY_WEAPON;
      }
   }
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Polpolion

  • The sizzle, it thinks!
  • 211
Re: Strange missile tracking
Pretty sure they work the way i described...

Code: [Select]
   if (wipA->wi_flags & WIF_BOMB) {
      if (wipB->wi_flags & WIF_BOMB) {    // Two bombs collide, detonate both.
         Weapons[A->instance].lifeleft = 0.01f;
         Weapons[B->instance].lifeleft = 0.01f;
         Weapons[A->instance].weapon_flags |= WF_DESTROYED_BY_WEAPON;
         Weapons[B->instance].weapon_flags |= WF_DESTROYED_BY_WEAPON;
      } else {
         A->hull_strength -= wipB->damage;
         if (A->hull_strength < 0.0f) {
            Weapons[A->instance].lifeleft = 0.01f;
            Weapons[A->instance].weapon_flags |= WF_DESTROYED_BY_WEAPON;
         }
      }
   } else if (wipB->wi_flags & WIF_BOMB) {
      B->hull_strength -= wipA->damage;
      if (B->hull_strength < 0.0f) {
         Weapons[B->instance].lifeleft = 0.01f;
         Weapons[B->instance].weapon_flags |= WF_DESTROYED_BY_WEAPON;
      }
   }

Not too sure what that stuff means, but you're a coder and I'm not, so I'll take your word for it. :D

 
Re: Strange missile tracking
Not too sure what that stuff means, but you're a coder and I'm not, so I'll take your word for it. :D

     I think the relevant part is:

if (A->hull_strength < 0.0f) {

     Measuring I presume if Hull strength is below zero. Meaning that, if it wasn't based on hull strength then it wouldn't have a value like that or you wouldn't be able to measure it.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Strange missile tracking
Well... translated from the code it pretty much says that if two bombs collide.. both will detonate automatically. However if a bomb and another weapon collide then the other weapon's unmodified damage value is subtracted from the bomb's hitpoints. If the said hitpoints are as a result of the previous calculation reduced below 0 then the bomb detonates.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • FLAMES OF WAR
Re: Strange missile tracking
I see the bombs hitpoints are not directly refererenced. They are stored in a variable somewhere...interesting.
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

  

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Strange missile tracking
Ummh... Why?
Do not meddle in the affairs of coders for they are soggy and hard to light