Page 1 of 1

Chaingun Bug

Posted: 2011.03.08 (07:38)
by remm
I have always had a feeling that chainguns fired an inconsistent amount of shots. Previously I hadn't tried to prove it because I had been told by others that the shots are always the same length, and so didn't investigate further.
Except today when playing this featured map, my run seemed to fluctuate between the chaingun firing 5 shots and the chaingun firing 8 shots when it first saw me.
Yes, it was firing nearly twice as many shots sometimes.

These are the two demos:

Demo 1 displays the chaingun firing a total of 5 shots in it's first round.


Demo 2 has the chaingun firing 8 shots, and I have to wait significantly for it to stop firing.
You can check these numbers if you like, but I counted in fbf to be sure of the exact number.


What I want to know is:
  • How much does the amount of shots vary by?
    What causes the amount of shots to vary?
    Can the chaingun be manipualted to fire more or less shots, so as to aid in highscoring
The difference between the two demos is that in the second one, I arrive in the chaingun area a little later, allowing the second seeker in line to be triggered. In the first demo, that seeker is not triggered. Perhaps it is something to do with the triggering of the drone, or which tile the chaingun is on at the time. . ?

How many of you have noticed this before?

Your thoughts please.

Re: Chaingun Bug

Posted: 2011.03.08 (13:06)
by atomizer
It's not a "bug", chainguns are random by design.
Sorry to ruin somebody's possible experimenting session in progress, but look at the source:

Code: Select all

DroneObject.prototype.Fire_Chaingun = function () {
    this.chaingunTimer = 0;
    this.chaingunMaxNum = 4 + game.GetTime() % 5;
    this.chaingunSpread = 0.1 * (2 + game.GetTime() % 3);
    this.chaingunCurNum = 0;
    ...
(game.GetTime() returns current frame number; shots are being fired until chaingunMaxNum < chaingunCurNum, so 2 rounds for chaingunMaxNum = 1 and so on)

So, chaingun's clip ammo and spread vary in amount (5 to 9 and 0.2 to 0.4 respectively) depending on the number of the frame when chaingun notices ninja (the frame when it stops, in the next frame there's a heat-up sound). I doubt that this can help you in realtime (unless you can count frames one by one). Maybe fbf'ers and mbd'ers are already aware of this, I don't know.

I counted frames in your demos to prove this:
1st demo, 1st encounter @ 155f: 5 + 155 % 5 = 5 + 0 = 5 rounds
1st demo, 2nd encounter @ 287f: 5 + 287 % 5 = 5 + 2 = 7 rounds
1st demo, 3rd encounter @ 439f: 5 + 439 % 5 = 5 + 4 = 9 rounds
2nd demo, 1st encouner @ 163f: 5 + 163 % 5 = 5 + 3 = 8 rounds
2nd demo, 2nd encounter @ 315f: 5 + 315 % 5 = 5 + 0 = 5 rounds


P.S. Yes, I'm aware of license terms. If they want to sue me for decompiling - sure, I don't mind.

Re: Chaingun Bug

Posted: 2011.03.08 (23:41)
by krusch
I'm .... not sure where I stand on this. That's a really freaking good answer.

Re: Chaingun Bug

Posted: 2011.03.09 (01:35)
by otters~1
Yeah, that's one of the most helpful posts I've ever seen. They're gonna release the source soon(ish) for v1.5 anyway.

Re: Chaingun Bug

Posted: 2011.03.09 (10:02)
by remm
atomizer, I don't know who you are, but know that you are awesome.

Re: Chaingun Bug

Posted: 2012.04.23 (03:13)
by mrkenneth
i guess atomizer is very much knowledgeable in terms of chaingun operation and by reading upon his post I know that he is an expert.

Re: Chaingun Bug

Posted: 2012.04.23 (03:23)
by  yahoozy
mrkenneth wrote:i guess atomizer is very much knowledgeable in terms of chaingun operation and by reading upon his post I know that he is an expert.
Thank you for your contribution.

Re: Chaingun Bug

Posted: 2012.05.07 (14:15)
by Sunset
!!!!!!!!!!! wrote:
mrkenneth wrote:i guess atomizer is very much knowledgeable in terms of chaingun operation and by reading upon his post I know that he is an expert.
Thank you for your contribution.
I wouldn't have known without it.