Compiles but locks up when generating chunks
#6
Yeah, well, web technologies don't support much debugging as such. C++ is different in this way.

You can have (and are advised to have) asserts - those are conditions that you *believe* should be true, but just in case, you test them. Because such tests can be costly, you don't want them in the release version, so they're compiled in only in the debug version. If such an assert fails for some reason, the debugger will show you exactly what went wrong.
For an example of this, have a look at the cChunkDef::GetBlock(). It checks if all three coords are valid. But you don't want this check in the release, because you *know* the code doesn't pass invalid coords. This particular assert is actually quite useful, it bites me personaly a few times a month, when I code something and forget to convert between relative and absolute coords, or something similar.

Debugging logging is useful for having a sneak peak at some values or at what codepaths are taken while the game is running, without actually going through the debugger. Usually if you set a breakpoint and step through the debugger, the client will disconnect shortly because of a timeout. Logging allows you to see stuff without that. Also, logging is written to a file, so you have a reference even after the program terminates.
Reply
Thanks given by:


Messages In This Thread
RE: Compiles but locks up when generating chunks - by xoft - 06-21-2013, 01:32 AM



Users browsing this thread: 1 Guest(s)