Author Topic: Meteor Defense Vulnerability  (Read 2324 times)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Meteor Defense Vulnerability
« on: September 05, 2007, 01:55:26 PM »
Many of you have claimed meteor defenses don't always fire at EMP missile in multiplayer. I decided to go looking and found that there is indeed a case when the meteor defenses won't fire. There is about a 1/8 chance of this happening.


What causes this to happen is the checks for when an EMP missile is shot down only run when the count down until impact is strictly between 12 and 20. But the function that performs these checks is called by another function which only executes it's body of code every 8 ticks. As you can see, there are only 7 numbers strictly between 12 and 20. {13, 14, 15, 16, 17, 18, 19}

What happens then is if the timing lines up nicely, then the missile count down timer goes from 20 to 12, without ever hitting any of the intermediate values, and so the code that checks for meteor defenses shooting them down is never run.

What can make this potentially worse, is that the command packet execution granularity is 4 ticks. Which means that 1/8 chance can become a 1/2 chance under the correct conditions (or no chance under different conditions).


If someone is exploiting this vulnerability against you, you can try to stop that by changing the number of units in the game. That is, build an extra unit, or get rid of one. It should offset the timing requirements, and change that 1/2 into a 0. At least until any of the players undo that change in the number of units.


I've attached a test DLL that demonstrates the bug. I'm leaving out the source on this one though. I'm sure some people would purposefully exploit this in multiplayer if they knew how.

You can control the AI Spaceports by moving your scout between the different markers. The meaning of each marker is given as in game messages, and it'll tell you when the AI state is updated.

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Meteor Defense Vulnerability
« Reply #1 on: September 05, 2007, 02:05:46 PM »
Thanks for your work on this and nice DLL :)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Meteor Defense Vulnerability
« Reply #2 on: September 05, 2007, 04:21:42 PM »
Btw, as a side note, meteors and EMP missiles are responsible for shooting themselves down if they get too close to a meteor defense. (Provided it's active and has targeting data from and active observatory). The meteor defense doesn't actually do it internally. This has a few consequences. Such as missiles only get shot at by one meteor defense. This is because it's the missile tracking the MD, not the other way around. The missile only tracks one "target" (source) to be shot at from. Hence why only one of the two meteor defenses in the test DLL ever fires. It also means that a single meteor defense can fire at multiple missiles. Also seen in the test DLL. It also means that code must be duplicated for each unit that can be shot down by the meteor defense.


Also, I tried testing if a meteor defense could shoot down an evacuation module, but no luck there when I tried. That could have been awesome for a space race. Just think, all ready to go, certain victory, and then "200 colonists have died", "You have failed, our colony is doomed". But I suppose shooting down the only humans left with a chance at survival doesn't really fit well with the story of the game.

It seems the targetting only works for meteors and EMP missiles, and only when they are comming down. A missile can't be shot when it's launching.
 

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Meteor Defense Vulnerability
« Reply #3 on: September 05, 2007, 04:46:22 PM »
Quote
Also, I tried testing if a meteor defense could shoot down an evacuation module, but no luck there when I tried. That could have been awesome for a space race. Just think, all ready to go, certain victory, and then "200 colonists have died", "You have failed, our colony is doomed". But I suppose shooting down the only humans left with a chance at survival doesn't really fit well with the story of the game.
You only have to launch up to the Phoenix Module in Space Race.

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Meteor Defense Vulnerability
« Reply #4 on: September 06, 2007, 11:46:38 AM »
wow, I actually understood everything Hooman said in a post :o

That should be noted for change if the remake is ever started.  I mean, only 1 meteor def firing, and only with that slim of conditions met?  I'm okay with it failing every now and then, but what you described makes it have a greater than reasonable probability of failing.
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Meteor Defense Vulnerability
« Reply #5 on: September 06, 2007, 01:21:35 PM »
Quote
You only have to launch up to the Phoenix Module in Space Race.

Ok, a modified Space Race then. :P


It's be nice if more than 1 meteor defense would fire, so you can increase the effectiveness of your protection. It's also be nice if you could shoot them while they were being launched if you had somethign close enough.


Btw, this is actually a really easy thing to fix, so if people wanted this fixed in an update we could do that. At least provided there aren't any side effects of increasing the range of time the missile can be targetted by 1. Because if that's all it is, it's really easy to do.

Offline White Claw

  • Hero Member
  • *****
  • Posts: 854
Meteor Defense Vulnerability
« Reply #6 on: September 06, 2007, 04:06:35 PM »
Sounds like an easy fix to me...