Game Development Community

(SOLVED - Noob User Error) Particle Emitter causes Game to Crash...

by Richard Lackinger · in Torque X 2D · 08/07/2009 (8:10 pm) · 7 replies

So, I have Torque X 2D 3.1, Platformer Starter Kit 3.1, Visua Studio Express 2008 and XNA 3.1. I can add particles to my scene and play around with them. Problem is as soon as I try to play my game in debug mode (through Torque or Visual Studio) as soon as the particle emitter gets on the screen the game crashes. This occurs even if I just add an empty particle emitter to the scene. I am guessing this is not a bug as I seem to be the only one having this problem, but I am tagging it as such just in case.

I thought that someone may hopefully have some insight on what I am doing wrong. Any direction or thoughts would be helpful.

Thanks!

About the author

Currently working as lead designer and reluctant programmer for Edward Usher a Torque X 2D platformer based on the works of Edgar Alan Poe. Check it out at www.silveragegames.com


#1
08/08/2009 (7:31 am)
Hey Richard,

I'm guessing that your getting this problem on the Xbox 360? If so, it is a known issue that many people have. The problem is that that image you are creating for the backbuffer exceeds 10Mb and forces the Xbox 360 to go into predicate tiling mode. You can get past this problem by reducing this size by making the backbuffer a smaller resolution or turning your sampling down.

I made a pretty thorough explaination of it in this thread.

If this is on the PC, can you explain the crash in more detail? Is there an exception that gets thrown?
#2
08/08/2009 (2:34 pm)
Thanks for the reply Lucas,

I did come across the post you refer to regarding the 360 but I am indeed encountering this issue on the PC and without even adding an image material to the particle emitter.

I am using Window Vista 32-bit. I can place a particle emitter at the end of my level, play the game in debug mode, and as soon as I reach the point where the particle emitter gets on the screen it goes white, and I get a pop-up that says "PlatformerStarter has stopped working" and when I look at the details it tells me this:

Description:
Stopped working

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: platformerstarter.exe
Problem Signature 02: 2.0.0.0
Problem Signature 03: 4a7ce385
Problem Signature 04: GarageGames.TorqueX.Framework2D
Problem Signature 05: 3.1.0.0
Problem Signature 06: 4a4c709f
Problem Signature 07: b0
Problem Signature 08: 8
Problem Signature 09: System.NullReferenceException
OS Version: 6.0.6002.2.2.0.768.3
Locale ID: 1033

Sorry if I am leaving out anything or if it is something obvious as I am a novice programmer at best and just started using Torque X. Thanks again for your help and let me know if you need any more info.
#3
08/09/2009 (9:12 am)
Hey Richard,

There isn't enough information here to really pin-point the problem. It looks like you are getting a null reference exception somewhere. Do you have access to the TX2D source code?

Before you start the application with a debug build first enable exceptions. You can do this by going to Debug -> Exceptions and check the Thrown checkbox associated with Common Landguage Runtime Exceptions. This should make your code break at the exact place the exception occurs.

When you get this point, obtain the call stack and post it here along with the exception. That should give me enough information to look into it. Let me know if you have any questions about any of these steps.
#4
08/09/2009 (5:48 pm)
Thanks for the instructions. Hopefully this is the info you need (if not I may need some educating on obtaining the call stack):

Quote:
System.NullReferenceException occurred
Message="Object reference not set to an instance of an object."
Source="GarageGames.TorqueX.Framework2D"

StackTrace:
at GarageGames.Torque.T2D.T2DParticleEmitterData.get_TextureCoords()
at GarageGames.Torque.T2D.T2DParticleEffect.Render(SceneRenderState srs)
at GarageGames.Torque.T2D.T2DSceneGraph._RenderObjects(TorqueObjectType renderMask, Single aspectRatio)
at GarageGames.Torque.SceneGraph.BaseSceneGraph.PreRender(GFXDevice gfx, TorqueObjectType renderMask, TorqueObjectType noRenderMask, Single aspectRatio)
at GarageGames.Torque.GUI.GUISceneview.OnRender(Vector2 offset, RectangleF updateRect)
at GarageGames.Torque.GUI.GUICanvas.OnRender(Vector2 offset, RectangleF updateRect)
at GarageGames.Torque.GUI.GUICanvas.RenderFrame()
at GarageGames.Torque.XNA.TorqueEngineComponent.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.Draw(GameTime gameTime)
at GarageGames.Torque.GameUtil.TorqueGame.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.Run()
at PlatformerStarter.GameStarter.Main(String[] args) in C:UsersAdministratorEdward UsherGameEdwardUsherEdwardUsherGameMain.cs:line 24
InnerException:
#5
08/09/2009 (6:31 pm)
Hey Richard,

This is fine, this is exactly what I needed.

It looks like a possible problem to this issue is having a null material assigned to the particle emitter. Have you assigned a valid material to your particle emitter?
#6
08/09/2009 (7:02 pm)
Okay, first I want to thank you soooooo much for all your help. You rock. And I am not just saying that to butter you up so you won't get mad when I tell you the stupid thing I was doing (but hopefully it helps).

So, when I drop an emitter on the screen, I would go into edit and name my emiter, and press the green + button to create the new emitter... totally ignoring the untitled emitter that had already be made. So I would assign a material to my new emitter, but there was a pre-existing emitter already made with no material that I was ignoring.

So to sum up, you rock, I don't, and thanks so much for your help. Because of you my game can now have fireflies in the background. :)
#7
08/09/2009 (7:24 pm)
Hey Richard,

No problem, Torque unfortunatly is not a very forgiving framework sometimes :)

Good luck with your game!