Geeks With Blogs

News


George Clingerman       XNADevelopment.com

G360-1 I’ve always enjoyed using Nick Gravelyn’s exception handling in all of my games. You’re always going to encounter those unhandled exception that your players are going to ferret out and having a method to display them rather than just crashing to the dashboard is definitely more of an elegant solution. But the other day I got to thinking…what if we could do more? What if instead of just displaying the error, we could encourage the players to send us the error. So I started playing with that an expanding upon Nick’s sample code to see what I could come up with.

I got close to what I envisioned, but unfortunately there were some limitations to just what the XNA API could do. In my head I was picturing the players hitting “Send Message” and a 360 message would just be sent to the XBLIG developer. Unfortunately, you can only send messages in an XNA game to someone you’re currently in a network session with. Since I didn’t want to have a 360 server running all the time, virally connecting to players just to get error messages, I did the next best thing and just open up a 360 message and encourage them to manually enter the gamertag. Maybe someday we’ll be able to do that a little better, but this works for now.

In the sample, players can hit the “A” button or key to generate in an exception. If the debugger is not attached, then the Exception message screen will be shown explaining what has happened and giving the player a chance to send a 360 message to the gamertag provided or maybe even just send an email. Nick’s code has been changed just a bit. It now accepts any PlayerIndex (no longer hard coded to just PlayerIndex.One) and it no longer uses a MessageBox to get the users selection. The code has also been modified so that it works both for the 360 and for the PC.

Check out “Tell me what’s wrong!” and let me know if you have any thoughts or suggestions. I really do appreciate the feedback.

Posted on Saturday, April 3, 2010 8:45 PM | Back to top


Comments on this post: Tell me what’s wrong! – An XNA sample demonstrating exception handling and reporting in your XBLIG

# re: Tell me what’s wrong! – An XNA sample demonstrating exception handling and reporting in your XBLIG
Requesting Gravatar...
Very nice extension to nick's work. Unfortunately, when I've tried to port your solution into my engine, I got error 4 on console, but only if I start the game by the dashboard. If I run it by the XNA Connection Studio it works very well. The PC version always work.

I need to investigate more, because your version runs well on my console. But if you have some idea about what error 4 is, it will help me:)

Thanks
Left by Vando on Apr 14, 2010 5:53 PM

# re: Tell me what’s wrong! – An XNA sample demonstrating exception handling and reporting in your XBLIG
Requesting Gravatar...
Just added this to Hypership. Thanks George!
Left by Kris on Jul 28, 2010 1:50 AM

# re: Tell me what’s wrong! – An XNA sample demonstrating exception handling and reporting in your XBLIG
Requesting Gravatar...
I am happy when reading your blog with updated information! thanks alot and hope that you will post more site that are related to this site.
Kingspan Insulation
Left by sooperdooper on Aug 21, 2011 7:25 AM

# re: Tell me what’s wrong! – An XNA sample demonstrating exception handling and reporting in your XBLIG
Requesting Gravatar...
Well this is a very nice tutorial and I learn a lot of good things from this blog... I really like this blog... Thanks for the help... latest news today
Left by umair on Oct 26, 2011 12:46 PM

# re: Tell me what’s wrong! – An XNA sample demonstrating exception handling and reporting in your XBLIG
Requesting Gravatar...
Just added that to Hypership. Thanks George!
Left by Berufstest Berufswahltest on Nov 04, 2011 12:46 AM

# re: Tell me what’s wrong! – An XNA sample demonstrating exception handling and reporting in your XBLIG
Requesting Gravatar...
Great and excellent post. Thanks.
Left by Get Back Together With Your Ex on Jan 12, 2012 6:15 AM

# re: Tell me what’s wrong! – An XNA sample demonstrating exception handling and reporting in your XBLIG
Requesting Gravatar...
I have experienced some errors when I played games before, but never wasted my time to figure out why it happened. Thanks for providing the details. Your description explains well about the gaming platform and the error caused. Thank you.
Left by click on Apr 18, 2013 4:07 AM

Your comment:
 (will show your gravatar)


Copyright © George Clingerman | Powered by: GeeksWithBlogs.net