Introduction To Game Design & Programming in GameMaker Studio 2

Home > Other > Introduction To Game Design & Programming in GameMaker Studio 2 > Page 4
Introduction To Game Design & Programming in GameMaker Studio 2 Page 4

by Ben Tyers


  Crowd Funding

  Put simply, crowd funding is getting small amounts of money from lots of people. It is usually done via the internet, and is a great and growing way to fund small (and sometimes) large projects.

  KickStarter

  Kickstarter is a great site for raising funds for your game project. Basically, you offer rewards at set price tears, and people pledge money in advance of release of your game.

  IndieGoGo

  Similar to Kickstarter, though perhaps more suited to indie game projects.

  Patreon

  A great way to raise funds every month. Users make a monthly pledge (from as little as $1) to access your posts, blogs, etc.

  A great way to make use of this platform is to make a game that updates each month (for example a bonus level) and your patreons get this update (setting this up is easier than it sounds). $1 a time doesn’t sound a lot, but as soon as you start getting hundreds of patreons, this can stack up quite quickly.

  Social Media

  Although social media cannot raise funds itself (OK, there are exceptions), it is a great way to make people aware of your game, and crowdfunding / patreon projects. If you put good content out there, you will get followers. Keep your followers aware of your projects and progress.

  Steam Early Access

  Another option is Steam’s Early Access, you allow players to test and play various stages of your game throughout production. It has the added bonus of being able to get feedback early on and address any issues as they arrive. A great option all-round.

  Chapter 4 Game Assets

  Just a brief chapter on game assets, as it is covered in more detail in other chapters.

  I consider the following important points to consider when sourcing assets (both audio and graphics):

  Is it worth the price? Are you over paying for an asset that will mean many game sales before you get your investment back?

  Does the graphics / audio match in with you game theme and other assets?

  Have you purchased the correct licence?

  Have read the licence correctly?

  If using a free font, did you say thanks with a donation?

  Is the asset ready to use in your project? Or require lots of additional work?

  If it is a free asset, did you give credit to the author?

  Chapter 5 Refining Resources

  Off the shelf assets are unlikely to be game ready. This chapter shows some methods to prepare assets ready for use. Graphics are down in GameMaker Studio’2 built in editor, audio is done with Audacity.

  Graphics

  For the purpose of this chapter I’ll be using graphics from the excellent site: GameDeveloperStudio.com

  Note: I like to use PNG files for sprites, as they can be set to be transparent. JPG files do not have this, so would need editing prior to use.

  Sprites from this site come in two formats, as sprite sheets and as separate images.

  Figure 5_1 shows as sprite sheets, and Figure 5_2 as separate image.

  Figure 5_1: Sprite sheet example.

  Figure 5_2: Showing as separate images

  The figures below show the steps for importing and processing a sprite sheet. First right-click on Sprites in the resources tree:

  Figure 5_3: Right click and create a sprite

  Figure 5_4: Selecting edit image

  Figure 5_5: Selecting import strip image

  If you look at Figure 5_1 you will see the sprite sheet is 5 frames wide and 4 deep. If you open the folder that has the image in (do this is in Windows not GameMaker Studio 2), and hover the mouse over the image you’ll see a popup showing the whole dimensions of the sprite, as shown in Figure 5_6:

  Figure 5_6: Showing image dimensions

  Using a bit of math we can figure out that each subimage is 803 pixels wide and 846 high, and there are 20 images.

  If we plug these values to the importer, as shown in Figure 5_7:

  Figure 5_7: Showing import settings

  We then end up with the sub images added, as shown in Figure 5_8:

  Figure 5_8: Showing sprite after import convestion

  You now have sprites that are nearly ready for your game.

  The Figure’s below show the process for importing multiple sub images. First create a new sprite, name is spr_example_2 for example:

  Figure 5_9: Create a new sprite

  Next select Import Image:

  Figure 5_10: Selecting import option

  Next select which sprites you want to import, you can use control and shift to select multiple images. This is shown in Figure 5_11:

  Figure 5_11: Selecting multiple images to import

  Figure 5_12 below shows the sprites successfully imported:

  Figure 5_12: Showing sprite images imported

  The sprites for GameDeveloperStudio.com are of a very high quality and of a high resolution, so in most case you will want to change the size to suite your game.

  For example, spr_example_2 has a size of 1271 by 1080 pixels, see Figure 5_13:

  Figure 5_13: Showing sprite size

  It’s a quick and easy process to resize sprites, regardless of 1 or multiple frames. Open up the editor by clicking on Edit Image. As shown in Figure 5_14:

  Figure 5_14: Selecting edit image option

  Next under image, choose resize all frames:

  Figure 5_14: resize all frames option

  Figure 5_15 shows an example setting for resizing all frames:

  Figure 5_15: Resizing frames

  Other things you might want to do with a sprite, using GameMaker Studio 2’s built in editor. These are actions I use often in my game projects. Figure 5_16 below shows a sprite without any changes:

  Figure 5_16: Showing sprite without changes

  If you want an object moving in the opposite direction you can mirror:

  Figure 5_16: Showing sprite mirrored

  You may want to gray out a sprite, for example when an upgrade is not available:

  Figure 5_17: Sprite with gray scale

  Motion blur can create a cool effect:

  Figure 5_18: Showing a blur effect

  If you have multiple similar objects, you want to change some colours so the player can see the difference, as shown in Figure 5_19:

  Figure 5_19: Showing some colour changed

  Audio

  As with graphics, audio will sometimes need a bit of tweaking. For this chapter I have used audio from SoundImage.org and am using Audacity as the audio editor (see Chapter 3 for my thoughts on Audacity).

  Note: The wav file format should be used for sound effects, as it plays almost instantanious. MP3 of OGG format should be used for audio such as music, as it requires some extra processing.

  Sometimes when you get a sound asset there is a short bit of silence before the actual sound playing, as shown in Figure 5_20. If this was sound effect used in game, this short bit of silence would mean a delay, so would not sync with something else in you game, such as a sound effect.

  Figure 5_20: Showing silence before sound

  This can easily fixed by selecting the silent area, as shown in Figure 5_21:

  Figure 5_21: Selecting part of the audio

  Just hit delete and it is magically removed:

  Figure 5_22: Showing edited sound

  Figure 5_23 below shows some music audio:

  Figure 5_23: Showing an audio track

  Sometimes music may be too long, so can select and delete part of the track if you wish:

  Figure 5_24 shows the track clipped:

  Figure 5_24: Track with part removed

  This ending of this music will end quite apruptly. You can select part of the track, then fade out from the effects option, this is how the above would look after fading:

  Figure 5_25: Showing clipped track with fading

  Audacity has quite an assortment of effects you can apply to your music or audio. My personal favourites are echo and distortion

  Chapter 6 Beta Testing & Debugging

/>   Beta Testing

  I have decided to place this chapter before the programming one, even though you would obviously take on feedback after you have programmed an initial idea. The reason for this is that the programming section will include changes made after the debugging stage, so in chapter 7 you will see the finished project.

  You’re unikely to go error free on the first attempt. Beta testing allows you to find errors, issues and problems and act upton them. Usually your beta project will be sent to as many people as possible in order to get some feedback. You don’t need to act upon every suggestion – though you are likely to get many good ideas. Feedback could cover issues such as:

  Crashing

  Poor controls

  Graphic issues

  Playability suggestions

  Changing game difficulty

  When I do beta testing, I’m always amazed by some of the great ideas that beta testers provide, and help propel my game to the next level.

  There is a file in the download resources: Game_Base.zip which shows the game before feedback from the beta testers has been taken on board. You may find it of interest to compare this with the finished game project.

  Here is screen shot of the game room before changes have been made:

  Figure 6_1: Showing game before beta testing feedback

  This is a summary of the feedback I received from my Beta Testers:

  Graphics are too large

  Not responsive enough

  Too easy

  Player weapons are too slow

  HUD is not in keeping with the rest of the game

  Aspect ratio should be changed

  Collision masks are impresise

  GUI life and dots not in keeping with game style

  To visually show damage to player

  The following shows how I worked on and addressed the issues above. It’s not totally inclusive, but does show the process of working with the given feedback.

  Graphics are too large

  One piece of feedback was that sprites are too large. Let’s address that.

  Figure 6_2 below shows the main player sprite setting:

  Figure 6_2: Showing current player sprite

  The current size is 192x182. We’ll reduce the size by 50%. We can click Edit Image and Resize All Frames, as shown in Figure 6_3:

  Figure 6_3: Resize all frames

  Figure 6_4 shows the settings needed to reduce the size by 50%:

  Figure 6_4: Reducing size by 50%

  We will repeat the process with all the game level sprites.

  Because the sprites has changed size, we will also update the sprite origin of all sprites as we go.

  You should now test the game and ensure everything works as planned. You will probably find that a few tweaks are needed here and there, namely check that the collision masks cover the correct location and size, and that spawning of weapons takes into the reduced sizes.

  Figure 6_5 shows the game with all sprites reduced by 50%:

  Figure 6_5: Showing game with updated sprite sizes

  Not responsive enough

  Another piece of feedback was that player movement was a bit sluggish.

  The current movement code is shown below:

  //keep in screen

  y=clamp(y,80,room_height-80);

  //move

  //up down

  nokey=keyboard_check(ord("W"))+keyboard_check(ord("S"));

  if nokey==0

  {

  if y
  if y>flying_level y-=2;

  }

  //forward back

  if keyboard_check(ord("D"))

  {

  x+=4;

  }

  if keyboard_check(ord("A"))

  {

  x-=4;

  }

  x=clamp(x,xx-40,xx+180);

  nokey=keyboard_check(ord("A"))+keyboard_check(ord("D"));

  if nokey==0

  {

  if x
  if x>xx x-=2;

  }

  if keyboard_check(ord("W"))

  {

  y-=4;

  }

  if keyboard_check(ord("S"))

  {

  y+=4;

  }

  We’ll make it 50% more responsive by changing the code to that below. Code in red has been changed:

  //keep in screen

  y=clamp(y,80,room_height-80);

  //move

  //up down

  nokey=keyboard_check(ord("W"))+keyboard_check(ord("S"));

  if nokey==0

  {

  if y
  if y>flying_level y-=3;

  }

  //forward back

  if keyboard_check(ord("D"))

  {

  x+=6;

  }

  if keyboard_check(ord("A"))

  {

  x-=6;

  }

  x=clamp(x,xx-40,xx+180);

  nokey=keyboard_check(ord("A"))+keyboard_check(ord("D"));

  if nokey==0

  {

  if x
  if x>xx x-=3;

  }

  if keyboard_check(ord("W"))

  {

  y-=6;

  }

  if keyboard_check(ord("S"))

  {

  y+=6;

  }

  A quick test shows a marked improvement in player’s control.

  Too easy

  Other feedback was that the game was too easy. Let’s address the underlying reasons for that:

  Enemy hp too low

  Enemy projectiles too slow

  The original code for setting the ground enemy hp was:

  start_hp=global.level;

  Let’s change that to:

  start_hp=global.level*global.level;

  and change the code for the flying enemy to:

  start_hp=global.level*global.level*2;

  and for the boss enemy to:

  start_hp=global.level*global.level*5;

  We’ll make the enemy weapons move and fire faster.

  We’ll start with the flying enemy, the code in the Alarm 0 Event was:

  alarm[0]=room_speed*4;

  arrow=instance_create_layer(x,y,"Enemy_Missile",obj_enemy_arrow_1);

  ang=point_direction(x,y,obj_player.x,obj_player.y);

  arrow.direction=ang;

  arrow.image_angle=ang;

  arrow.speed=10;

  arrow.strength=global.level;

  We’ll change that to:

  alarm[0]=room_speed*3;

  arrow=instance_create_layer(x,y,"Enemy_Missile",obj_enemy_arrow_1);

  ang=point_direction(x,y,obj_player.x,obj_player.y);

  arrow.direction=ang;

  arrow.image_angle=ang;

  arrow.speed=12;

  arrow.strength=global.level;

  This is increase the shooting frequency and projectile speed.

  Similarly we’ll change the shooting code for the boss enemy from:

  alarm[0]=room_speed*3;

  ball=instance_create_layer(x,y,"Enemy_Ball",obj_ball);

  ball.direction=image_angle;

  ball.speed=8;

  to:

  alarm[0]=room_speed*2;

  ball=instance_create_layer(x,y,"Enemy_Ball",obj_ball);

  ball.direction=image_angle;

  ball.speed=12;

  A quick play through of a few levels, shows a marked increase in difficulty.

  Player weapons are too slow

  We can increase the shoot rate and projectile speed with just a few code changes.

  The current code for Global Mouse Left Pressed is:

  if can_shoot_1==false exit;

  var xx = x + lengthdir_x(64, image_angle);

  var yy = y + lengthdir_y(64, image_angle);

  missile=instance_create_layer(xx,yy,"Missiles",obj_player_rocket);

  missile.image_angle=image_angle;

  missile.direction=image_angle;

  missile.speed=4;

  can_shoot_1
=false;

  alarm[1]=room_speed*2;

  We’ll change that to:

  if can_shoot_1==false exit;

  var xx = x + lengthdir_x(64, image_angle);

  var yy = y + lengthdir_y(64, image_angle);

  missile=instance_create_layer(xx,yy,"Missiles",obj_player_rocket);

  missile.image_angle=image_angle;

  missile.direction=image_angle;

  missile.speed=6;

  can_shoot_1=false;

  alarm[1]=room_speed*1.5;

  And the code for Global Right Mouse Pressed from:

  if global.level<13 exit;

  if can_shoot_2==false exit;

  alarm[1]=room_speed;

  show_debug_message("Missile 2");

  var xx = x + lengthdir_x(64, image_angle);

  var yy = y + lengthdir_y(64, image_angle);

  missile=instance_create_layer(xx,yy,"Missiles",obj_player_missile);

  missile.image_angle=image_angle;

  missile.direction=image_angle;

  missile.speed=8;

  can_shoot_2=false;

  alarm[2]=room_speed*2;

  to:

 

‹ Prev