r/programming • • Oct 01 '17

Clever way of skirting game code quality tests from the 90s (x-post /r/Games)

https://youtu.be/i9bkKw32dGw
5.2k Upvotes

321 comments sorted by

285

u/miasmic Oct 01 '17

This reminds me of a story I read where a game was ready to go to master except for a seemingly unfixable crash when the player quit the game to go back to the OS, it was fixed by writing a custom handler that rewrote "Fatal Error: blablabla" to "Thanks for playing [Game]"

17

u/redditchao999 Oct 01 '17

That game was Wing Commander, btw

233

u/Gefrierbrand Oct 01 '17

I think that was Wing Commander.

0

u/[deleted] Oct 01 '17

[deleted]

50

u/Red5point1 Oct 02 '17

wow that brings back memories of QEMM & EMM386 and all the different settings and batch files needed for each different game.

54

u/robm111 Oct 02 '17

You spelled nightmares wrong.

18

u/Red5point1 Oct 02 '17

memory management was ok, what was a nightmare was upgrading the video or sound card.
You would have to set the correct jumper settings and IRQ settings in the right order.

8

u/[deleted] Oct 02 '17

I never had such issues. It seemed all cards claimed to be adlib and sound blaster 16(with parameters 220-5-1) at the same time.

And the only noticeable difference at videocards I remember was that S3 trio managed to play mpegs on Pentium 100 in QV Pro without dropping frames, unlike other players or other cards(they were a slideshow).

Memory management OTOH required to have a menu in autoexec with several combinations of managers (himem+emm with some flags, himem+emm without some flags, himem only, no memory management): different games had different requirements. And sometimes having emm meant that there literally were no base memory left to launch the game.

5

u/AetherMcLoud Oct 02 '17

If in doubt, Port 220, IRQ 5, DMA 1 :D

→ More replies (1)

3

u/catonic Oct 02 '17

QEMM had utilities to make it work. I remember watching it count down some 13,000,000 combinations on a 386 once....

→ More replies (1)

10

u/civildisobedient Oct 02 '17

Ah yes, the halcyon days of AUTOEXEC.BAT and CONFIG.SYS.

2

u/AetherMcLoud Oct 02 '17

Shiiiit. I remember having like 2 or 3 different floppy boot disks so I could play a few different games that needed different memory management. And of course without internet, so nowhere to look up settings for a specific game quickly.

→ More replies (2)
→ More replies (2)
→ More replies (1)

62

u/GetThisShitDone Oct 01 '17

I think it's wing commander. The game was unable to close without crashing, so they changed the comment from "error ####" to "Thanks for playing wing commander".

5

u/mb862 Oct 02 '17

One of the libraries we use does a real shit job at cleaning itself up if we tried to use it as designed, it would crash nearly every time, so we trap the exit signal to instead get our own PID from the system and kill itself. After we added it we got tonnes of praise from customers from how quickly our software closed down compared to before.

It's not a great lesson to kids to tell them that suicide is quicker and easier than exiting the right way.

8

u/ProgrammingPants Oct 01 '17

Pretty sure that game was wing commander.

9

u/Goopster Oct 01 '17

A little known fact about this game is that it was wing commander.

4

u/FL4D Oct 01 '17

I think you're talking about Wing Commander.

1

u/AetherMcLoud Oct 02 '17

Haha, I'm guilty of using that in an old legacy software I had to work on too. IIRC something in the terribly hacky MFC code would crash on exit, so I just catched that and gave the user some message like "Successfully closed all Hardware connections. Software will now exit."

0

u/[deleted] Oct 01 '17

[deleted]

19

u/Kopachris Oct 01 '17

Just a guess but I think it might be Wing Commander

14

u/superspiffy Oct 01 '17

I have a sneaking suspicion that it's Wing Commander. Possibly.

8

u/unkz Oct 01 '17

Don’t listen to those other guys, I know for sure that it was Wing Commander.

8

u/burnmp3s Oct 02 '17

It was the video game tie in for the NBC sitcom Wings. In the original version of the game you managed Sandpiper Air and flew various small charter flights in the greater Nantucket area. The bug was in the second expansion pack, Wings: Commander, which was set in an alternative reality Massachusetts where a new American Civil War had broken out and the Hackett brothers' airline was requisitioned by the US government.

2

u/[deleted] Oct 02 '17

That game was amazing, if you made it through the Boston level unscathed and managed to air drop Brian right above the Clint Black after party without getting shot down by confederate pirates you unlocked Frasier Crane.

4

u/miasmic Oct 02 '17

It was Mechwarrior 2

1

u/[deleted] Oct 02 '17

Savage

→ More replies (2)

834

u/[deleted] Oct 01 '17

Taking "it's not a bug, it's a feature" to the next level.

400

u/solepixel Oct 01 '17

Taking "it's not a bug, it's a feature" to the next level select.

FTFY.

92

u/mtarascio Oct 02 '17

Aka 'The Ghandi Nuclear option'.

19

u/MrLucax Oct 02 '17

He can't build wonders forever!

2

u/[deleted] Oct 03 '17

Please Ghandi, let my people live and I will build you a wonder unlike the world has ever seen...

15

u/Draiko Oct 02 '17

WELCOMETOTHENEXTLEVEL

→ More replies (8)

453

u/djhworld Oct 01 '17

This is excellent.

You could only get away with this in video games though, I don't think a "hey you just unlocked a special bonus screensaver!" would go down so well in Windows.

350

u/knirefnel Oct 01 '17

Or in video game hardware... "Congrats, your skills were so high your Xbox has been upgraded to a red night light."

19

u/AetherMcLoud Oct 02 '17

But I want to play a game!

"Sorry, I can't let you do that, Dave."

46

u/oiyouyeahyou Oct 01 '17

Windows has encountered an update, you've unlocked the three hour brick mode. You should make some tea

8

u/AetherMcLoud Oct 02 '17

you've unlocked the three hour brick mode

https://i.imgur.com/cmGndrC.gif

→ More replies (3)

161

u/jeans_and_a_t-shirt Oct 01 '17

Windows's secret level was the blue screen.

13

u/[deleted] Oct 02 '17

Secret? That was the boot screen for Windows ME.

57

u/Red5point1 Oct 02 '17

That was not a secret level because virtually every single user got it without even trying.

The secret level was running it without crashing for more than 48hrs.

16

u/crozone Oct 02 '17

Pre-NT Kernel were some dark, dark times.

9

u/AetherMcLoud Oct 02 '17

The worst timeframe was probably when we had great NT systems in school, but at home we still had 98 with the shitty kernel, since a lot of the consumer software (and games) didn't run on the NT kernel yet.

You saw what could be, but you still couldn't get it.

2

u/Xylth Oct 02 '17

I had a windows 98 system that was up for ~3 months continually. I was very sad when I had to reboot it.

→ More replies (1)

4

u/Richeh Oct 02 '17

I remember a friend of mine ran his computer for days, and was really proud of his uptime.

I'd take the piss, but he used that time to download anime with the cheap phone rates overnight. And shared. So it was worth the occasional IRC status update.

5

u/Mr_A Oct 02 '17

4

u/youtubefactsbot Oct 02 '17

Windows 98 crashes live on CNN [0:43]

Windows 98 is crashing live on tv

^Domvamer in Science & Technology

102,944 views since Mar ^2008

bot ^info

→ More replies (1)

0

u/[deleted] Oct 01 '17

[deleted]

50

u/pineapplecharm Oct 01 '17

Greater than the flight simulator in Excel?

3

u/Reddits_Worst_Night Oct 02 '17

Does that work on modern excel?

36

u/frymaster Oct 02 '17

No, Easter eggs are a fireable offence at MS these days. The idea is these undocumented features can be a source of exploitable bugs. MS don't want e.g. the government pissed because they got hacked due to something that shouldn't have been there in the first place.

9

u/oiyouyeahyou Oct 02 '17

Awwww, what party poopers

→ More replies (2)
→ More replies (2)

2

u/suppow Oct 02 '17

that sounds like people who got into programming to make games, but had to work on software instead.

20

u/Rangsk Oct 02 '17

That said, most modern software does still trap those errors and generates a report to send back to the devs so they can fix it.

10

u/ygra Oct 02 '17 edited Oct 02 '17

But then people get annoyed about "software phoning home" and disable all that. I guess the nice (depending on who you ask) thing about web applications is that the developer can gather telemetry and (some) error reports without the user ever noticing, knowing, or being able to turn it off.

21

u/Chirimorin Oct 02 '17

I'd say error handlers should open a window with the explicit option to send or not send an error report. This way the user has the ability to review what info is being sent and as an added bonus you can add an optional text box so the user can add extra info if they want (which could help finding the bug).

7

u/AetherMcLoud Oct 02 '17

I'd say error handlers should open a window with the explicit option to send or not send an error report.

This. It's how most offline games handle it, and how the PS4 does too for example, and how software should generally handle it. If you're currently offline while the error report tries to send the OS can handle the connection issues like normal.

And as you said while the software crash can already generate some data what happened, the user - if he chooses to - inputting some data of what he did will surely help too.

And then you're not sending stuff over the internet behind the users back.

→ More replies (1)

14

u/jayd16 Oct 01 '17

Lots of apps override the top level exception handler and just send you back to the main screen.

2

u/RenaKunisaki Oct 02 '17

The old "propping up the corpse" method. "No, see, it's not crashed! The process is still running!"

8

u/SkiDude Oct 02 '17

You've unlocked hand warmer more for your phone!

6

u/oliciv Oct 02 '17

Not through a crash, but there was a a secret flight simulator in Excel 97 and you could access the hall of tortured souls in Excel 95.

2

u/Zarathustra30 Oct 02 '17

It works for Chrome.

908

u/Desmeister Oct 01 '17

This is what I love about the internet. Random myths which have been around for who knows how long, and then an excellent direct explanation from the guy himself.

400

u/Dicethrower Oct 01 '17

I know a similar myth story by an old teacher of mine. Here's his explanation: https://youtu.be/U7AcC7Hsu38

tl;dr: In Dino Dini's soccer, a bug in the pseudo random generator caused the AI to behave in a not so fun game breaking way, because emulators cleared the bit of memory the pseudo random generator took to seed itself. Many people still think this game is just terrible, but instead it's just a bug because people play the game 'illegally' on an emulator. Though he admits it's still just a bug all the same.

304

u/Ahjndet Oct 01 '17

idk if I'd personally consider it a bug if it worked as expected on the original hardware and hacked together emulator breaks it. seems more like the emulator has the bug.

94

u/Tdir Oct 01 '17

That's why, in the start of the video, he compares it to a poorly edited version of a book.

62

u/SergeantAlPowell Oct 02 '17 edited Oct 02 '17

if it worked as expected

He does cover that in the video. It would work as expected in most cases on the original hardware. If you were unlucky enough to have those bytes randomly set to 0 on the sram on the original hardware when you bought the game, you'd have seen the bug.

As /u/CyclonusRIP says the bug was the 0 check. But it could have been experienced in the original hardware

31

u/doughcastle01 Oct 02 '17

if the bug requires the first five bytes to be zeroed out as he remembered, that works out to a 1-in-trillion chance. more likely than a bitcoin transaction collision but unlikely enough to be safely regarded as impossible in this context.

the bug stands with the emulator.

16

u/SergeantAlPowell Oct 02 '17 edited Oct 02 '17

It may be a bug in the emulator, but it's certainly a bug in the original game.

The author acknowledges it was a bug in his game. What more do you want?

He had a check to verify the values in SRAM were not 0. The check doesn't work. Bug. Not a particularly serious one, given the probability but nonetheless a bug

18

u/frymaster Oct 02 '17

The memory getting set to zero when it mostly wouldn't be in a real console is an emulator bug. The game not handling the zero case is a game bug

→ More replies (7)

25

u/atrigent Oct 02 '17

It's sometimes hard to assign blame in these sorts of cases, where a piece of software is expected to run only under a very specific set of conditions, and then attempts are made to run it under slightly different conditions. In this case, you could see a scenario where you can't really definitively assign blame to either party - on the one hand, the emulator is not wrong because having the RAM zero'd out wouldn't be an erroneous state for the original hardware, but on the other hand a game that assumes those bytes will be non-zero isn't necessarily wrong either, since, as you say, it is extremely unlikely that this would happen on a real cartridge.

The thing that's different about this scenario is that the developer actually had the foresight to anticipate and check for the case where those bytes are all zero, but he implemented the check incorrectly. He admits to this in the video, and repeatedly refers to this as a bug in the game. And in general, when programming, it's a good strategy to make as few assumptions as possible and design things such that bugs simply cannot occur. What's the point of worrying about that 1-in-a-trillion gamer getting a broken game when you can easily account for that case and remove all doubt? Like a good engineer, the developer did this, but like a human, he unfortunately made a mistake.

All of that said, software written to run within a specific implementation of a system (hardware, operating system, etc) often unintentionally depends on idiosyncratic behaviors of those systems that the designers of the systems didn't intend anyone to depend on. Software that tries to reimplement systems like this (emulators, Wine, etc) are often forced to reimplement these idiosyncratic behaviors to ensure maximum compatibility. So yes, it would probably make sense for emulators to provide non-zero initial SRAM. But you also can't quite say that not doing that is wrong.

12

u/doughcastle01 Oct 02 '17

Well said. Emulators are never perfect, and no one expects them to be, but that's where I place 100% of the blame. I'm not saying that failing to account for non-zero initial SRAM values makes an emulator bad, only imperfect. An imperfect emulator can still be a great accomplishment that I respect.

→ More replies (2)

3

u/qwertymodo Oct 02 '17

You're assuming actually random distribution of values in un-initialized RAM, which is not a valid assumption.

→ More replies (3)
→ More replies (3)

54

u/CyclonusRIP Oct 02 '17

The bug is with the check he had to see if the random number generator seed was 0. He had some code to handle that case, but that code was broken.

14

u/GNULinuxProgrammer Oct 02 '17

The second bug (RNG generation) is an actual bug though since 0 is a valid possibility for the original hardware too. He should have mapped 0 to 1. I'd consider it a bug.

→ More replies (1)

26

u/IlllIlllI Oct 01 '17

From watching the video, it sounds like it's a single assembly instruction -- he intended to check if the seed was zero but used the wrong version of the instruction.

15

u/Tasgall Oct 02 '17

He used the right version of the instruction, but didn't realize it didn't have the same side effects as the other version of the instruction.

3

u/DiaperBatteries Oct 02 '17

Yep, MOV sets the Z flag if you moved a zero, but MOVP, which moves from static ram, does not set the Z flag.

23

u/kermityfrog Oct 02 '17

Nice that he spent time fixing the bug for emulators so that if people downloaded his endorsed copy of the game, it would work properly.

10

u/Bspammer Oct 02 '17

9:50 for the interesting part if you want to skip 10 minutes of the guy complaining that people insulted his game.

9

u/EtherMan Oct 02 '17

There's different types of emulators. This is a bug that happens in emulators that emulate in accordance with the specs of the machine. There's different levels of accuracy on emulators and this emulates just fine on cycle level accuracy, something that higan, bsnes and lsnes all fine, but ofc, cycle accuracy comes at a cost. High accuracy emulation on the other hand, does exhibit this.

And above cycle accuracy, we also have chip accuracy, but we basically don't have any chip accurate emulators running on regular computers. It's something essentially only done on dedicated emulator devices. The NES and SNES classics are chip accurate emulators as an example.

2

u/ThaChippa Oct 02 '17

Oh, oh, hold on, wait... I got somethin' for that... hold on... ahhh...

→ More replies (1)

1

u/qwertymodo Oct 02 '17

I'm really not sure what you're referring to as "chip accuracy". If you mean high-level (faster, less accurate) emulation, then you see that all the time on normal computers (ZSNES, every N64 emulator, etc). If you meant something along the lines of transistor-level emulation like Visual6502, then you're wrong about the S/NES Classic, there's no way you could something like that on such limited hardware. They're basically just Linux SBC's running a normal software emulator.

→ More replies (5)

13

u/Michamus Oct 02 '17

So someone played the game on an emulator and immediately assumed it was garbage? What a dunce.

6

u/Dicethrower Oct 02 '17

Clueless people probably would.

6

u/emptythevoid Oct 02 '17

This was an awesome video, thank you for sharing. I think he'd make a wonderful teacher.

2

u/RenaKunisaki Oct 02 '17

Final Fantasy 1 has a similar "bug". It uses uninitialized RAM as an RNG seed. Since RAM contents at power on are generally unpredictable but tend to follow patterns (which vary between individual chips), some players found the RNG a lot more random than others.

Mario All-Stars also has a bug like this. For a long time there were rumours of early cartridges that had debug mode left on, but nobody could track them down. Turns out it's not a difference in cartridges, but (amusingly enough) a bug. The game never actually sets the debug mode variable, so if you were lucky enough to have a console whose RAM tended to power up with the right pattern, you'd have debug mode.

1

u/dazmond Oct 02 '17

That video could be the star of a show called "Unnecessarily Long Videos".

161

u/BlackMageMario Oct 01 '17

Absolutely genius. Very, very abusive but absolutely genius.

Wonder how the tests today measure up against the tests yesterday.

27

u/drysart Oct 02 '17

Tests for console certification today are every bit as rigorous. There's a reason it's extremely rare to see a console game crash; and its because during testing they do all sorts of awful things to your game to try to make it crash. They'll even pull the power in the middle of writing out save files with the requirement that the half-written save doesn't crash your game. Any crash, anywhere in testing is an automatic certification failure.

(They're also the reason for things like why it's standardized that there's always an active icon on screen when saves are taking place, why there's always a "When you see this icon a save is in progress, do not turn your console off" message once to explain it, why there's always a splash screen you have to press a button to dismiss, why every game works in every possible console configuration, with and without storage available, etc.)

15

u/ZeroThePenguin Oct 02 '17

Yup, I did this sort of testing for about a year with Microsoft. Wasn't a good day if you didn't find an esoteric crash to block release on.

10

u/[deleted] Oct 02 '17

extremely rare to see a console game crash

I played Morrowind on Xbox (the old black brick one, with controllers built for men with huge hands and endurance) and cannot relate to your statement.

→ More replies (3)

2

u/RenaKunisaki Oct 02 '17

I read about a game that didn't bother to give any indication when it saved because the whole process took like 1/10 of a second, but Sony(?) insisted they add something, so they actually added a delay just so they could show an animation to say yes, it really did save.

Really, that was probably a good idea. You might have players with old memory cards that aren't as fast, and it would look like the game was freezing.

1

u/[deleted] Oct 08 '17

Any crash, anywhere in testing is an automatic certification failure.

This isn't entirely true. I know xbox cert will give exceptions for rare or hard-to-repro crashes. It comes down to whether the end-user's experience will be degraded or not.

→ More replies (2)

119

u/RonaldHarding Oct 01 '17

I wouldn't call it abusive. Some bugs really just aren't worth tracking down and undeniably this is a better user experience than the game crashing. I'd bet that this kind of fix will still work against crash tests today, and I'd definitely employ this kind of technique in my own games if the situation felt appropriate.

67

u/2crudedudes Oct 01 '17

Some bugs really just aren't worth tracking down and undeniably this is a better user experience than the game crashing.

Game crashing bugs seem like they'd be worth tracking, though.

8

u/[deleted] Oct 01 '17

Well, yeah, but it is very, very hard if "testers" give you useless bug reports (and from video it seems like that was the feedback after tests)

10

u/[deleted] Oct 01 '17

If a game crashes after being run for more than 48 hours without stopping, that isn't worth tracking down.

14

u/[deleted] Oct 01 '17

Unless game doesn't give you an option to save progress...

→ More replies (16)

10

u/tooclosetocall82 Oct 02 '17

Back when the Sega Genesis was popular most games could not be saved so leaving the console on when you had to go eat dinner or go to bed was VERY common.

→ More replies (1)

1

u/Richeh Oct 02 '17

Well, maybe, but he was taking the opportunity to flush out a load of memory and start from a relatively fresh state. So long as he was certain that the system was in a safe state in the level select, it's a nicely controlled crash landing.

And you can say "a good programmer would tie up all the loose ends" but this is in the days before there was nigh on unlimited man hours to turn out a video game, because there wasn't the insane market that there is now. If you can re-route all the error states into a convenient safe condition that also actually makes people happier then you're much, much better at your job than someone who spends five times the hours hunting down every bug, runs out of time and either tanks the project or turns out a game that crashes.

0

u/[deleted] Oct 01 '17

[deleted]

46

u/RonaldHarding Oct 01 '17

Even bugs that are fixable may have an unreasonable time cost associated with them such that the simple solution of insert a catch all becomes far more economical. I'll always be the first to advocate for Engineering Excellence but programmers have to be reasonable about their scope. It's easy to think that there is a core problem which should be fixed, not always so easy to find and fix that core problem as ship dates get closer and closer.

→ More replies (10)
→ More replies (6)

10

u/Put_It_All_On_Blck Oct 01 '17

I agree it's better than crashing, but I'd still be pissed if I lost my current progress in a level and was just allowed to skip around to whatever level I wanted. I don't play games to beat them (on most occasions) I play them for the experience, and this would be a bad one.

15

u/the_argus Oct 01 '17

To me it's kinda like an apology, "hey sorry we fucked up, here have a go at any level since you were prevented from getting there".

2

u/RenaKunisaki Oct 02 '17

It also ensures that if there's a nasty game-breaking bug in some level, it doesn't make the entire game unwinnable.

10

u/RonaldHarding Oct 01 '17

Bad, but better than a total crash. This is also just one example of handling it in a similar fashion. You could take the user to the beginning of the same level, directly to the boss fight of that level, to the next level, etc. If you're really creative about how you set it up and have some safe memory space to work in you could even reset the stage but put the player right back where they were while playing some funky animation to make it seem like they got a bonus and give them a little power up to disguise it as a random reward. Sure you can always do better, but in realistic development circumstances where time is a factor especially with code quality tests taking weeks to months to complete I totally get this explanation and feel like the programmer did the right thing here.

Also, someone down voted you and that makes me sad because you made a good point. The player DOES lose their progress on the current level with the solution shown here, and if the players ever become aware of why they won't be happy.

→ More replies (1)

1

u/TheGoodOldCoder Oct 02 '17

I agree. It's good practice to handle as many exceptions as possible, as long as you're handling them intelligently. And in a game cartridge scenario, it's probably more fun for the user to be able to pick whatever level they want, rather than to show them some error message.

The fact that he came up with it as an exploitative solution to a testing framework is tangential to the fact that it seems like a good solution for the user, regardless.

7

u/[deleted] Oct 02 '17

Wouldn't work too well these days I think. Cartridge games were practically instant load, and didnt have much in the way of save games. If you tried that with software, people would be like "ok, take me back to my last checkpoint!" and might find themselves in an infinite loop of crashing and resetting..probably

1

u/RenaKunisaki Oct 02 '17

Also those games were much simpler. The essential game state might be only a few bytes. (Level, lives, number of players...) If something went wrong you could usually get away with resetting the whole system and just restoring those few bytes, and the game would go back to the beginning of the level.

Nowadays games are a lot more complex, with dynamic memory allocation, pointers everywhere, an OS, and a lot more going on under the hood. If a crash happens, chances are pretty good that you're hosed. Maybe it's something minor, maybe your entire video subsystem got trashed, you don't know. And to reinitialize the game means going through a bunch of loading screens again, no hiding what just happened. The only sane thing to do is bail out.

The catch is those old CPUs didn't have much error handling. If you followed a bad pointer, instead of triggering a crash handler, you'd just get nonsense data. Your only hopes were to manually check that everything seems OK (which takes up precious memory and CPU time), or that the bug happens to lead the CPU to a "breakpoint" or "software interrupt" instruction that your program doesn't use (so you can install your crash handler there) instead of to an infinite loop or invalid instruction that locks it up.

Fun fact: the Game Boy Pokémon games have a sort of crash handler like this. Opcode 0xFF is a single-byte "call 0x38" instruction, so they never use that instruction, but install a crash handler at 0x38, so if the CPU ever strays into a bad place, it's likely to hit that instruction. Unfortunately they didn't follow through - unused memory is filled with 00 instead of FF, and the crash handler is... just another FF. (Probably in debug versions it did something useful.) So it doesn't always trigger, and when it does, it just freezes anyway.

→ More replies (1)

1

u/riley_sc Oct 02 '17

Lots more TCRs on modern consoles, it's no longer just about the game not crashing but also how you interact with platform features like game invites and achievements. Tons more resources go into testing as well. But in many ways it hasn't scaled nearly as much as the complexity of games has.

1

u/Rudy69 Oct 02 '17

It's not like they could somehow patch it later. This was by far the best way to handle it (at least I can't think of a better way). What do you think the end user would prefer? A game that crashes or being able to warp past the problem and move on to the next stage?

Remember we're talking about unforeseen bugs here

1

u/suppow Oct 02 '17

implying that there are tests today

0

u/[deleted] Oct 02 '17

[deleted]

5

u/riley_sc Oct 02 '17 edited Oct 02 '17

Okay think about that for half a second. In order to have a release date patch you must have found and fixed the bugs before the release date.

Day 1 patches are about not aligning a development schedule to the physical requirements of pressing and shipping discs (which is like 2 months where everyone just used to go on vacation), they really don't have anything to do with not finding bugs.

1

u/RenaKunisaki Oct 02 '17

Well, it's possible they found a bug after shipping but before the official release date.

209

u/WinEpic Oct 01 '17
try{
    //entire game goes here
} catch (Exception e) {
    StartGame();
} 

38

u/Dentosal Oct 02 '17

Remember to wrap in in a loop.

9

u/ctburley Oct 02 '17
public void StartGame(Game self) {
  try { //game 
  } catch (Exception e) {
    self.StartGame(); 
}  }

2

u/matthieum Oct 02 '17

And how do you handle the StackOverflow?

7

u/TooManyLines Oct 02 '17

Just flag it as a duplicate.

2

u/ShinyHappyREM Oct 02 '17

close more topics

→ More replies (2)

0

u/[deleted] Oct 02 '17

[deleted]

9

u/Likely_not_Eric Oct 02 '17

Better hope the compiler unrolls it or you'll overrun your stack after a few decades.

→ More replies (2)

21

u/ghillisuit95 Oct 02 '17

more like

__attribute__(interrupt(_ILLEGAL_OPCODE_VECTOR)) void level_select();

14

u/CertifiableNorris Oct 02 '17

This guy gets interrupts

6

u/crozone Oct 02 '17

This guy interrupts gets interrupts interrupts

4

u/twowheels Oct 02 '17

Stack Overflow

2

u/[deleted] Oct 02 '17

Ahh, that reminds me of an application I worked on at my previous job whose behavior was eerily similar to a virus for Android phones. We did something like that simply to swallow Android letting you know that it had crashed.

0

u/[deleted] Oct 02 '17

[deleted]

21

u/Bravot Oct 02 '17

IF bug THEN feature

13

u/dougsliv Oct 02 '17

IF big THEN true

14

u/MrModez Oct 02 '17

IF true THEN big

FTFY

9

u/Sloshy42 Oct 02 '17

Or, more concisely,

return (big)
→ More replies (2)

3

u/ZiggyTheHamster Oct 02 '17

Big the Cat Fishing Adventure confirmed

16

u/jl2352 Oct 01 '17

That's genius!

11

u/LordOphidian Oct 02 '17

Similar to a Crash Room, or Chris Houlihan room.

It’s a great way, in gaming at least, of not having to show the user an error when things go wrong.

16

u/[deleted] Oct 01 '17

Dr. Ian Malcolm would love this. Now matter how stringent your controls, someone will find a way to violate them.

13

u/pineapplecharm Oct 01 '17

Developers, ah, find a way.

3

u/nermid Oct 01 '17

This isn't violating the controls, though. It dumps to the level select, which is the control.

13

u/[deleted] Oct 01 '17

I'm talking about the quality controls Sega had in place. The author of the article found a way to circumvent them.

0

u/[deleted] Oct 02 '17

[deleted]

5

u/[deleted] Oct 02 '17 edited Oct 02 '17

The quality controls worked as intended

Their policy was no crashes. This game prevented Sega from detecting crashes by surreptitiously resetting the game on a crash. I'm sure that's not what Sega intended.

Customers didn't complain about crashes

Because the game was stable and didn't crash much. That's an orthogonal topic to whether their QA was circumvented.

Imagine you're playing through a Sonic, you're almost at the end of a tricky level, and suddenly you're on the "secret level select screen", all progress erased. If that happened a lot, you'd be annoyed. Fortunately, the game was well written and stable, but that doesn't mean this trick wasn't a direct circumvention of Sega's QA policy.

It's also clever as hell, which kinda goes hand in hand with the game being well written.

1

u/btcraig Oct 02 '17

Users will find a way [to break your code].

7

u/Zanoab Oct 02 '17

I wonder if the Chris Houlihan room in A Link to the Past exists for the same reason. You go to the room when the game would normally crash from being unable to decide which room you are entering. What if the devs disguised the crash as a secret room in case quality control at Nintendo finds a game breaking bug during room transitions?

2

u/RenaKunisaki Oct 02 '17

Seems likely. Super Mario World and Yoshi's Island assign destinations of doors/pipes on a grid system, but use the player's location instead of the pipe's to look it up. If you manage to enter a pipe from a different grid cell than intended, you end up in the default room. (In SMW it's a bonus game but there's no way out; in YI it's level 1 but you start way in the sky and fall and die.) Probably Zelda works similarly, but they had the foresight to make the default room a secret bonus.

4

u/pbadwee Oct 02 '17

The video is definitely fantastic, but does anyone know what the music used for the background track is?

4

u/MagnesiumHappy Oct 02 '17

"Is That You or Are You You" by Chris Zabriskie

2

u/pbadwee Oct 02 '17

THANK YOU!

I actually already had this album saved on Spotify, knew I had heard it before.

2

u/MagnesiumHappy Oct 02 '17

You are welcome. I only recently heard it for the first the first time, so I had the name fresh on the mind.

4

u/CubistGenealogy Oct 02 '17

As a kid I was jumping around one of the levels in Sonic 3D Blast on the Mega-Drive. All of a sudden when I jumped in a certain location I unlocked level select! Great! Now I can go straight to Panic Puppet Zone! I tried to replicate it by jumping in that same spot for hours but couldn't find it.

A few months later I discovered the method mentioned in the video by accident. Most times when I hit the cart the game would just crash, but I discovered (in the most 90's way possible) that holding a Tazo parallel with the cart and flicking the Tazo with my finger delivered a well tempered hit on the cart that (in my mind, at least!) had a much higher rate of success.

4

u/bengalviking Oct 02 '17

So rather than annoying the player, they are rewarding them for finding a bug.

Absolutely brilliant.

3

u/RadicalDog Oct 01 '17

Great video, thanks for linking. I checked some of his others, and I am definitely subscribing.

3

u/PurplePickel Oct 02 '17

Holy shit, that guy programmed Mickey Mania? That's awesome, I used to love that game!

1

u/swan--ronson Oct 03 '17

And Toy Story. Still amazed by how well the first-person level was implemented, especially on the Mega Drive as it didn't support sprite scaling.

3

u/akher Oct 02 '17 edited Oct 02 '17

Hey, why try to improve your product's quality when you could spend that time circumventing quality control tests!

3

u/Skizm Oct 02 '17

The is the equivalent of surrounding every single line of code in a try/catch block and catching the most generic Exception/Throwable object you can.

3

u/Shambly Oct 02 '17

Are you saying the pokemon approach is flawed?

1

u/Skizm Oct 02 '17

No, I'm saying it is nice to see that these battle tested design patterns are still in use today!

6

u/[deleted] Oct 01 '17

Wow man. Well done, and I could also imagine some debugging session go horribly wrong if someone in dev didnt't know the ruse. Well played

6

u/Yawzheek Oct 01 '17

October 1st, and I think I've already found the best thing I'll see all month.

4

u/Goron40 Oct 02 '17

Your code can't crash if you just wrap the entire game in a try/catch block...

1

u/Schwarzy1 Oct 03 '17

but what if it goes to the catch but then the catch block causes a crash? Endless try/catches?

1

u/Goron40 Oct 03 '17

Catch can't crash if you don't put anything in it.

2

u/ColeSloth Oct 02 '17

It's not a bug. It's a feature.

2

u/[deleted] Oct 02 '17

This is awesome.

2

u/principlesofass Oct 02 '17

Not knowing a DANG thing about programming, that music in the background made this video creepy

2

u/callosciurini Oct 02 '17

That guy sounds like Chris from the Clickspring channel.

2

u/Singularity42 Oct 02 '17

Seems kinda related to this video I saw the other day: https://www.youtube.com/watch?v=s0XmiXs8iRw

2

u/[deleted] Oct 02 '17

"Privilage exception"

2

u/humanoideric Oct 02 '17

Uhh woah, great insight, subbed.

1

u/Mentioned_Videos Oct 02 '17 edited Oct 02 '17

Other videos in this thread: Watch Playlist ▶

VIDEOCOMMENT
Do you hate Dino Dini's Soccer? One tiny bug, a world of hurt.+278 - I know a similar myth story by an old teacher of mine. Here's his explanation: tl;dr: In Dino Dini's soccer, a bug in the pseudo random generator caused the AI to behave in a not so fun game breaking way, because emulators cleared the bit of mem...
(1) Excel 97 Easter Egg - Flight Simulation (2) Hall Of Tortured Souls (Easter Egg) Excel 95+2 - Not through a crash, but there was a a secret flight simulator in Excel 97 and you could access the hall of tortured souls in Excel 95.
Windows 98 crashes live on CNN+1 - Or 40 seconds:
Microsoft Excel (Web Components) 2000 Easter Egg - Dev Hunter+1 - and the GTA of Excel2000
"The Security of Classic Game Consoles" by Kevin Shekleton+1 - Seems kinda related to this video I saw the other day:
I'm a bot working hard to help Redditors find related videos to watch. I'll keep this updated as long as I can.

Play All | Info | Get me on Chrome / Firefox

1

u/travelsonic Oct 02 '17

It was funny to accidentally stumble across this when I was little, but a part of m wondered why this happened. Mystery solved!

1

u/Recursive_Descent Oct 02 '17

Damn that explains a lot. I remember hitting this once when I was a kid, but I had no idea how I got there and was never able to get back. So much random button mashing in hopes of recreating the secret input.

1

u/PaulgibPaul Oct 03 '17

Whoa. This is fantastic.

1

u/nharding Oct 03 '17

Can someone confirm if that works on the Saturn, the code was VERY close to the original implementation. Although I didn't implement the interrupt vectors.

-5

u/Gefrierbrand Oct 01 '17

I guess the modern equivalent would be.

for(;;) {
  try { 
    startMainGameLoop();
    return;
  }
  catch(...) {
    
  }
}

10

u/nermid Oct 01 '17

for(;;)

Why not while(true)?

13

u/[deleted] Oct 01 '17
because {

}

people have style preferences
{

}

Unless I'm missing something. Does while(true) run more efficiently than for(;;) ?

13

u/the_argus Oct 01 '17

I posted a pretty interesting so thread to op, basically both optimized the same these days but the for loop was quicker in days of yore

4

u/Yuzumi Oct 01 '17

At this point in time compilers are smart enough to know when you are doing an infinite loop and so it the same way.

2

u/nermid Oct 02 '17

If your style preferences make your code less readable, your style preferences are bad and you should feel bad.

3

u/happyscrappy Oct 01 '17

It's linux coding standards. As far as I can tell it is that way because it is shorter. It's shorter than while(1) or while(true)

1

u/PM_ME_OS_DESIGN Oct 02 '17

Some old/basic compilers still bother to check whether true is true, in the while loop, which is slightly slower than for(;;).

1

u/sumsarus Oct 02 '17

To me "while true is true" is kinda nonsensical.

→ More replies (2)
→ More replies (1)

-2

u/TheOmnipotentPilot Oct 01 '17

It's amazing how many developers do this.