Is there anything we have to do about a sound that is playing getting cut off when another sound starts playing?
No. Our framework does that. The historical reason is that on some platforms, two sounds playing at once sounded awful and there were limitations to the way we could control sounds, so we arranged to have a currently playing sound be aborted when a new one started.
Yes.
Suppose that while calling doSomething() for each actor during a given tick, we create a new actor. Must we call doSomething() for the new actor on the current tick?
It's you choice whether or not you do. Of course, on the next tick, doSomething() will be called on all actors including that new one.
What can I do to be more confident that my program will build for you when you test it and is not likely to have some flaw that will cause it to crash most of the time when you try to run it?
Run our sanity checker on the Linux server. If it tells you you passed the sanity check, then even if you have a lot of things left unimplemented, we will probably still be able to test those features you have implemented.
Here's what to do:
/usr/local/cs/bin/p3sanity
The sanity checker does a simple test to check that loading a level doesn't crash (even if there are objects you haven't yet implemented), the player and walls at least are probably put in the right place, a player probably moves correctly, and cleanup and destruction of the StudentWorld doesn't crash. This is generally enough for us to test your program without it crashing on almost every case.
Why might a program that appears to work for you crash for us most of the time? It's usually because it relies on undefined behavior. A common issue is either your assuming that a pointer you don't explicitly initialize is null or your intending to initialize it to null and forgetting to do so. On your machine, it might happen to have the bit pattern of the null pointer representation, so it appears to work for you, but on our machine, it might not.
If your program built for you on your machine but doesn't build under g32, it may be that you're doing something that is not Standard C++, such as
If attempting to make an actor of type X do something crashes and you can't fix the problem before it's time to submit, that could well make even the first call to StudentWorld::move crash for a level that has a type X object in it. In that case, it's best to have the X object's doSomething just return immediately or perhaps after it does only as much as you know doesn't crash.
Why is the sanity checker reporting memory leaks when it finishes?
Your program is allocating objects with new
that it's never
deallocating with delete
. The likeliest causes are one of these: