A slew of questions about maximizing game speed:
1. All other things being equal, which will make your game run faster: if you code a command in many lines, or bunch everything onto one line?
For example, if you say "If Global Value A = 1, then create a box, candle, horse, etc." all in one line.
But you could do it the other way to. Enter separate codes for each item: "If Global Value A = 1," then create a candle." Next line: "If Global Value A = 1, create a horse," etc.
Does it make any difference to the speed of your application?
2. Does using "DirectX" make your application slower or faster? Or no difference?
3. Does it slow down the game if you have huge unused canvases for your active objects? Let's say you have a rock that's about 10x10, but the canvas for it, since you were too lazy to crop it, is 90x90. If the sprite has to lug this big empty area around, will it slow down the game, or will it make no difference since that is, after all, empty space?
4. Let's say I want a ball to flash red and blue. Two ways to code this: The first is to have two frames of animation only, and simply alternate between them.
The other way is to make, say, 50 frames of blue animation staggered with 50 frames of red animation for the time that I need it flashing.
Will it make a difference to game speed which way I code it?
5. All other things being equal, which will result in a faster game speed: having an active object assume 13 different animations, or create 13 different objects?
Take the "prize" in Ms. Pac Man. This could have appeared as a lot of things (apple, banana, cherries, etc.), yet its behavior was the same.
But let's say you have a lot of those roaming around your screen at the same time. In this case, does it make your game faster if you create several different objects (with different names), or if you simply change the animation sequences of one single object?
6. I assume that if you limit your game to 320x240 and only 256 colors, it'll run a lot faster. But I'm only assuming. Is this true?
7. Does it make a difference if I code an object's behavior in the object's properties versus in the events editor?
For example, when ball hits bat, ball flies away. I can code this into the ball's global behavior, or I can write a specific for it in the events editor. If we're talking about a lot of objects here, will it make a difference for game speed?
8. What lags the program more: having to destroy aan object and then create it again, or having to make it invisible and then make it reappear? Is there a difference?
For example, say I want the 7 snowballs to suddenly disappear and then reappear later. If the speed of my game is paramount, should I code this as destroying/recreating or becoming invisible/reappearing?
Thanks all.



Reply With Quote

