Serious Sam's Most Notorious Bug Analysed
494K views · May 14, 2022 · Gaming
Comments · 1.3K
@fleckens · 4 years ago
I never knew about this bug but just hearing the laser gun firing at the start I could clearly tell I had experienced it as I recall the sounds of the two different rates of fires.
2.8K
@TheRealGooberMan · 4 years ago
19+ year gamedev here. The way we did this in the PS2 era was to treat every timer as a countdown. Our games also used variable tick rates, so the epsilon method would not have worked for us.
2.3K
@ninjacat230 · 2 years ago
THEY MADE THE TIMER A FLOATING POINT NUMBER?!
101
@miaouew · 4 years ago
I really hope Agonizing Rectal Pain never unsubscribes so you have to keep reading his name at the end of each video
927
@porteal8986 · 4 years ago
the moral of the story: just because it has a decimal, doesn't mean you should make it a float
348
@mallardtheduck1 · 4 years ago
It seems to be a really bad decision to use a floating point value to store the game tic like that. An integer completely avoids this issue; even a 32-bit integer has enough range for over 6 years of playtime at 20 tics per second. About the only advantage a float might have is that time values are written by developers in terms of seconds rather than tics, making it easier to change the tic rate during development, but even then, converting those values to integer tics at the first opportunity in the code is probably a better solution.
1.7K
@OldMovieRob · 4 years ago
Weird how I remember playing this game years ago, and being vaguely aware of this happening, but just dismissing it in the back of my head as the weapons overheating or something, haha
723
@klazzera · 1 year ago
<a href="https://www.youtube.com/watch?v=PpfpfDNFdvQ&t=60">1:00</a> sounds a lot like a signed variable going negative by overflow at 4096 seconds then crossing zero again to become positive another 4096 seconds later
13
@VS___VerruckterSchakal · 4 years ago
This variable math is also why Minecraft gets super jittery and whatnot the further away you get from 0.x.0 (spawn)
45
@Keldor314 · 4 years ago (edited)
There's more to the bug than this - if it was just a matter of floating point error in the time tick, you would have one shot fire one tick late, and then all subsequent shots would be at the regular rate, but one tick late relative to the beginning of the game.<br><br>The other part of the bug is that the target times are not calculated correctly. Instead of adding the time delay to the previous time target to get the next shot, it adds it to the time at which the weapon was actually fired, resulting in each subsequent target time being almost a full tick late relative to the last one (because the actual time of firing was late). This is why the bug doesn't appear to "fix itself" after one shot being delayed by a single tick, but rather has a additional delay for every single shot.
470
@PeterLawrenceYT · 4 years ago
Surprised how interesting I found this one! Looks like finding the issue was more difficult than fixing it.
584
@AviansEnthusiast · 4 years ago
Unlike the floating points, we were precise in finding the reason for the bug.
235
Up next

How Quake II's BFG10K Works
decino · 389K views

Broken Kill Counts in Classic Serious Sam (Part 1)
decino · 583K views

Doom's RNG
decino · 1.5M views

The Ultimate Serious Sam Iceberg
Seriously Questionable · 96K views

Duke Nukem 3D lies to you six times
MADVIL · 47K views

Counter-Strike's Forgotten Secrets
Counter-Strike Historian · 17K views

SERIOUS SAM - DEVOLVE OR DIE
Civvie 11 · 2.5M views

serious sam 2 out of context
Willowton · 79K views

Why This Rare Bug Turns Everything into Unkillable Ghosts
decino · 666K views

Doom's Powerups
decino · 1.4M views

How Different Are Doom 64's Demons?
decino · 862K views

Doom's Damaging Floors
decino · 371K views

This Serious Sam Mod Hates You...
Br0leg · 119K views

Minecraft but all math is slightly wrong
FibbWare · 1.8M views

The Games Industry Thinks You’re Stupid - Marvel's Wolverine
InfiniteMass · 546K views

Doom Challenges Deemed Impossible
decino · 1.6M views

Can You Beat Portal 2 in VR Without Barfing?
NerdFuel · 1.1M views

Are All Doom Monsters Equally Aggressive?
decino · 674K views

Top 5 worst mistakes you can make in Dark Souls 1
ComYuri · 419K views

How Doom's Enemy AI Works
decino · 2.1M views