2
\$\begingroup\$

I'm currently working on a game project that involves tricking the user into thinking the game experienced a bug/glitch and crashed. The reason that I want to code this is that I want to hide the file size of the main game, thus separating it into two files. So I want the first file which has x amount of game to crash at a certain point. Then manually give the second half of the game to the user and they can continue on. It may seem a little pointless, but I think stylistically this is a neat concept to try.

\$\endgroup\$
5
  • 9
    \$\begingroup\$ This is a fantastically un-friendly thing to do, and is not even remotely required to accomplish your (unusual) goal of "hiding the file size" by shipping the game in two executables. \$\endgroup\$
    – user1430
    Mar 15, 2016 at 16:13
  • 1
    \$\begingroup\$ very poor practice imo, the community should not answer this and encourage such behaviour, however that said, perhaps you could "simulate a crash" then continue to run the game, as a gamer myself I would not buy a game that deliberately crashed (personal opinion of course) \$\endgroup\$
    – War
    Mar 15, 2016 at 17:31
  • \$\begingroup\$ There are roughly a billion and one ways to make a program crash (trust me, I've accidentally seen most of them), so do whatever you feel like doing to mess it up. Divide by zero, access a negative index in an array, open a file that doesn't exist, or go wild, allocate huge arrays until you run out of memory. If you want to be irresponsible, get creative. If you want to behave like a normal person, ask yourself why you would want to hide half of your game. It's not like file size says anything about play time. \$\endgroup\$
    – Peethor
    Mar 15, 2016 at 18:02
  • \$\begingroup\$ assert a false condition \$\endgroup\$ Mar 15, 2016 at 18:35
  • 1
    \$\begingroup\$ Can we not be critical of this question simply because we don't agree with the game design? Our job is to answer his question if we can, not tell him we disagree with his design. \$\endgroup\$
    – Tim Holt
    Mar 9, 2019 at 5:43

5 Answers 5

13
\$\begingroup\$

Intentionally causing a crash is a somewhat irresponsible way to develop software. Instead of actually making the game crash, simulate a crash. Use messed up graphics, fake BSOD, etc. Then simply close the application.

This approach allows you to have far more control over the style of the crash. Further, it doesn't introduce potential consequences of forcing an application crash on the end user's computer.

\$\endgroup\$
4
\$\begingroup\$

I would suggest you try this simple thing:

Divide by zero.

\$\endgroup\$
2
  • 4
    \$\begingroup\$ The one thing that will save us from the AI revolution. \$\endgroup\$
    – jgallant
    Mar 15, 2016 at 16:28
  • 1
    \$\begingroup\$ For the record, dividing by zero in an RPG Maker MZ script will not cause the game to crash. If the numerator was positive, it will report the result is "Infinity". If the numerator was zero, it will report the result is "0". I have not tested exhaustively to see how this is handled in other RPG Maker versions, nor to check whether it's actually storing a result of zero, or storing NaN and printing it to text as 0 instead. \$\endgroup\$
    – DMGregory
    May 30, 2023 at 19:47
0
\$\begingroup\$

It is indeed a irresponsible practice in game development. It's been done before- the fake crashes that is. And splitting the executable into 2 pieces then calling on another to open is just time wasted. You can make a intentional error, cause it to crash and proceed from there. But a better way is to just past a BSOD gif or animation over their screen. Have it throw it's self into full screen right before it happens and then just toss the photo on.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Just out of curiosity, do you remember examples of when it was tried before? \$\endgroup\$
    – MAnd
    Mar 16, 2016 at 8:31
  • 2
    \$\begingroup\$ @MAnd: Eternal Darkness: Sanity's Requiem sometimes displayed a fake BSOD as one of the effects of sanity loss - which fooled nobody as it wasn't even on a Windows PC. Also, a 1980s text adventure based on the TV series "The Prisoner" had a real crash at one point. The intent was that the player had to make a change to the code and GOTO a specific line to continue - the game was in interpreted BASIC running on one of the 1980s home computers that used the BASIC immediate mode as a shell. \$\endgroup\$ Mar 12, 2019 at 10:20
0
\$\begingroup\$

If you do want to make RPG Maker crash, it is not simple, as RPG Maker cannot usually crash through any kind of script call, or such. You can make a fake Error, and close the game, however, making the game crash, is basically impossible, unless it somehow occurs naturally.

The reason why, is when RPG Maker experiences a coding error, or bug, unlike most engines, will always throw a Code Error, then close itself, without any problems, besides that.

\$\endgroup\$
4
  • 6
    \$\begingroup\$ "throw a Code Error, then close itself, without any problems" if that is not the description of a crash, then what do you consider a crash? \$\endgroup\$
    – Vaillancourt
    Mar 9, 2019 at 1:22
  • \$\begingroup\$ @Vaillancourt I'd consider a crash to be an unhandled exception, not one handled farther up the stack. \$\endgroup\$
    – Basic
    May 30, 2023 at 12:13
  • 1
    \$\begingroup\$ @Basic Yes, although, often, if the exception is not handled by the software itself, the OS will show a message box of some kind informing the unexpected shut down of the application. From the end user point of view, a crash is generally a popup message of some kind, then the app shut down (maybe not in that order). IMHO, whether it is done at the app level or at the OS level will look the same w.r.t. how the user perceives it. \$\endgroup\$
    – Vaillancourt
    May 30, 2023 at 13:18
  • 1
    \$\begingroup\$ the OS will show a message box of some kind informing the unexpected shut down of the application. Or to put it another way, the process crashed. Crashing the OS is a different question entirely. NB: I'm not arguing the app should crash (I'd just fake it all in-game), I was just pointing out the difference between a framework catching an exception (presumably in styled, in-canvas way) and a genuine crash to desktop. \$\endgroup\$
    – Basic
    May 31, 2023 at 1:24
0
\$\begingroup\$

You can use a script call in an event:

window.close()

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Won't this make the game close and not crash though? \$\endgroup\$
    – Vaillancourt
    Sep 28, 2019 at 22:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .