Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Genjix

Error Checking versus Speed

This topic is 5164 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
What do you mean? Do you mean you don''t want to do any kind of error handling because of speed issues? Ummmmm, you should do error handling regardless. If you get an error how would you know what happened ir where it happened at? You release a game and the user gets an error, how would you know what to fix? I don''t get it...

-UltimaX-
|Designing A Screen Shot System|

"You wished for a white christmas... Now go shovel your wishes!"

Share this post


Link to post
Share on other sites
I use assertions to check for conditions that should never ever happen, then hope that they don''t crop up in release builds. For really significant things that would, say, make the user''s computer blow up, then I add error checking in addition to the assert.

I also wrote an exception class hierarchy for the app, but I suppose that doesn''t really answer your question.

Share this post


Link to post
Share on other sites
You should only use assert''s on things that should never happen. For example, asserting that a pointer isn''t null in a memory copying function is perfectly legitimate. However, asserting something that might fail depending on something at runtime, e.g. user input, should never be done.

Share this post


Link to post
Share on other sites
I highly doubt the overhead of error checking will be that much of an issue in your game. Having said that, my method is to use error checking for anything that can reasonably go wrong at run time (user presses an invalid key, can''t find a server, etc.) and thow an exception for everything else that I catch in my main function and terminate nicely with a little error message. As I''ve said, I doubt the speed is really that much of an issue, and I find this system to be easy to use and maintain, and yet functonal enough for gameplay and debugging.

tj963

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!