77 lines
3.0 KiB
HTML
77 lines
3.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
|
|
<html>
|
|
<head>
|
|
<title>Speed considerations</title>
|
|
<link href="style.css" rel="stylesheet" type="text/css">
|
|
</head>
|
|
<body background="images/back.gif">
|
|
<!--START-->
|
|
|
|
<h1>Speed considerations</h1>
|
|
|
|
If you are making complicated games you probably want to make them run as fast as possible.
|
|
Even though <i>Game Maker</i> does its best to make games run fast, a lot depends on how
|
|
you design your game. Also, it is rather easy to make games that use large amounts of
|
|
memory. In this page we give some hints on how to make your games faster and smaller.
|
|
|
|
<p>
|
|
First of all, look carefully at the sprites and backgrounds you use. Animated
|
|
sprites take a lot of memory and drawing lots of sprites takes a lot of time.
|
|
So make your sprites as small as possible. Remove any invisible area around it
|
|
(the command <b>Crop</b> in the sprite editor does that automatically). The same
|
|
applies to background images.
|
|
If you have a covering background, make sure you switch off the use of a
|
|
background color.
|
|
|
|
<p>
|
|
If you use full screen mode, make sure the size of the room
|
|
(or window) is never larger than the screen size. Most graphics cards can
|
|
efficiently scale images up but they are more slow in scaling images down!
|
|
Whenever possible, switch off the cursor. It slows down the graphics.
|
|
|
|
<p>
|
|
Also be careful with the use of many views. For each view the room is redrawn.
|
|
|
|
<p>
|
|
Besides the graphics, there are also other aspects that influence the speed.
|
|
Make sure you have as few instances as possible. In particular, destroy
|
|
instances once they are no longer required (e.g. when they leave the room).
|
|
Avoid lots of work in the step event or drawing event of instances. Often
|
|
things do not need to be checked in each step. Interpretation of code is
|
|
reasonably fast, but it is interpreted. Also, some functions and actions
|
|
take a lot of time; in particular those that have to check all instances
|
|
(like for example the bounce action).
|
|
|
|
<p>
|
|
When you need complicated processing (for example for advanced AI), you better write
|
|
a DLL for this in a different language and create an extension package out of this
|
|
to import the DLL using the functions described in the page on <A HREF="414_00_dlls.html">Using DLL's</A>.
|
|
</p>
|
|
|
|
<p>
|
|
Think about where to treat the collision events. You normally have two
|
|
options. Objects that have no collision events are treated much
|
|
faster, so preferably treat collisions in those objects of which there are
|
|
just a few instances.
|
|
|
|
<p>
|
|
Be careful with using large sound files. They take a lot of memory and
|
|
also compress badly. You might want to check your sounds and see whether
|
|
you can sample them down.
|
|
|
|
<p>
|
|
Finally, if you want to make a game that many people can play, make sure
|
|
you test it on a number of different machines, in particular also older machines.
|
|
|
|
|
|
<!--END-->
|
|
</body>
|
|
</html>
|
|
|
|
<!-- KEYWORDS
|
|
speed
|
|
fast games
|
|
testing
|
|
memory consumption
|
|
--> |