Chaingun Bug

Talk about the classic version of Metanet Software's amazingly popular freeware platformer right here!
User avatar
I Don't Have a Custom Title... ;_;
Posts: 277
Joined: 2008.09.27 (03:15)
NUMA Profile: http://nmaps.net/user/romaniac
MBTI Type: ISTP
Location: New Zealand

Postby remm » 2011.03.08 (07:38)

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.
Image
peking^

Image

User avatar
The Dreamster Teamster
Posts: 84
Joined: 2010.06.28 (22:53)
NUMA Profile: http://nmaps.net/user/atomizer
Steam: https://steamcommunity.com/id/_atomizer
MBTI Type: INTP
Contact:

Postby atomizer » 2011.03.08 (13:06)

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.

User avatar
With a cow, closer than you think.
Posts: 241
Joined: 2008.09.28 (11:48)
NUMA Profile: http://nmaps.net/user/krusch
MBTI Type: INFJ
Contact:

Postby krusch » 2011.03.08 (23:41)

I'm .... not sure where I stand on this. That's a really freaking good answer.
Image

"Asked ortsz for a name change"
Posts: 3380
Joined: 2008.11.13 (16:47)

Postby otters~1 » 2011.03.09 (01:35)

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.
the dusk the dawn the earth the sea

User avatar
I Don't Have a Custom Title... ;_;
Posts: 277
Joined: 2008.09.27 (03:15)
NUMA Profile: http://nmaps.net/user/romaniac
MBTI Type: ISTP
Location: New Zealand

Postby remm » 2011.03.09 (10:02)

atomizer, I don't know who you are, but know that you are awesome.
Image
peking^

Image

User avatar
The Loneliest Number
Posts: 1
Joined: 2012.04.23 (03:06)
NUMA Profile: http://nmaps.net/user/
Location: Illnois, Chicago
Contact:

Postby mrkenneth » 2012.04.23 (03:13)

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.
[redacted]

User avatar
Global Mod
Global Mod
Posts: 792
Joined: 2008.09.28 (18:32)
NUMA Profile: http://www.nmaps.net/user/Yahoozy
MBTI Type: INFP
Contact:

Postby  yahoozy » 2012.04.23 (03:23)

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.

Global Mod
Global Mod
Posts: 715
Joined: 2009.11.07 (19:20)
NUMA Profile: www.nmaps.net/user/Sunset
Steam: www.steamcommunity.com/id/
MBTI Type: INTP
Location: Iowa City, IA

Postby Sunset » 2012.05.07 (14:15)

!!!!!!!!!!! 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.


Who is online

Users browsing this forum: No registered users and 6 guests