You are on page 1of 29

Martin Crownover:

Multiplayer Games
Plus… Instant Collisions
Ammunition
Arrays & Lists
Clever AI
Registry
And Much More!

Interviews Resources Previews Reviews Tutorials


EDITORIALS
Teamwork Pt. 2 EDITORIALS Contributors This Issue
Robin Monks Sr. Editor
Welcome to Issue 5 of MarkUp, the only $12/month. Eyas Sharaiha Editor
active GM magazine officially endorsed Jason Stockton Writer
by YoYo Games  Google Docs & Spreadsheets Phil Gamble Writer
http://docs.google.com Gregory Writer
Continuing from last month’s discussion mr.gibblet Writer
on last month’s discussion on how to Google’s collaborative office tools let Bart Teunis Writer
most effectively have a game multiple people work on documents Michael Sharaiha Writer
development team (the concepts will simultaneously. Perfect for working on Sean Flanagan Writer


work with most any team however) we team plans and the like.
go on to.....

Sharing work
When you are working in a geologically
separated team, you need an efficient
way to store and distribute work, and to Table of Contents
list who will work on what. Editorials
Teamwork - Part 2 ............................. 2
Email can help with this to an extent, The MMORPG Makers ...................... 5
but there are a lot of good (and free) SVN 3D vs. 2D Games .............................. 10
tools out there that can make the SVN is the ultimate way to keep source Tutorials
process a lot easier. code files synchronized between
Arrays vs. Lists.................................... 4
members of a team; it can work for just AI: A Clever Opponent ....................... 6
Basecamp one person (to keep play-by-play File Search Functions ......................... 9
http://www.basecamphq.com/ backups) or for 10,000 people. Ammo .............................................. 15
Game Maker and the Registry ......... 21
Basecamp is probably the most well
Instant Collisions .............................. 23
known online collaboration tool. It lets
Reviews
you manage “projects” (the free version
allows only one project, with unlimited Seiklus (17) ....................................... 11
participants), with events, deadlines and Arena ............................................... 13
Coaster Rider ................................... 27
issues. It works like a specialized forum,
2P Shooter ....................................... 28
allowing team members to track every
detail of the project. Resources
GMR Featured Resources .................. 3
Dev Tools - Dragon Script .................. 7
Script of the Month ........................... 8
Interview of the Month


Best of all, you can get SVN hosting for
Martin “FredFredrickson” Crownover ... 18
free. Two popular sites to get said
hosting are assembla.com and
unfuddle.com.

See you next month!


The free plan allows only one project, Robin Monks 
has no on-site file storage, and doesn’t MarkUp is a gmking.org publication;
use SSL. You can get premium versions please visit GMking for more free game
with more features starting at development resources!
2|Page July, 2007 Photo © Freddy Thorvaldsen
http://markup.gmking.org
EDITORIALS
GMR Featured Resources EDITORIALS
One of the easiest ways to improve your Resources; the key difference being the
knowledge of Game Maker and discover Simon Donkers plural on the end… Although this site
new possibilities is to use examples. http://xrl.us/simondonkers doesn’t have truck loads of examples it
Examples are a great way to include is slowly growing as it’s a user based
extra features in your game or to submission site that has many user
discover new ways of creating things. submitted examples; many of those
This month I am looking at some of the being 3D examples.
great places to find the examples you
need. As the site is user submission based
some examples may be lower quality
than others so check any feedback
GM Tutorials before downloading (if the example has
http://gmtutorials.com/ been reviewed or rated).

Conclusion
So what if you want complete game Still can’t find what you want?
examples? Check Simon Donkers out. GameMakerResource.com has links to
His site has a complete collection of full plenty of other Game Maker sites with
working game examples created in examples for you to download; so if you
GM5 and 6 including breakout, snake, can’t find what you want here, jump on
Pacman and more. There are also a few there and browse the rest of the sites in
examples that aren’t full game our listing.
examples there as well.
Remember as with all resources to give
credit where credit is due. Creators
GM Resources deserve credit for their time and effort.
http://xrl.us/gmres
Jason Stockton,
GameMakerResource.com 
Know what you’re looking for? GM
Tutorials has a group of creators who
constantly add to the list of examples on
Tinyweb
The tinyweb DLL is a web
the site. There are currently over 200

QUICK REVIEW
browser DLL that allows you to
examples and tutorials ranging from RTS
embed either local .html
examples to fog or even a scroll bar
documents in your game, on
example. Just go to the site and have a
even better, allow your game to
look.
open certain sites within. There
The tutorials are handier for novices as are other browser DLLs out
they provide a bit of a walk through to there, but this one is tiny, easy
go with any examples that they may to use, and comes as an
include with the tutorial. extension, library, and a bunch
No it’s not the GM Resource, its GM of scripts as well. The source is
also included.

Get it now!

http://markup.gmking.org July, 2007


QUICK REVIEW
http://xrl.us/tinyweb
3|Page
TUTORIALS
Arrays vs. Lists TUTORIALS
The concept of arrays is basic and much faster and resource-friendly than This could be also done by copying a list
familiar to the majority of the arrays. So if you care about speed, lists of participants to other lists, and
programming languages out there. An have a good advantage. Not only that, removing unqualified teams.
array is a variable that is capable of but lists also can have data inserted to
storing multiple values, according to its them in the middle, added to the end, Another application is the use of
“indexing”, so that a long list is copied
index – which could be 1-dimensional or sorted and re-sorted at any time, and
2-dimensional in Game Maker. more. Lists just fascinate me! to different smaller lists, and all the list
items except for those starting from a
However, Game Maker contains an The major disadvantage of lists is that particular letter are removed. This
excellent data structure – lists. A list is they are not saved with the game! So if results in having smaller lists, each
always 1-dimensional, and contains you’re game utilizes save/load, you’ll having values starting with a single
different values (sorted or not). Many either have to make your own save letter. When those are further sorted,
other data structures exist in Game mechanism (like I did for one of my they could be used in an index-like
Maker, such as stacks and queues. What projects), or just make a script that atmosphere, such as a dictionary.
makes lists special is that it has direct- loads the list after loading the game.
access, as opposed to their sequential Getting List Size
On the upside, though, Game Maker When using arrays, we almost always
access.
already provides reading and writing have to include another variable that
It might be easy to establish how arrays functions for lists, so you can easily save acts as a “counter”, so that the game
differ from regular variables, and how scripts to files and load them. only performs certain operations on the
lists differ from other data structures. number of items that are there in an
But the real question is: when to use Where lists shine array. A list eliminates the need for such
lists, and when to use arrays – and I’ve mentioned the good points of lists variable.
which is better? in short before, but here’s some info
about what’s really great about lists: Easy Insertion of Values
Understanding the differences Easy insertion of values to scripts is one
To be able to wisely choose which Copying Lists of the things I LOVE about them! To
A list could be copied from one id to properly insert a variable in an array, a
method to use for a particular case, the
another. This could hardly be achieved loop should be performed to move all
differences between lists and arrays
by arrays – but with lists, it only requires items occurring on or after the point of
must be established.
a single quick function. Copying a list is insertion one further step. This is all
First, a clear advantage of arrays over more useful than it seems, but its done automatically with lists, and not
lists is ability of using 2-dimensional applications depend on the way you’re only that, but also much faster (in terms
arrays to form ‘tables’. Lists particularly using the lists in the first place. of execution speed).
fail at this, and storing multiple
For example, a list could be used to Easy Removal of Values
variables in a “row” might lead to the
store multiple copies with multiple Once a value is deleted from a list, all
need for string manipulations, or other
arrangements. Such an application values fix their positions. Basically, it is
tricks.
allows a host of things to be done, the reverse of “Easy Insertion of
The use of CSV files to store data has including simple procedures such as Values”, something that also isn’t
been covered in the previous issue of finding the mode of values. natively available for arrays.
MarkUp, and such an application is
A more specific example is something Searching Capabilities
better implemented with arrays.
like a “soccer tournament”. We see in The searching capabilities for lists are
However, lists have their own all FIFA games how teams are drawn up
advantages as well. First of all –
according to Mark – handling lists is
– such that teams in the quarterfinals,
semi-finals, and finals are all displayed.

4|Page July, 2007 http://markup.gmking.org
TUTORIALS
Arrays vs. Lists Cont. TUTORIALS
extremely useful. You can find the value “cards” to the AI for strategy games, or variable[4]=6;
of a list row from its position, or get that the order of events in a timeline for
list’s ID by writing its value. Both give another. But in lists, a ds_list_replace function
great possibilities, especially when used needs to be called, and the position of
in conjunction with other list functions, Where Arrays Shine the row needs to be known (since with
such as sorting. You can find the nth insertion and sorting, it’s constantly
Tables changing) using yet another
nearest instance from a particular
Thought variable[4] arrays could be
object, etc. ds_list_find_index function. So it could
useful, something I really like about
be pretty painful at times.
Sorting arrays is the use of two-dimensional
One of my favorites! You can sort all arrays, like this variable[6,3], to locate Conclusion
values in a script either ascending or a value’s position both on x and y. The Though lists could be used for
descending. This also works for both use of two-dimensional arrays as tables everything, and arrays could be used for
numbers and text pretty well. This is is very interesting but will not be everything – some things are better
pretty useful when using the list data discussed in any further detail in this handled by one mechanism than the
structure to draw and actual list on the article. other. Everything could be achieved, but
screen, which could become long. when the results are the same, you
Changing Values
might have to consider what is easier
Shuffling! Changing the fourth row of the array
and quicker to write, and which is faster
I’m in LOVE with shuffling. It has so “variable” from 5 to 6 is pretty simple in
to execute.
many uses, ranging from the obvious arrays. A simple line of code:
Eyas Sharaiha 

EDITORIALS
The MMORPG Makers
I’m not sure if I missed something when the week. The more experienced users fell apart (though if anyone is
I joined the GMC. I think there were a will be coyer about their plan and then interested in reviving it, contact me).
set of rules for new members which I either decide not to follow it through or The truth was, of course, that I knew
somehow didn’t find. It’s a great shame disappear for a few weeks as they work nothing near enough about creating
I haven’t found them really. At least on a starting demo. multiplayer games and I just wasn’t
then I might be able to understand the up to it.
more chaotic of people’s decisions. The truth is that creating a MMORPG
takes an awful lot of work. You need to What I’m trying to say, I suppose, is
In almost every board on the GMC, it is set up servers, understand all the online that you have to know your
possible to find a topic by someone functions inside out and also create limitations. Although you should
wanting to create an MMORPG. This something that’s actually worth playing. always try and do your best, and
person usually would have joined in the Nobody wants to look at their player make a game as well as you can, you
last few weeks, or has been around for standing in a room and not being able to shouldn’t try and do something that
at least a year and a half. There’s rarely move them. you’re incapable of. It just doesn’t
someone in between those times. follow. Having said that, if you can
I tried to make a MMO once. It was do, you should go for it.
The new members will be really going to be a platform game where the
enthusiastic about their project, user could design their character and Gregory 
expecting to have a game better than then use it to explore the online world.
big names like RuneScape by the end of When I got to making it multiplayer…it

http://gmc.yoyogames.com
http://markup.gmking.org July, 2007 5|Page
TUTORIALS
AI: A Clever Opponent TUTORIALS
The burden of creating artificial piece of code: Put this code in the create event, too.
intelligence is that it is so hard to
program. Professional developers can
{ And there we go. Now we have our grid
mp_grid_create(0,0,room_width/16, all set up and ready, so the last thing we
take months or even years just figuring room_height/16,16,16);
out AI for a single enemy. Luckily, Game }
do is make the enemy follow the path.
Maker comes with a feature that can Path? Did someone say path? Oh, that’s
help this problem, which is motion That creates our grid. But we want to be
right. Before you go on, make a
planning. able to refer to it. So, we change it into:
completely empty path with nothing in
Motion planning is a simple yet effective { it. Call it pth_move. This may sound
grid_id = mp_grid_create(0,0, funny to you, but you’ll understand.
way of doing ‘search’ AI. In this tutorial, room_width/16,room_height/16,16
you can learn how to make your own ,16);
}
Now, here is the big finale. In the step
search AI and have an enemy chase event of the enemy, put the following:
after you. More information is provided
Now, we can refer to the grid by using
in the GM Manual > GML > Gameplay > {
the variable grid_id. mp_grid_path(grid_id,pth_move,x,y
Motion Planning. This tutorial is for
,obj_player.x,obj_player.y,true);
creating a basic. More can be done, Well, we have created a grid, but that path_start(pth_move,1,0,false);
though. does not mean it does anything. It just }
sits there, soaking up your RAM and
The first thing you need to do is set up a I’ll tell you what this does.
CPU process. So, now we have to make
grid the MP will be worked out on. This mp_grid_path sets the path we selected
it do something.
is simple, and can be done with one (pth_move) and edits it so that it
function. Let’s say that we have an object, becomes a path between the starting
obj_block, that we want our enemy to point (3rd and 4th argument, enemy x
In the create event of your enemy, type:
go around and try to catch the player. and y) to the goal (5th and 6th argument,
{ Here, we use the following piece of obj_player.x and obj_player.y), it sets
mp_grid_create(left,top,hcells, code: the grid that we put this path on,
vcells,cellwidth,cellheight);
(grid_id), and finally, the 7th argument,
} {
mp_grid_add_instances(id, allows diagonal paths (if you want
object,prec); straight lines, set this to false.)
Now, to set this up, we first have to
}
specify the left and top of the room.
The next piece of code simply starts the
This is obviously 0, 0. That part is easy. Let me explain this. The MP grid works path. It starts pth_move at a speed of 1
Next, we have to decide how many cells on spaces that are available and (this can be changed.) Warning: DO NOT
go horizontally. To do this, we must first unavailable. So, to make our enemy go CHANGE THE LAST TWO ARGUMENTS.
figure out the width and height of our around the unavailable spaces, we want This will make the path be un-relative
squares. You will usually want either to set obj_block as unavailable. We can and try to loop. You DO NOT want this!
16x16 or 32x32. Let’s say we’re making also add the grid id, which we defined
a game where the AI searches on 16x16 inside of grid_id. Prec is short for Well, that’s it, a guide to using search
squares. So, the cell width is 16, and the precision. You should usually switch AI. This article only covers the basic
height is the same. Now, we can get precision on to create a better effect. So functions, but you can look in The GM
back to figuring out how many should now, we can modify our code to this: Manual > GML > Gameplay > Motion
go horizontally and vertically. Note that Planning for more information. I hope
{
in order for this to work, the room this guide will be of use to you as you
mp_grid_add_instances(grid_id,obj
width and height must be a power of _block,true); progress in your AI career.
the width and height. So, for hcells and }

vcells, we instead type this finished Sean Flanagan 


6|Page July, 2007 http://markup.gmking.org
DEV TOOLS
Dragon Script vs. GM Editor DEV TOOLS
When it comes to coding, I’m very showing tools which could potentially of what the function does, explains it
simplistic. I make websites using only be useful at some point but which seem arguments and links you to the relevant
Microsoft’s Notepad and would happily to get in the way when you’re trying to article in the Game Maker help files.
code GML in that as well. So you can code. Although the main typing window
imagine how I felt when I took my first is quite obvious, it is a bit overwhelming
look at Dragon Script recently. and difficult to figure out where to start.

I notice too, that Dragon Script seems


very separate to GM. It seems like a
completely separate program.
Admittedly, it is, but the built-in editor In conclusion, I think Dragon Script is
feels like it’s part of GM itself, whereas very useful tool for people new to Game
DS feels external, in the same way that Maker Language. It has lots of tools to
using word to edit GML files would. explain functions and keep everything
on hand. However, I think more
I think my real distrust stems from two
experienced users would find the built-
things: Primarily, I’m not used to it so
in editor better as they don’t need the
I’m wary and a bit confused. I want my
fancy look-up tools but instead just a
old editor back. Secondly, the colour
plain window to quickly edit their codes.
The only difference I find between scheme is different. This may sound
Notepad and the built-in GML editor really picky but it’s something I can’t Switching to Dragon Script
(below) is that the latter has colour help but noticing. I’m extremely used to First, select the “Scripts and Codes” tab
coding and a quick reference at the seeing my variables show up in light in the Game Maker Preferences:
bottom. This suits me very well – both blue and constants in brown but here,
of those features are really useful when that isn’t the case. Fortunately the
coding. They help me to lay out my colour system, as in Game Maker, is
screen and remind me of all the fully customisable.
arguments I need to know. Select to “Use external code editor” and
But I can’t really spend this whole article then enter the path for the Dragon Script
saying that the built-in editor is better exe:
than Dragon Script because I would be
prejudice and very unfair. Dragon Script
has some great features which make
coding so much easier. The auto-
complete feature works similarly to the
prompt at the bottom of the GML editor You can click on the “…” button to find
but also tells you what each prompt the program in your files:
I think the thing which I really love actually is (functions, constant,
about the built-in GML editor is its variable), which can be a great thing for
simplicity: it’s very, very basic. Which is new users of Game Maker Language
wonderful. There’s nothing around to who are not entirely sure what
distract you, nothing there which you everything does.
suddenly feel you should be using.
The other main special feature of
Gregory 
Dragon Script is very different. Its Dragon Script for me is the Function
interface is covered in buttons, Look-up which, surprisingly enough
textboxes and drop-down boxes, all looks up functions. It gives a description
http://markup.gmking.org July, 2007 7|Page
SCRIPTS
Powered by:

Script of the Month GMLscripts.com SCRIPTS


Our favourite GML script resource – GMLscripts.com – has done **
** Arguments:
it again, releasing over 100 GML scripts! One of the scripts that
** session the editing session ID provided by
have really appealed to me is called sprite_edit_begin which sprite_edit_begin()
initiates the editing of a sprite by taking advantage of a feature **
** Returns:
introduced in Game Maker 6.1: Surfaces. ** nothing
**
** Notes:

Script #1: sprite_edit_begin ** Ends the editing session started with


sprite_edit_begin, replacing
/* ** the old sprite with the edited sprite and freeing the
** Usage: editing surface.
** session = sprite_edit_begin(sprite) **
** ** Dependencies:
** Arguments: ** sprite_edit_begin()
** sprite sprite to edit **
** ** GMLscripts.com
** Returns: */
** session an editing session ID {
** var session, p, surface, sprite, w, h, n, prec, tran,
** Notes: smth, load, xoff, yoff, temp, i;
** Begins a sprite editing session. All draw commands are session = argument0
directed to a p = string_pos(':',session);
** surface holding the a horizontal strip of each of the surface = real(string_copy(session,1,p-1));
frames in the sprite = real(string_copy(session,p+1,10));
** given sprite. When finished editing, call function w = sprite_get_width(sprite);
sprite_edit_end() h = sprite_get_height(sprite);
** to implement the sprite changes and to reset the drawing n = sprite_get_number(sprite);
surface. prec = sprite_get_precise(sprite);
** Resets blending mode to normal. tran = sprite_get_transparent(sprite);
** smth = sprite_get_smooth(sprite);
** Dependencies: load = sprite_get_preload(sprite);
** sprite_edit_end() xoff = sprite_get_xoffset(sprite);
** yoff = sprite_get_yoffset(sprite);
** GMLscripts.com temp =
*/ sprite_create_from_surface(surface,0,0,w,h,prec,tran,smth,load
{ ,xoff,yoff);
var sprite,a,w,h,n,xoff,yoff,surface,i; for(i=1; i<n; i+=1) {
sprite = argument0; sprite_add_from_surface(temp,surface,w*i,0,w,h);
a = draw_get_alpha(); }
w = sprite_get_width(sprite); sprite_assign(sprite,temp);
h = sprite_get_height(sprite); sprite_delete(temp);
n = sprite_get_number(sprite); surface_reset_target();
xoff = sprite_get_xoffset(sprite); surface_free(surface);
yoff = sprite_get_yoffset(sprite); }
surface = surface_create(w*n,h);
surface_set_target(surface);
draw_clear(c_black);
draw_set_blend_mode_ext(bm_one,bm_zero); Use
draw_set_alpha(1);
Using this set of scripts is simple – all you have to do is begin
for(i=0; i<n; i+=1) {
draw_sprite(sprite,i,i*w+xoff,yoff); with a sprite_edit_begin() script call, start using draw
} features in the same event and then save the sprite by
draw_set_blend_mode(bm_normal);
draw_set_alpha(a); calling the sprite_edit_end() script.
return (string(surface)+':'+string(sprite));
} Such a procedure doesn’t have to be put in the draw event,
since after it is complete one time, the sprite will be saved
like that, and could be used at any time.
Script #2: sprite_edit_end
/* Eyas Sharaiha 
** Usage:
** sprite_edit_end(session)

8|Page July, 2007 http://markup.gmking.org


TUTORIALS
File Search Functions TUTORIALS
File Search functions in Game Maker return multiple values – so only a single include wildchars (*) which basically
have a multitude of uses, and are crucial value will be returned for the first file means any character or a group of
to several types of games. Compared to finding function. Other files will be characters.
other functions, it is hard to make up returned in the find next function.
creative uses for file search functions, So, using “*” as the mask would result in
since what they do is pretty straight The order of how the values are having all files being returned. Using a
returned is ascending, so a file called “*.txt” would return all text files in that
forward – find files.
“armor.csv” will be returned before given directory. Using “hello_*.gmk”
“bike.ogg”. would result in returning all folders that
The Basics have the gmk extension and begin with
Though many people think of file search “hello_”.
as a limited mechanism to find a single
Arguments
file, it actually is capable of finding The file_find_first() function The Attributes
requires two arguments: the mask and The attributes argument is a (collection)
multiple files under the same
conditions. To start finding files, the the attributions. While the find next of real-valued variables that could be
file_find_first() function is used.
function has no arguments, as it relies added up together using regular
After that function, file_find_next() on the find first command. addition “+” in Game Maker. For no
functions could be used to find the next attributes, the real value 0 is used. Here
The Mask is a set of variables to be used with the
file under the same conditions as those
The mask for a file is a string that should attributes in the table below.
outlined in the first command.
match with both the name and location
To close the ‘thread’ of file-finding, a of the file to be found. The mask could
simple file_find_close() function is
Variable Description
used. After such functions, “find next”
functions cannot be used anymore. fa_readonly A read only file

fa_hidden A hidden file


Order of File Finding fa_sysfile A system file
Obviously, if multiple file possibilities
fa_directory A directory
existed for a search conditions, multiple
files need to be returned. Also a well fa_volumeid A volume-id file(which represents the
known fact is that Game Maker doesn’t volume of a drive)
QUICK REVIEW

fa_archive An archived file files that are read-only,


To return
MIDI Notes hidden, and system files, (fa_readonly
+ fa_hidden + fa_systemfile) is used.
This small DLL allows anyone to
play any note on any MIDI
instrument. You could either Returned Values
choose the notes and If such a file exists, only the name of the
instruments to play, or simply file will be returned. This means that the
play an entire MIDI file. The path (location) of the file will not be
DLL comes with two examples, returned, however, the file extension
both GM6. will be part of the name returned.
Get it now!

QUICK REVIEW http://markup.gmking.org


http://xrl.us/MIDINotes

July, 2007 9|Page



TUTORIALS
File Search Functions Cont. TUTORIALS
If the file being searched for does not f2+"\"+string(filename_name(file))); still find their ways to multiple games,
file_delete(f1+"\"+string(file));
exist, an empty string (“”) will be both with Game Maker on the GMC and
file=file_find_next();
returned. This could be used to count } other commercial games as well.
the number of files satisfying a certain file_find_close();
set of conditions by using a simple while Finding files could be useful in multiple
Counting files in a folder ways – either when searching for a
loop that adds 1 to a counter each time
file_find_next()!="". //Script: count_folder() particular file in multiple destinations,
//count_folder(string folder); or even searching for a file which’s exact
//Folder must not include final backslash
F0=string(argument0);
name is not known. File finding
Applications i=0; functions could be used to create folder
file=file_find_first(F0+"\*",0); operations, or just as a method of
Copying All Folder Content while(file!="")
storing settings, counting files, etc.
{
//Script: move_folder()
i+=1;
//move_folder(string folder1, string One good example I can now think of is
//folder 2); file=file_find_next();
//Folders must not include final } counting the number of .sav files in a
//backslash courtesy of Eyas Sharaiha, file_find_close(); directory so that a game could display
//featured on MarkUp
the names of all saved games in a
f1=string(argument0);
f2=string(argument1); certain directory.
file=file_find_first(f1+"\*",0); Conclusion
while(file!="") While finding folders might not have All in all, the possibilities are endless!
{ that many “different” uses – these uses
file_copy(f1+"\"+string(file), Eyas Sharaiha 

EDITORIALS
3D vs. 2D Games
The comparison between 2D and 3D very extendible, multi-dimensional someone would need to make a
games is, to most, striking. Whilst 3D situation whilst 2D is preferred for Pacman or space invaders game in
games give you a sense of depth and simple, smaller games. 3D. If anything, this would take away
three vertices to play with, 2D can only the fun of it – the original, traditional
attempt to give a real-world feel…and The third dimension allows producers of
gameplay element.
tends to fail. games to make various different
extensions to simpler 2D gameplay. A It is the extendibility of 3D games
But why is it that 3D games are more first-person-shooter can give the player that make them so popular to the
popular to gamers of today? Looking at the opportunity to hide behind walls or gaming audience. It's not often that a
the top video game sales at Tesco’s above their opposition; something 2D game is made that has a great
earlier this morning, only one of the which 2D top-down games cannot offer storyline and complex and dynamic
twenty shown did not have a 3D so easily. In racing games too, the third gameplay. With 3D, that's a breeze.
environment. But said game was dimension can give a z-axis, letting cars Thus, you can make a simple mini-
interface based and so was barely 2D go off ramps, or really fly in collisions. game in 2D very successfully but, if
either. you want to make something really
That isn't to say that 3D is the best
vibrant and exciting, 3D is what
The main gaming difference between arrangement to use though. Simple
should be used.
2D and 3D is, in my eyes at least, is what arcade or puzzle games work perfectly
you can do with each one. 3D provides a in 2D. There is absolutely no reason why Gregory 

10 | P a g e July, 2007 http://markup.gmking.org


REVIEWS
Seiklus (17) REVIEWS
Where do I begin? Well maybe because Also there are some aspects of the keys technique, it never gets old, easy
this game is somewhat confusing, game that you don’t know why they are to use and above all everybody is used
because this game has too many good there for, like the Piano – what is it for? to it.
and bad points that it is difficult to talk Obviously you have to play a tune but
about but I’ll do it anyway. there is no indication of that anywhere. 10/10 now really how can it get any
Something should indicate that, as I said other score, tell me?
It is very addictive, well until you finish
there are many aspects of the game
the game then you just throw it away, that remain as I see vague and
not that that’s a bad thing because this Presentation
unanswered.
is the case with every short term “Press ‘s’”, that is how the welcome
addictive game, and it’s just a personal screen is, then “press ‘1’ ‘2’ ‘3’” to chose
choice of the author. which of the three saves to continue,
but is this really what you call nice,
cause sure it is boring and lacks
Game play stimulus.
A simple addictive game, I do think that
after playing it I won’t really play it There is no indication about buttons, I
again. But none the less it did achieve replayed parts of the game once too
many times over and over again
addictively even though short term, you
know it’s one of those games you have because I did not know what it was, by
to play because it is worth it, but it all the way it is “S”.
comes down to, I think, whether you
want to play it again, and in this Controls Story line
category it failed remarkably. The simple up, down, left, right arrow The story begins by the player being
blasted off a mountain away from his
girlfriend/sister/wife, and then nothing
gives indication of what is your main
objectives, well at least until you get to
the lights near the cave exit.

The story is, I don’t know how to say


this, short, ok the areas are not very
predictable but there is no indication of
the story other than in the beginning.

Graphics
Game graphics are those of platform
games can’t really judge them because
that is how old school games should
look, I do not think platform games have
reached their full graphics potential, but
that is no one’s fault as much as those
commercial developers, they got us


http://markup.gmking.org July, 2007 11 | P a g e
REVIEWS
Seiklus (17) Cont. REVIEWS
used to the idea that platform games
should look like this.

Only problem is the shape of the


character he could have been done
better i.e. not just a white, more than
cartoonish ghost like man, try putting
on some cloths on him.

Music Conclusion
Sound effects
Turn off your speakers and on with your The game is addictive yes, but it gets
Well, there are very few sound effects in
headphones! How could anyone stand boring after a while, in my opinion the
the game but they are generally ok, the
that much repetition, but on there game achieves greatness if the player
game does need more especially during
“plus” side there are silent areas were wishes to play it more than once which
movement, walking of jumping not just
you get no music, so I urge you if you this one has failed miserably.
when being kidnapped, taking the
are playing this game put on your own colored fire things, or playing the giant It all starts here,
playlists on your music player, the music piano. Michael Sharaiha 
at first is stimulating but after a few
minutes of game play it starts to get Conclusion
annoying.
Pros: Enjoyable theme,
gameplay, and overall feel.
Ratings
Cons: Unpleasant to the Game Play
eyes and ears. 10

Overall 8 Controls
Download Size: 2.6MB 6
Download Type: Game .zip 4
Author: clysm, autofish.net 2
Released: 8/15/03 Sound FX 0 Presentation

Get it Now:
http://xrl.us/seiklus
Music Story line

Graphics
12 | P a g e July, 2007 http://markup.gmking.org
REVIEWS
Arena REVIEWS
awkward reaching across your depending on the options you select. If
What they say opponent to the other side of the your opponent dies before you, you
Arena is the two-player game where keyboard. With a vast array of in game win. It doesn't matter whether your
opponents battle within the confines of customisation available and Arena's opponent is killed by sentries, yourself
a random maze. With lots of options amazing random maze generator, each or a combination of the two. If the
and multiple paths to victory, Arena is game really is different. option is selected you can win if at any
never the same game twice. This is a stage during the game you have full
It is possible to win within seconds or
great rivalry game where two good health - of course for this to work
games can last 20, 30 minutes or more - players must not start with full health.
friends can sit down and blast away at
it all depends on how you choose to set There are also circular bases dotted
each other. This is my first original video
up the game and your starting position around the maze, the number of which
game.
in relation to sentries, bases, powerups can be specified in game setup. If any
and your opponent. one player controls all bases they win.
Review
A key aspect of the game is
Arena lives upto and exceeds my
customisation - there is so much about
expectations. I first downloaded this
the game you can modify and this can
game in 2003 and I am still playing it
change the game dramatically. You can
today. Games which have two players'
control the availability of powerups,
controls contained within a single
these consist of double fire toggles,
keyboard often spell disaster, however
bouncing bullet toggles, and coins which
in Arena there are no key clashes, or
represent health.
As well as setting
the number of each
kind of powerup to
be randomly distri- As well as your opponent you also have
buted around the to watch out for the in-game sentries.
maze, you also de- These patrol certain areas of the maze
cide whether or not in a straight line, constantly shooting
the powerups are out. If you get hit by a bullet you loose
replenished during health, but beware sentries will also
the game or if once collect powerups to improve their
they are taken they bullets and increase their health if they
are gone. You can are in their path. Sentries also collect
even export your bases if they come across one, so watch
favourite configur- out!
ation to be loaded
next time you play As a two-player game Arena makes use
Arena. of Game Maker's views function to
enable a split screen, one side following
So, what is the aim each player around the maze. If you're
of the game? There quick you may be able to grab a sneaky
are a number of glance of your rival's location, but
different ways you likewise this makes you vulnerable too.
can win Arena -


http://markup.gmking.org July, 2007 13 | P a g e
REVIEWS
Arena REVIEWS
There are no notable bugs in the game,
the maze generator only creates
solveable mazes, so there is no chance
of being isolated from half of the game.
The only slight problem is that, if you try
hard enough or are unlucky enough, you
can get your ship stuck on the end of a
section of maze wall - however this
occurs very rarely.

There are no over-used sound effects,


however if you are playing lots of games
in a row the mission impossible theme
tune on the menu and game setup Arena’s split screen follows both players around the maze.
screens may start to get irritating. The The graphics and effects aren't amazing The game is accompanied with an in
game does have background music but but in a game like this there is no need game help file, and the installation also
this does not distract from the for professional quality graphics as this includes a textual version of the
gameplay. Perhaps the shooting sound would just increase the file size. The documentation which covers all aspects
effect will becoming irritating, especially sprites used are perfectly suited to the of the game and explains what
if your opponent likes to hold down fire game and nothing looks out of place. everything in the game does.
constantly as they explore the maze. Pros: Detailed instructions included with game. Virtually
Ratings every aspect of the game can be changed.
Cons: Menu music may get annoying. Small issue of
Documentation occasionally getting stuck.
10 Overall: An excellent two-player Game Maker game.
8
Overall 6 Graphics
Download Size: 2.5MB
4
Download Type: Installer
2
Conclusion

0 Author: Dennis Toney, Delta 9 Games


Game Play Sounds Game Maker Version: 4.3
Released: 2/4/2003
Get it: xrl.us/arena

CONCLUSION
Customization Music
Phil Gamble, GameMakerBlog.com ■

ADVERTISEMENT

ADVERTISEMENT -

ADVERTISEMENT -

ADVERTISEMENT -

14 | P a g e July, 2007 http://markup.gmking.org


TUTORIALS
Ammo TUTORIALS
Creating an ammunition system might other way, draw_sprite_ext should be better way, and that is to set the
not be the hardest task on Game Maker used instead of draw_sprite, number of bullets directly to the wanted
for many, but for the new GM users out furthermore, you could use the value, so, if we wanted to set the
there – it’s definitely challenging. I’ll draw_self script available from number of bullets to 50, we use:
overview how to create a simple system GMLscripts.com.
ammo=50;
that monitors the amount of bullet a
certain weapon can shoot, and only Reloading Bullets
In reality, that is what happens: the
allow the player to shoot that amount. Reloading bullets depends on the way
existing ammo in the gun is disposed; a
you want bullets to be reloaded. Some
new set of bullets is added to the
games are made so that when the
Designing the Basic System reload button is pressed, the number of
gun/weapon.
Code needs to be added to the player bullets is incremented, so the existing
Shooting the Bullets
object to: bullets won’t be lost. if (ammo>0)
{
1- Set the number of bullets the Other games are made so that the SHOOT COMMAND
player starts with remaining bullets are lost, and the ammo-=1;
2- Monitor number of bullets number of bullets is then restored. }
3- Subtract a bullet each time the
weapon fires The code difference is fairly simple. In The code is fairly simple – if a sufficient
4- Reload the number of bullets the first type, the ammo value will be number of bullets exist, the gun is shot
when reload occurs incremented by a certain number: and the ammo variable is subtracted by
1.
ammo+=50;
Initialization
To set a number of bullets the player
starts with, a variable simply needs to
The second way is what I consider the 
be defined. Here, we will use the
showing ammunition
The Counter Strike interface,

variable ammo:

ammo=50;

Display
To draw the current amount of bullets
the player is allowed to fire, a simple
draw_text function is used:

draw_text(X,Y,string(bullets));
//edit X and Y

Of course, when putting code in the


draw event, the player sprite will now
disappear, and will need to be drawn
manually.

draw_sprite(sprite_index,image_index
,x,y);

If the player sprite is rotated using


image_angle or manipulated in any

http://markup.gmking.org July, 2007 15 | P a g e


TUTORIALS
Ammo Cont. TUTORIALS
Squad, a GM game incremented.
Drawing ammo value in Other than the fact that you run out of with(other)
view bullets and need to re-fill, one of the {
When you have a 2-dimensional game instance_destroy();
‘cool factors’ of some games is that you
}
taking place in a large world, you will also run out of reloads, and need to reloads+=3; //EDIT VALUE
need to use the view feature in Game obtain certain ‘packages’ to increase the
Maker so that only a part of that word is number of reloads you have. The
shown at any one moment on the analogy is simple, and only makes the Using multiple weapons
screen. game more realistic. What if you wanted multiple weapons
to exist? How could you make bullets
Using regular x and y values are relative Initialization and reloads count individually for
to the room itself, and not to the view. For that same object, other than separate weapons?
So, in order for us to correct this issue, initializing the ammo itself, we should
the x and y coordinates of the view itself also initialize a variable used to count Here comes one of the benefits of using
are obtained, and incremented to the X the number of reloads available, and arrays!
and Y values used for drawing the text. since I’m a creative person, I’ll call it
reloads. You didn’t see that coming did
Concept
In Game Maker 6.0 and above, What will happen is that each variable
view_xview corresponds to the view’s X
you?
will become an array, so reloads[0]
axis and view_yview corresponds to the reloads=5; represents the reloads for the first
view’s Y axis. Before Game Maker 6.0, weapon, while reload[1] represents the
view_left used to correspond to the x Reloading Ammo reloads for the second weapon, and so
axis, and view_top corresponded to the In the reload event, some changes will on.
y axis. now have to occur. We’ve talked about
the single line of code that performs the
This means that the previous draw
actual reload above, this line of code
event is now modified to the following
will be referenced to as RELOAD, and
in Game Maker 6:
will be surrounded with if conditions
draw_text(view_xview+X,view_yview+Y, and another line of code to make it all
string(bullets)); //edit X and Y work.

if (reloads>0)
Limiting the number of {
RELOAD
reloads reloads-=1;
}
Dawn of the Infested, a Game Maker
Getting more reloads game, allows the player to choose
between multiple weapons
A ‘package’ that gives the player some
ammo could simply be an object that Basically, each weapon will have its own
lies somewhere on the ground of that index value, and a new variable will be
world. On the collision event for that added that stores the value of the
object, the player should “take” the current weapon being used.
package – meaning the package object
will have to be destroyed, and the Initialization
The player can obtain packages to number of reloads should be Initialization is now different; the
increase amount of reloads in Falcon

16 | P a g e July, 2007 http://markup.gmking.org
TUTORIALS
Ammo Cont. TUTORIALS
number of bullets for several weapons string(ammo[current_weapon])); break;
//edit X and Y case 1:
must be initialized, as well as the new
SHOOT 2 COMMAND;
current weapon variable:
Reloading break;
case 2:
ammo[0]=50; The variable ammo would be replaced SHOOT 3 COMMAND;
ammo[1]=50; with ammo[current_weapon] instead. If break;
ammo[2]=20; }
you are also monitoring the number of
reloads[0]=5;
reloads[1]=10; reloads, the reloads variable will
reloads[2]=2; become reloads[current_weapon] as Getting more reloads
current_weapon=1; well. The actual reloading increases the
number of bullets for the current
Display Shooting the Bullets weapon, but for increasing the number
This time, only the number of bullets for Same as before, each ammo variable of reloads for a particular weapon, it
the current weapon should be would be replaced with becomes different.
displayed. The value of the current ammo[current_weapon]. This includes the
weapon variable could be used to Different packages exists for different
‘if’ conditions and the subtraction of
return the number of the bullets weapons, and when a player collides
number of bullets for that weapon.
available for that weapon. with a particular package, this package
Now, to choose for what type of bullet only increases the number of reloads
The way this is done is by replacing: to be actually shot, a switch statement allowed for a particular weapon,
is used: whether or not it is the current weapon.
draw_text(view_xview+X,view_yview+Y,
string(bullets)); //edit X and Y Multiple objects could be created for
switch(current_weapon)
{ different packages, each supposedly for
With: case 0:
a different type of weapon. The
SHOOT 1 COMMAND;
draw_text(view_xview+X,view_yview+Y, reloads variable is then replaced by an
array: reloads[#]. The “#” could be
replaced with a fixed number (in this
example 0, 1, or 2) corresponding the
weapon this package is related to.

Switching between weapons


Switching the current weapon being
used is very simple; all it requires is to
change the value of the current_weapon
variable.

Conclusion
Many – if not most – of the shooter
games out there take advantage of such
a system of ammunition. I hope this
guide has made it easy for some of you
to create your own shooter game.

Eyas Sharaiha 

http://markup.gmking.org July, 2007 17 | P a g e


INTERVIEW
Martin “FredFredrickson” time to learn how to organize your
INTERVIEW
There are existing GM
Crownover
For this issue, I decided to interview
projects and how to write efficient
code, and then go on to make your multiplayer capabilities, are
masterpiece. It'll benefit you in the end, they enough for making a
Martin Crownover, most known in the and even if you don't wind up using GM good solid game?
GMC as FredFredrickson, the creator of for your magnum opus, you'll at least To be honest, I haven't used them
several awesome multiplayer games. come away from it with a good enough to answer this question with
Since this issue is more concentrated on foundation for logical coding. 100% accuracy, but from what I have
multiplayer games, I thought having a
seen and heard about the built-in Mplay
developer-oriented discussion with Many multiplayer games have
functions, yes, I think it's very possible
someone with extensive GM- features like chat, etc. What to create a good, solid multiplayer game
multiplayer experience would be features does a multiplayer using them.
beneficial to all of our readers. game need to have, and which
are just 'bonuses'? What Game Maker resources
It really depends on the type of game. I do you find best for making a
think that if you're going to make a multiplayer game?
multiplayer game, you might as well get Obviously, I’d say that 39dll is one of the
in all the features you want to get in, best resources out there for people to
Interview and then if you're planning on releasing code online games with Game Maker.
a demo to the community or friends, Enough people use it that you can get
Many newbie developers get feedback on what works and what good help with it, and there are some
want to make MMORPG doesn't, and go from there. I think that pretty useful examples for it floating
games, or any other type of as developers (both indie and around as well. I’d recommend
multiplayer games. Any words commercial) start becoming more adept checking out just about all the open
at creating engaging multiplayer source engines I’ve seen that use it –
for those people?
experiences, and comfortable in that everyone has their own unique way of
I don't like to tell people that making a
realm, we'll be seeing a lot of programming multiplayer, and every
successful MMO in GM is impossible,
interesting implementations of it that multiplayer game is programmed
because it's technically not, but my
challenge our beliefs of what is and somewhat differently from the next, so
advice for people who are beginners
what isn't a standard feature of it’s good to know a broad range of
with GM and with high hopes for
multiplayer. methods.
making such a game is to start small.
Get comfortable with GM. Take the Lagging is a serious issue in
multiplayer games, any tips
QUICK REVIEW

GMMovie on how to minimize this


This DLL extends the possibilities for effect?
playing both audio and video formats, I'm always having trouble with this
though the DLL is specialized in video myself! But until Ethernet cables that
formats. The DLL uses MCI, which is can deliver instantaneous
available directly from Game Maker itself – communication are developed, lag is
something which will always be
but apart from being easier to use, its
something we have to deal with.
author says it might be faster. The DLL
Basically, since it is always there in some
doesn’t create any pauses and is ideal for form or another, the best we can do is


playing intros and trailers inside the game.

QUICK REVIEW 18 | P a g e
Get it now!
http://xrl.us/2iai
July, 2007 http://markup.gmking.org
INTERVIEW
Martin “FredFredrickson” INTERVIEW

Crownover Cont. a pretty comprehensive single player


experience for Falcon Squad, and I hope
optimize the packets of information we My games themselves have evolved out that people will play it and enjoy it.
send out, and then hide the rest of the in different ways - each project I've
problem. My advice is to go through done since HT3D has filled a gap for me,
your game, and figure out what is so to speak. I think that more than
possible to compute on the client side, anything else, the code underneath the
and what is not. Often, you can find hood of my games has evolved as I've
things in your packets that can be taken gone from project to project. There is a
out and computed client-side, as well as distinct difference between the way I
things that just don't need to be there. coded HT3D back in 2005, and the way I
If you're clever about structuring your would code it now. That's one of the
packets, and add in some sort of motion reasons why I haven't re-opened the
prediction / smoothing for movement project to recompile it for GM7 / Vista -
(for action-oriented games), you're I don't want to look at the code and
good to go. start tinkering with it! A progression in GMC mods are always closing
code practices and knowledge is good wish-list topics -- what is your
Some multiplayer games though, and I think that it will serve me GM wish list?
create direct connections well when I get around to working on I try not to think too much about what I
between players, while others the sequel to HT3D again. wish GM was, because I think I'd get too
depend on setting up servers, wrapped up in wishing it were different
which do you think is best? here and there, and then end up being
I think that as long as one player is the disappointed with what it is. Don't get
host, or a dedicated server application is me wrong though, it's an awesome
used, the game should be fine. I've program, and I will continue using it
heard of people trying to set up until I run out of reasons to! As for my
connections where everyone is sending wish list, I would really like to see (as
messages to everyone else, and I can't would many others, I am sure) a speed
help but think that this would be a increase, more 3D functions (like
nightmare to control. Set up your game extended model type support, better
so that all the messages that players support for animations made in outside
send and receive are routed through programs, etc.), and better security. Of
one central point. It may be hard to Most of your multiplayer those three, I think the one I would
wrap your mind around this concept (it games have both single and appreciate the most at this point would
still is for me at times), but ultimately it multi-player modes. Why do be the added 3D functionality. I know
will give you far greater control over you think this is necessary? GM isn't really the best app for
what happens in your game, and how Even though most of the industry seems developing 3D games, but it'd still be
smooth of an experience it is for people. to be shifting to the multiplayer side of nice, and I enjoy the challenge it
things, I think that it's still important to presents with its speed and functional
Hover Tank 3D was the first include the players with slow net limitations. I imagine that in some
multiplayer game I've seen connections, or who just wish to play ways, it's almost like developing for a
you work on. How much have alone. I can't say that my more recent console with limited specs.
your games evolved since you work caters to this group as much as
started? HT3D or Evolites have, but I am planning 
http://markup.gmking.org July, 2007 19 | P a g e
INTERVIEW
Martin “FredFredrickson” INTERVIEW

Crownover Cont. very busy with my work lately, but


eventually, when I have more time to
it basically uses an account system to program with GM again, you might see
identify / authenticate players, and give me attempt a more lucrative release.
What makes a multiplayer Overall though, I’d like for the service,
developers a set of tools that are easy
game popular? Is it just to use, but powerful as well. For and the bulk of its games, to remain
quality? example, once you’ve got the login free.
I think quality is always big part of the system in place for your game, using the
success of a game, but for multiplayer Though I told you the
Reflect Account System, you can upload
games specifically, giving the players a high scores with one script, and then
interview will be developer-
fun way to interact with each other is download them and parse them with oriented, I can't help it but
key. As an example, most multiplayer another. You can query the server for ask: is HT3D 2 coming down
games seem to revolve around players listings for your game, download the pipe anytime soon? You
killing each other in some way or nicknames and player colors from the haven't posted in the Reflect
another, but if you give them an server. It’s a really handy system, and I topic about that for a while.
assortment of weapons to do it with, think it can add a bit of professionalism Well, like I said, I have been quite busy
the game becomes more interesting. to your game. lately. I recently decided I needed to
I guess most of our readers Not all Reflect-Enabled games
overhaul Falcon Squad, and make it into
already know about Reflect something a little different than what it
are yours, yet you don't let currently is, so maybe I will take the
Account System. For those anyone make a game taking extra time to play around with some
who don't what is it? Is it a advantage of the Reflect HT3D 2 stuff again. I am slightly
member system, server Account System. What criteria interested in learning Xtreme 3D, or one
system, client system, or do you look for in a game that of the other GM 3D DLL’s, so who
what? makes you decide whether or knows… maybe HT3D 2 will be even
more graphically intense than I
not will it make a good reflect-
originally planned.
enabled game?
Really, I just look for people who are It’s a wrap! Is there anything
serious about making their game, and
The Reflect Account System is an else you would like to add?
who have shown in their prior work to
account system that was developed to Not really, just thanks to you for the
have the talent and drive to actually
make finding multiplayer games easier interview, and thanks to everyone who
finish the project. I know I am guilty of
for people. Most people who know of read it! I truly appreciate it.
it myself, but having a lot of unfinished
the system know of it because they
games on the system isn’t good, so
have used it to connect to other people
in games like Aces High Over Verlor
having the ability to complete the game, Conclusion
and the will to polish it ‘til it shines are So that was it – my interview with one
Island and Sapphire Tears… since it’s
probably the two most important of the most respected game makers out
based on a web server, it doesn’t host
things. there, especially in the multiplayer area.
these games itself, but it acts as a
master server list with a lot of extra So, any plans on going Be sure to check out Martin
perks that the account system affords it.
commercial with (some) Crownover’s games by visiting the
Built off of some things I had originally Reflect Games? Reflect Games website here:
Eventually… you never know! I’ve been http://reflectgames.com/.
put into Hover Tank 3D for multiplayer,
Eyas Sharaiha 
20 | P a g e July, 2007 http://markup.gmking.org
TUTORIAL
Game Maker and the Registry TUTORIAL
When creating games, there are a few displays the keys in a tree structure. use a piece of code like this:
ways to store small amounts of data. Keys can contain subkeys or just values
registry_write_string("A string ",
This can be done by storing the data in (named variables with a value). This "string content ");
external files, but another way to do structure can be compared to the
this is to use the registry to store data. directory structure of Windows. Keys Then Game Maker will create the
The registry also has some advantages. then are directories and values are files. following key in the registry (you can
This article will explain the use of the Directories can contain subdirectories. check this in the registry editor):
registry and how to access and change it And just like directories can contain
with Game Maker. multiple files, keys can contain multiple HKEY_CURRENT_USER\Software\Game
Maker\782526
values. The values can be of different
types. But since GM just supports two All strings and real values GM writes to
The registry types (REG_SZ and REG_BINARY), these the registry using the normal registry
Now what exactly is the registry? won’t be explained further. functions appear in that key. Reading
Actually, it’s a database to store small
values also reads values from that single
data. This database is present on each So the registry exists, but the registry
key.
computer that has Windows on it. The contains data, and data is usually stored
great thing is that there’s a very easy in some files. This is no other with the It is clear that these functions are very
way to access and view it. Windows registry. The data from the limited. You only get access to a single
comes with a handy tool: the registry HKEY_CURRENT_USER key, for example, key in the registry. To get access to all
editor. You can open the registry editor can be found in “C:\Documents and keys of the registry, we will need to use
by typing “regedit.exe” in the command Settings\<your username>” (if C: is the the extended registry functions.
prompt. And there it is! You’ll notice system drive, of course), in
that the registry is subdivided in five “NTUSER.DAT”. It can’t be opened, The extended registry functions almost
main keys: though. Windows doesn’t let you do have the same name as the previous
that. No registry editing that way. ones, but you need to add “_ext” to the
 HKEY_CLASSES_ROOT: this looks function. Also, these functions require
like it is a complicated key, but The solution is simple: let’s use Game another argument: the key. The
it’s actually a very interesting Maker to do it. previous functions didn’t allow you to
one, as will be explained later in
specify the key in which to write the
this article.
 HKEY_CURRENT_USER: as you values. These functions do. An example:
GM’s registry functionality
might expect, this key contains
GM’s registry functions allow for many registry_write_real_ext("Software\My
data about the current user on a Game ", "PlayTime ",6);
computer (related to user possibilities. First of all, a remark:
profiles). editing the registry might be dangerous
The function above writes the following
 HKEY_LOCAL_MACHINE: this key if you don’t know what you’re doing.
key to the registry:
looks like the above, but it Here in this example, we will assume
contains data that applies to all that we know what we’re doing. HKEY_CURRENT_USER\Software\MyGame
users on a computer.
 HKEY_USERS: this key contains So let’s look at GM’s registry functions. And, it writes the following data to that
user profiles, not accessible GM has 11 registry-related functions. key:
with Game Maker, though The first 5 allow for few possibilities.
 HKEY_CURRENT_CONFIG: PlayTime 6
Why, you wonder? These functions only
contains data about hardware
work with specific keys. Suppose you You can again check this in the registry
profiles.
If you’ve checked out those keys, you want to write a value to the registry and editor. When you open the Software
will have noticed that the registry editor your game id is e.g. 782526. You could


http://markup.gmking.org July, 2007 21 | P a g e
TUTORIAL
GM and the Registry Cont. TUTORIAL

key, you’ll notice the MyGame subkey, this in the registry editor: the created:
HKEY_CLASSES_ROOT key starts with a
containing the real value (REG_BINARY)
PlayTime set to 6. huge list of file extensions, followed by registry_write_string_ext("GameFile ",
an even longer list of file descriptions. " ", "A file type used by my game ");
Now there’s still one thing that needs to Some keys and values are required:
The default value of this key is used as a
be explained: setting the root. Up till
now, we’ve only written values to the  A key with the file extension is description for your game file. Now
created e.g. subkeys need to be added to this key. The
HKEY_CURRENT_USER key (which is the
“HKEY_CLASSES_ROOT\.gmf”. first one sets the icon for the file:
default used by Game Maker). This can Whenever a key is created, is
be changed by using the always has a default value registry_write_string_ext("GameFile\De
registry_set_root function. This (which is actually <no value>). faultIcon","","C:\Program
function requires only one argument, a  This default value is then set to Files\MyGame\icon.ico");
real value indicating the registry root: e.g. “GameFile”. Now what does
that mean? It is the name of the “DefaultIcon” is the key where the icon file
0. HKEY_CURRENT_USER file description that can be path is stored (you cannot choose this
1. HKEY_LOCAL_MACHINE found lower in the list. Actually, name yourself, it’s predefined). Also note
2. HKEY_CLASSES_ROOT the only thing this key does is that it is again the default value that is
3. HKEY_USERS
refer to a key that contains the used to store the filename of the icon file.
And now, you have full access to all keys
real file association information.
of the registry. A small remark here: as Now the “open” key, that is the key that
This latter key also contains
you might’ve noticed in the examples, some subkeys. contains the information on how to open
subkeys can be passed by using the “\” So how can this be achieved by using the file, needs to be created. The “open”
sign. That way, you can get the value of GM’s functions? Let’s say you have a key is a subkey of a key named “shell”. To
values in subkeys. game that can open the “.gmf” file create it:
extension. The first thing you need to do
Reading values from the registry registry_write_string_ext("GameFile\sh
is set the registry root to ell\open","","Open with &MyGame");
happens in exactly the same way. HKEY_CLASSES_ROOT:

Although these functions allow you to This piece of code creates the “open” key
registry_set_root(2);
read from and write to the registry, they as a subkey in “shell”, which is also created
can’t be used to e.g. get the number of From now on, all data will be written to (you cannot choose these names yourself).
subkeys in a key or the number of HKEY_CLASSES_ROOT. The first key to As you can see, the default value is this
values in a key. Too bad, but the current write is the key named “.gmf”: time set to “Open with &MyGame”. This
functions are more than sufficient to text will be displayed as an item in the
registry_write_string_ext(".gmf","", menu that is shown when the user right-
add some nice functionality to your
"GameFile");
games and programs. clicks the file icon on his desktop. The “&”
sign does something special. It indicates
This piece of code writes a new key
the letter to be used as a keyboard
“HKEY_CLASSES_ROOT\.gmf” to the
Tips ’n tricks shortcut. In this case, it would be the M of
registry and sets the value “GameFile”
“MyGame”. So suppose the menu is open
File association (you can choose this name yourself) to
and the user does not use the mouse to
By writing some data to the registry, the default value .When you want to
select that menu item, then he can press
you can associate files with your game change the default value, you need to
M (not Shift+m) on his keyboard. That will
or program. The registry key where all pass an empty string as the value name
give the same result.
file associations are stored is the to the function.
HKEY_CLASSES_ROOT key. You can check Now the “GameFile” key needs to be 
22 | P a g e July, 2007 http://markup.gmking.org
TUTORIALS
GM and the Registry Cont. TUTORIALS
(HOMEPATH).You can view all these
Now there is one key that needs to be startup.
values in the registry editor.
added:
For that, we need to use another Game
The Environment key
registry_write_string_ext("GameFile\ Maker function: parameter_string(n)
shell\open\command","",'"C:\Program This key can also be found in the
Files\MyGame\mygame.exe" "%1"'); The parameter_string function returns HKEY_CURRENT_USER key:
the string of the n-th parameter that
The key is called “command” and is a HKEY_CURRENT_USER\Environment
was passed to the game at startup.
subkey of “open” (you can’t choose Since we gave this parameter index 1, it Interesting values in this key are the
these names yourself). Note that 2 can be retrieved with: user’s language (LANG) and the link to
parameters are passed this time. These
his temporary directory (TEMP or TMP).
need to be put between double quotes. filepath=parameter_string(1);
As a consequence, single quotes must
be used in the piece of code. The first The filepath variable now contains the
parameter is the link to the game’s value of parameter 1. The value of that
executable. The second one is “%1”. parameter is the path to the file the
This requires an explanation. At startup, user opened. And now the problem is
some parameters can be passed to the solved. Windows will open the file with
game. These parameters all have an your game and your game knows which
index. The “%1” value indicates that this file the user wants to open.
parameter will have index 1. Voilà,
The Volatile Environment key
that’s all for the file association. It might
This key can be found in the
be necessary to log off and log on again
HKEY_CURRENT_USER key:
for the changes to take effect.
HKEY_CURRENT_USER\Volatile
Okay, so the file association is done. Environment
Windows knows which icon to display
for the “.gmf” file extension and the It contains some interesting values e.g.
path to the executable to open it. The the current user’s application data
problem is: the game doesn’t know yet directory (APPDATA), homedrive
that it needs to open that file on (HOMEDRIVE) and the user’s directory

Conclusion
QUICK REVIEW

39DLL The registry contains a lot of interesting


information about everything on the
39dll is a popular socket DLL which gives computer. Unfortunately you need to
games that use it the power to access know in which keys that information can
Windows Sockets and therefore be found. Game Maker’s registry-
multiplayer capabilities. Many popular related functions can be used to get
multiplayer Game Maker games use the useful information from the registry, but
39dll as a method of creation of servers also for writing to the registry e.g. file
and communication between different association and storing data from your
players of a game. Great DLL, constantly game.
updated, and high quality – recommended.
Bart Teunis 

QUICK REVIEW http://markup.gmking.org


Get it now!
http://xrl.us/2kmi
July, 2007 23 | P a g e
TUTORIALS
Instant Collisions TUTORIALS

Hello, in this article, you will learn the That code simply defines the variables each pixel to find its destination, 4
common mistakes in 2D shooters. and chooses which entry will take place works great but sometimes it goes
for the variables. Ex: through the blocks, change this around
instant_collide(12,4,90,1000,solid);
to change the performance of the game.
Common Mistakes That example would set the X1 to 12, Y1 Higher value = better FPS, Lower value =
Some of the most common mistakes to 4, DIR to 90,the max distance to worse FPS.
made in these games are the bullets. 1000pixels, and the object to stop at to
Some people use the retro style bullets Now we will add more code into that
SOLID
where the bullets move rather slow, but do{} event so it not only just adds on to
most people don't like waiting for that The SOLID means the range will stop at a variable.
little black ball to move toward their a solid.
Add this code into your script:
target. This is a common mistake in
games. This can easily be fixed with xx = x1+lengthdir_x(dist,dir);
something called "rangefinding" it finds The Script’s “Brain” // just the direction of fire and
a range of pixels and returns true or Now since we know what the code stuff.
above does, we can now go into the real yy = y1+lengthdir_y(dist,dir);
false if the range ends before it hits its dx = xx; // destination X
maximum distance. Most people do not coding.
dy = yy; // destination Y
know how to make this but it is actually We will create a do{} to repeat the code
very simple. The lengthdirs are just a directional
until a certain point. This can be helpful
virtual line, they are updated every time
in games.
the do{} event is run so they add on
Starting the Script Put this code into your game: pixels to the range.
Start with a script in your game, name
the script: "instant_collide". do { The DX and DY are the return values;
dist+=1; these are the Coordinates you will use
Now so it is user friendly and a lot like a later on in the script.
function, we will add arguments to the The dist+=1; means that the script scans
script. Add this code into the script: 
x1 = argument0; // Source X
y1 = argument1; // Source Y
dir = argument2; // Direction to shoot
EX: point_direction(x,y,mouse_x,mouse_y);
N_menu DLL
maxdist = argument3; //maximum The N_menu DLL allows the

QUICK REVIEW
distance. so the game dosent crash if it
goes out of the room.
user to create real Windows
obj = argument4; // obj/flag to stop menus for inclusion in a
at. i always enter "solid" (without game/tool. Many capabilities
quotes)
dx = 0; // just to define destination exist for adding images,
x,y submenu items, events, and
dy = 0; more. The example is available
col = 0;
var xx,yy,dist; // make the variables.
only in .gmd, but could be easily
dist = 0; converted to .gm6 and .gmk
through Game Maker. A GEX
Do not include the quotations. Now we extension is also available.
have made our variables, and are ready
to get into the good stuff. Get it now!

24 | P a g e QUICK REVIEW
July, 2007
http://xrl.us/nmenu
http://markup.gmking.org
TUTORIALS
Instant Collisions Cont. TUTORIALS
Now we need to end the do event with distance. so the game dosent crash
a bracket and an until(); if it goes out of the room.
Executing the Script in
obj = argument4; // obj/flag to stop
Insert this code into the script: at. i always enter "solid" (without Game
quotes) Now we want to run the script in-game,
} dx = 0; // just to define
until(position_meeting(dx,dy,obj) or destination x,y
make 3 sprites:
dist>maxdist); dy = 0;
col = 0;  spr_block
That checks if the position of the range var xx,yy,dist; // make the  spr_player
has hit a solid object, or the object you
variables.  spr_bullet (2x2) origin=1x1
dist = 0;
preferred, and it also checks if it do { // we use this do {} statement
Use the settings provided for the
reached its max distance, so the game to keep going each pixel.
dist+=1; // add on to the sprites.
doesn’t freeze if you don’t hit anything.
distance so we dont stop until we
hit something. You can set your player sprite to
xx = x1+lengthdir_x(dist,dir); whatever you want. The same will
Finishing the Script // just the direction of fire and
happen with the block.
Now what we need to do, is make the stuff.
yy = y1+lengthdir_y(dist,dir);
return variables and simply make an Now create the block object, and set its
dx = xx; // destination X
if() event to make it more user dy = yy; // destination Y sprite to the spr_block.
friendly to check if it has collided or not. } until(position_meeting(dx,dy,obj)
or dist>maxdist); Don’t add any code to the block; just
Add this code into your script: if(position_meeting(dx,dy,obj)) { // check the flag "Solid". Then create the
if the destination has collided with
bullet object. Set its sprite to spr_bullet.
if(position_meeting(dx,dy,obj)) { // something.
if the destination has collided with col = 1; // yes it has.
Add a STEP event to the bullet obj and
something. } else {
col = 1; // yes it has. col = 0; // no it hasnt. add a code block. Add this code into the
} else { } Step event:
col = 0; // no it hasnt. return dx; // return it, so we
} can use to draw.
return dy; 
The code above checks whether it has
collided or not. This can be useful.
Ultima 3D Reloaded
Now we need the returns. These are
Ultima 3D Reloaded is a 3D
what we need to even create a bullet.

Add this code into your script:


extension for Game Maker,
which supports many cool
features such as 3DS modeling,
QUICK REVIEW
return dx; // return it, so we can use
to draw.
secular lighting, model
return dy; transformation, and more – all
with faster loading times. You
And that’s all of the script! could see the GMC topic for
more information about the
Your script should look like this:
extension, its latest features,
x1 = argument0; // Source X and a list of its features.
y1 = argument1; // Source Y
dir = argument2; // Direction to shoot Get it now!

QUICK REVIEW
EX: point_direction(x,y,mouse_x,mouse_y);
http://xrl.us/ultima
maxdist = argument3; //maximum

http://markup.gmking.org July, 2007 25 | P a g e


TUTORIALS
Instant Collisions Cont. TUTORIALS
Now we are ready to set up the room!
if(!place_free(x,y)) { Now Create a Global Left Pressed event
effect_create_below(ef_smoke,x,y,10,
Create a new room and add the block
and add this code into it:
c_gray); objects all around and create a player.
instance_destroy(); Your instant collisions are complete!
var dir;
} dir=point_direction(x,y,mouse_x,mous
e_y); // set direction to point at
This code checks if it has collided with mouse.
anything. If it has, it creates a puff of shooting=1; // set to one so we can
get rid of the variable
smoke, and destroys itself. Now make
instant_collide(x,y,dir,1000,solid);
sure the bullet isn’t solid. instance_create(dx,dy,obj_bullet);
alarm[0]=1;
Create the player object, and set the
player object's sprite to spr_player. Make sure to set the 3rd argument for
the instant_create to the bullet object
You do not need any player physics for
of your game.
this, add it if you want though.
Also, you’re probably thinking "What?!
Add this code into the create event:
An alarm event??”
free=1;
shooting=0; True, we will create it now.

Create an alarm[0] event and add this Conclusion


The free variable tells our player that
code to it: Instant collisions give many advantages
the place is free. Otherwise it would say
over regular collision events, especially
it isn’t free before you shoot. shooting=0; when it comes to bullets in top-down
Shooting is set to 0 for later uses, it’s games.
That sets shooting to 0 so it doesn’t
just basic creation. keep drawing the line later on in this If you want a bullet with a realistic
Now since we are done with the create article. Now Finally!! Finishing the speed, chances are – the bullet will go
event, add an End Step event and put script, add a draw event into the player, through the body without even colliding
this code in there: and add this code into it: with it!

if(variable_local_exists("col")) { if(free=false) { // if free is false In order for a bullet to collide with a


draw_text(10,10,"Shot Something");
// see if we are shooting, so it dosent body normally, it should be slowed
cause an error. // say we have collided
if(col=1) { // if col=1 (if the } else { // if free is true down, considerably – this makes the
line has collided with an object) draw_text(10,10,"Shot nothing"); game unrealistic, and sometimes –
free=false; // say we didnt collide annoying; no one would really want to
} else { // if col=0 (the line }
hasnt collided) if(shooting=1) {
wait a couple of seconds for a bullet to
free=true; if(variable_local_exists("dx") kill the enemy – it should be done
} && variable_local_exists("dy")) { instantly; bullets are fast!
} // we check if the variables exist,
so we dont get an error. This script allows you to restore realism
That checks if we are shooting, and then draw_line(x,y,dx,dy);
to your top down shooter games by
}
sees if the col variable is true or false, so making bullets much faster.
}
we can tell whether it has or hasn’t. draw_sprite(sprite_index,0,x,y);
//simply draw the sprite. mr.gibblet
That’s all for the end event.

26 | P a g e July, 2007 http://markup.gmking.org


REVIEWS
Coaster Rider REVIEWS
CoasterRider is an excellent game by
Bl@kSp@rk, as featured on the YoYo
Games website. What is amazing to me
is that such an excellent game never
had a GMC topic, and virtually got no
attention within the GMC.

Graphics
The game has excellent graphics!
Whether it is the Pegasus itself, the
trees, the smooth grass and pieces of
“floating land”, the starts that you need
to collect, or the effects you get when
you collect them. Amazing. I will be a
fool if I gave it anything less than a 9.

Graphic Effects
The game has subtle graphic effects, because it really fits with the game’s
only here and there. The good thing is theme. The game suddenly becomes
not overused, and it is true what they more exciting, more intense, and more the first level. The game’s level design is
say “less is more”… but that’s too little! capturing – excellent work! 9 out of 10. rated 9.
The game gets a 7/10 in Graphic Effects.

Sound Effects Overall


User Interface Too little sound effects, but when they The game’s overall score is 8.5 out of
Whether it is the menu, tools, or are heard – it’s great! Clicking buttons, 10. That’s a shame, because it could’ve
options – it functions so well, extremely colliding with stars or loops that speed gotten a lot better if Sound effects and
easy to understand, and it’s simple! The you up, all that triggers sound effects. Graphic effects are enhanced.
game has only few UI concepts, and it But I wanted more, like if the train Nevertheless, great work indeed!
builds on them – it doesn’t confuse the bumps on the ground at high speeds,
user with toolbars, menus, tooltips, etc – I needed something that made the Eyas Sharaiha 
windows, etc – all are just simple game feel more realistic, that something Conclusion
buttons with amazing graphics. didn’t exist. 7 out of 10.
Get it now: http://xrl.us/coasterrider
Even highlighting buttons and switching Download Size: 12.3 MB
between different tools could become a Level Design
rewarding experience! The game gets Levels are well-designed. The first level Graphics
10
10 out of 10, definitely! is easy, and then levels incrementally
Level Graphic
become harder. For me, level 3 is way Design 5 Effects
too hard, but that’s where great gamers
Music are separated from the rest – good job!
0

The game’s music is soo good! There are Sound


UI
Effects
5 music items, all high-quality OGG files. However, Level 1 was not “all too easy”;
The music makes the game more fun, I would’ve expected it to be easier for Music

http://markup.gmking.org July, 2007 27 | P a g e


REVIEWS
2P Shooter REVIEWS
What they say rates and swords can only be used close multiplayer game – unless a decent and
Select from 6 heads, 8 bodies, and two up but are quite destructive. extensive single player mode can be
guns to duel it out between two players. added this will easily be outshone by
You can only shoot left and right, and
Now with 4 weapons, the old MK9's and the multiplayer option.
once you’ve found a decent weapon
M16, plus the new custom 'Riotgun' and
you may as well stick with it as there are There are several options that can be
a nice little sword!
no limitations on the ammo you can use customised including the appearance of
during the game. both players; there are also two rooms
Quick Review to choose from. To be honest this
The biggest criticisms expressed at
In this split-screen two player game you doesn’t make much difference at all to
YoYoGames are that the game should
and your friend each control a gray stick the game play but at least the options
have a single player mode and
man inside a platform environment. are there for you to choose from if you
something should be done to fix the
Various weapons are spread throughout wish.
jumping bug. I certainly agree with the
the room which can be collected and
second point – it is possible to get stuck The game has suitable music and sound
used to inflect harm on your opponent.
on the side of platforms within the effects which complement the game
The aim of the game is quite simply to
room. This is a pretty major bug and I’m well. I’m not sure if they are original
kill your opponent before they destroy
surprised the game was released with but they do seem pretty generic. They
you.
this, especially seeing as this is the are a nice touch and without them the
Different types of weapons can be second version of the game to be game would be much duller.
found around the room, each causing released.
Another criticism I have is the games
different amounts of damage and with
The support for a single player mode is menu. They consist of very small
their own unique features. For example
something I don’t necessarily agree graphics which are hard to read and
individual weapons have different fire
with. The game works well as a click. It should be simple to have a well
designed and easy to use menu but it
seems this has been overlooked in an
attempt to improve the aesthetics.

Phil Gamble,
GameMakerBlog.com ■

Conclusion
Get it now: http://xrl.us/2pshooter
Download Size: 1.3MB
Author: Jack Sanders
Released: 16 June 2007

Docs
10
8
Overall 6 Graphics
4
2
0

Game Play Sound & Music

Customization
28 | P a g e July, 2007 http://markup.gmking.org
THE WRAP UP
Until Next Time! THE WRAP UP
And that was it! Issue 5 of MarkUp done for us. The YoYo Games staff is feedback, support, and comments; the
magazine and our first issue since the one of them, and all the MarkUp staff help was truly appreciated!
YoYo Games endorsement went public! thank them for bearing with us, and for
We hope you see this issue as an the wonderful job they carried out. We If MarkUp is to grow, we’ll need your
improvement, as we have got a lot of also appreciate the support that the help! You could help us by contributing
support and feedback from the GMC moderators have shown us. anything to the magazine, whether it is
community. We truly hope this issue articles, art, or any other form of help.
Also a big ‘thank you’ to To contribute to the magazine you could
was satisfying in every way.
GameMakerBlog.com, GMLscripts.com, visit the MarkUp forum here, or by
We started talking to YoYo Games and GameMakerResource.com, and directly contacting either Robin or Eyas
thinking about the endorsement since hopefully soon – GMBase, they’ve been via e-mail (see MarkUp site) or PM.
April this year, and it has been exciting a great help. We also want to show our
so far! But more exciting than knowing gratitude to everyone who has What does the future hold for MarkUp?
what was about to happen, and waiting contributed to MarkUp, including our Well, as our readership increases, we
for the right time to announce it was GMking.org ‘Journalist’ staff, and expect to get more comments,
the feedback we got from the entire everyone else who has wrote for feedback, and hopefully support. We
community once the announcement MarkUp. hope our future issues will be of higher
took place. quality – and that could only happen by
But more importantly, we at your much-valued contributions!
There are many people we’d like to GMking.org would really like to thank
thank for all the hard work they have you – our readers, for giving us Once again, thanks for your support!
The MarkUp Staff

Be sure to check out…


It's a song! It's a sound clip! No, wait -- it’s an audcast! That's right; we at GMking.org like to keep ourselves very busy! Since
June, we started releasing our weekly netcast (we prefer AUDcast), talking about Game Maker under the name "GMPod".

The audcast is approximately 20-30 minutes long, and in it we discuss various issues occurring in the Game Maker world, and
give advice to our listeners when it comes to using Game Maker.

We have received amazing support from the Game Maker Community! The great support has motivated us to continue
working on the audcast and improve it. We’ll be soon talking with some notable community members and we’ll start adding
some fun to the audcast as well!

Thank you for your amazing support so far, and please: keep those suggestions coming.

Markup is an open publication made possible by the contributions of people like you; please visit markup.gmking.org for
information on how to contribute. Thank you for your support!
©2007 Markup, a GMking.org project, and its contributors. This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 License. To view a
copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105,
USA. Additionally, permission to use figures, tables and brief excerpts from this work in scientific and educational works is hereby granted, provided the source is acknowledged. As
well, any use of the material in this work that is determined to be "fair use" under Section 107 or that satisfies the conditions specified in Section 108 of the U.S. Copyright Law (17
USC, as revised by P.L. 94-553) does not require the author’s permission.
The names, trademarks, service marks, and logos appearing in this magazine are property of their respective owners, and are not to be used in any advertising or publicity, or
otherwise to indicate sponsorship of or affiliation with any product or service. While the information contained in this magazine has been compiled from sources believed to be
reliable, GMking.org makes no guarantee as to, and assumes no responsibility for, the correctness, sufficiency, or completeness of such information or recommendations.
http://markup.gmking.org July, 2007 29 | P a g e

You might also like