• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Dec 15, 2012 at 09:02 AM by burnpsy for the following reason:

The question is answered, right answer was accepted

avatar image
2
Question by burnpsy · Jan 16, 2012 at 03:42 PM · crashsavesaving

Deliberately Forcing the Game to Crash

Due to a certain plot point in a platformer I'm working on, one character is "too awesome", so the game is planned to save and then crash when the player first approaches him the first time and only the first time.

But I'm stumped on how to force a crash that would do so on all computers without possibly damaging their system. Actually, I'm stuck on how to make the game crash in general. How would I go about this?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Sericet · Jan 16, 2012 at 03:53 PM 0
Share

I'm new to unity but isn't there a application.quit? Could you not just set a variable to record if this encounter has happened before and change it to true before quiting the application?

if (//Condition(walk up to super awesome dude) && encounter == false) { encounter = true;

application.quit (or somthing like this) }

avatar image burnpsy · Jan 16, 2012 at 04:32 PM 0
Share

Well, yes, but that doesn't quite have the required effect.

1 Reply

  • Sort: 
avatar image
4
Best Answer

Answer by BiG · Jan 16, 2012 at 03:54 PM

I don't think that's possible in a "safe" way - however, a "crash" is, by definition, an unwanted behaviour of an application: this implies that's impossible to "planning" it. Even if you hack the memory consuming (that's very not reccomended!), you can 't be sure to obtain the same behaviour on different machines, or if your game will be played 5-6 years after its creation, on more powerful machines.

For your purpose, I will acting in a different way (maybe less "stunning" for the final user): save the game, pop up a text like "This character is too awesome! Your game will be closed in a moment, 'cause it cannot handle that...) - or something similar -, wait for some seconds with a "yield WaitForSeconds()", to allow the player to read that, and then close the application with "Application.Quit()".

EDIT (another idea): Sorry for re-open that, already closed, question. But I've just had another idea, and maybe you could be interested. Take a snapshot of a Windows error popup, and make it as a texture. "Paste" it onto a plane, and make a new scene in which you visualize that plane. You have just made a fake error popup. When you encounter that character, save the game, unload the actual scene, and load the scene that I've just explained! Then, if the player click in proximity of the "OK" button, you will close the application with Application.Quit(). Pay attention, you also have to adapt the resolution of the application at run time (look here), to make a credible popup. It's just a Photoshop trick and, obviously, a Mac standalone would be a little out of place in the end, with a Windows error! ;)

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image burnpsy · Jan 16, 2012 at 04:36 PM 0
Share

Understood. Oh well...

Your idea makes sense, and I think I may know how to make it look more realistic and restore the general effect. First off, I could put a translucent white filter over the screen to replicate what happens in Windows when something crashes, and then make a load of pop-ups appear all over the screen saying messages such as "Overloaded with awesomeness, unable to properly run.", and then the program closes.

avatar image by0log1c · Jan 16, 2012 at 05:45 PM 1
Share

While I think the crash then pop-up idea is quite interesting, I'd avoid throwing many of them as it does remind me of the behaviour old crappy websites did a few years ago. Having to click many/click faster than pop-ups was really unappreciated. Just stick to one and I believe user response will be better - just my two cents! :D

avatar image BiG · Jan 16, 2012 at 06:19 PM 0
Share

@burnpsy, you could also be interested in another approach, a little more tricky. Just look at the edit in my original answer.

avatar image burnpsy · Jan 16, 2012 at 07:55 PM 1
Share

I like that idea as well. The general idea is the same, though. Rather than making it crash, I just make it look like it crashed.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Saving problem unity project 5 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Saving player stats for each level, static class or not ? 1 Answer

how to save a load a game? 1 Answer

Can only Save in on scene 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges