Login | Register

Speed issue

October 23, 2006, 16:34 by Calle
[loading]
-->
<b>Question:</b> The reason for this is because in my platform game, there will be some points in the game where my character will swim underwater (I made water an object). This is very annoying because I want my game to run as fast as possible with little or no slowdown involved.

<b>Answer:</b> Efficiency and speed in programming is intresting. Game Maker makes it even more intresting *laughs*

It is well known that Game Maker easily slow down. What you must try to avoid is code the loop many time or in other way take long time to process. Especially for object there are a lot of. For an example, if you have one object with a loop of 30 repeats, and you add 20 of that object; then you have a speed equal to a loop with 600 repeats.

This is the problem. It has nothing to do with the visual stuff though, but you must try to limit the checks that you perform.

What I would do: I would make one large sprite which covered all of the water, or at least I would limit it such that I only needed a few objects. Otherwise I'd draw the visual stuff through code.

I would still need the same code, but the effect would be much less devastating since I do not add processing time upon each other. Instead of 30 * 20, I get 30 * 1.

Comments

Loading comments... [loading]
.
Users logged in:

game maker articles, game maker examples, game maker tutorials, gmtutorials, game maker questions and answers, game maker crash course, how to create games