Talk:Demon speed bug

That's one pretty odd bug. Methinks the offending code is around here somewhere: (from g_game.c:1422) if (fastparm || (skill == sk_nightmare && gameskill != sk_nightmare) ) {        for (i=S_SARG_RUN1 ; i<=S_SARG_PAIN2 ; i++) states[i].tics >>= 1; mobjinfo[MT_BRUISERSHOT].speed = 20*FRACUNIT; mobjinfo[MT_HEADSHOT].speed = 20*FRACUNIT; mobjinfo[MT_TROOPSHOT].speed = 20*FRACUNIT; }    else if (skill != sk_nightmare && gameskill == sk_nightmare) {        for (i=S_SARG_RUN1 ; i<=S_SARG_PAIN2 ; i++) states[i].tics <<= 1; mobjinfo[MT_BRUISERSHOT].speed = 15*FRACUNIT; mobjinfo[MT_HEADSHOT].speed = 10*FRACUNIT; mobjinfo[MT_TROOPSHOT].speed = 10*FRACUNIT; }

With my limited knowledge of programming, I comprehend that demon's frame lengths here are being bitshifted by one (that is, to multiply or divide them by two), while speeds of various fireballs are being explicitly redefined. The bolded code is what confuses me. In the video, the player begins a game in Nightmare, makes a save, then begins a HMP game, and loads from saved slot, then repeats this again and again. My guess is, while  is being read from a save,    variable remains unchanged from previous session. The bolded check passes every time, and the demon continually slows down. I looked into save/load logic, but there are too many unfamiliar thingies in the code :) A reverse process is similar. You save the game on skills 1-4, then start in NM and load your previous save. The demon's on crank :) But why it would cause the game to freeze? What amuses me the most is how such an ugly bug had persisted through all versions. Weird. --Unmaker 00:39, 12 June 2012 (UTC)