Introduction To Game Design & Programming in GameMaker Studio 2

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

by Ben Tyers


  You are destroying instances when no longer needed (i.e. outside the room)

  You are cleaning up paths, or ds structures when done with

  Room sizes are set up with the same aspect ratio (or room size)

  Your beta testers have toughly tested the game (see below)

  Finally, send out the compiled project file (whether for PC, iOS, Android, etc.) and get your beta-testers to check it works OK on a range of different devices as expected. Fingers crossed that everything works as intended – otherwise a few more weeks of tweaks maybe required.

  Congratulations! You have made a computer game. I hope it leads on to a great career in game making.

  Chapter 9 Publishing & Game Promotion

  So, you’ve spent several hundred hours making your game, the least people can do is play it!

  There are a few places you can promote your game:

  Social Media

  A great way to make gamers aware of your game, and to direct them to sites to download / play your creation.

  YoYo Games Forum

  Fellow game creators love to see what you’ve made, and are more than happy to provide feedback.

  Steam

  Get your game listed on probably the biggest gaming site around. Requires a fee, which is recouped if you reach a certain amount of sales.

  Itch.io

  A great site made for indies’ games. A great way to get your game seen and make a few $$.

  GameJolt

  Another great place to list your game. Easy to use, and simple to create a revenue stream for your game.

  Google Play

  If you have the export module for Google Play, it is a great to list and sell your games. Your game will probably need some tweaking if originally made for Windows – though worth the effort.

  Chapter 10 Summary

  Target Audience

  When designing your game and acquiring assets you should keep in mind your target audience. You should consider such things as:

  Age range

  Will they play on PC, tablet or phone?

  What genre are they expecting?

  If aimed at a younger audience, who will you make revenue?

  Pricing

  OK, so you’ve made a game (maybe your first). Earning a bit of cash would be nice. There are a few ways to make revenue from your production. You can list your game in an online Appstore, such as Google Play. You could charge for in-game purchases – such as coins or weapon upgrades. Alternatively you can tie it in with your Patreon account and provide exclusive levels or upgrades every month.

  Working as a Team

  One of the best things about indie game development is the friendliness and willingness to help. Although most indie’s work alone, some prefer to work in small teams. This is great if you each have certain skills – for example: programming, artwork, music, game promotion. A team project can be great if everyone plays their role and communicates well, allowing the projects to progress quickly.

  That said, it doesn’t always go as planned. You may find that some team members have no experience working as part of a team, which can cause issues. All teams really require someone to take on the management role and keep the wheels in motion – a skill that does take some time and effort to learn.

  Some indie’s do it for the fun, some for the (hopefully) money, and some as stepping-stone that may lead onto greater things. Working as part of a team (or managing one) can be very rewarding and look great on a resume.

  Before accepting a role in a team project, I recommend spending some time researching the project leader or other team members. I have seen a number of requests for team members from people who have no prior knowledge to game development, programming or other expertise in managing the project. I say hats off to them for trying – but I see such projects doomed to failure.

  Useful Links

  The internet is a big place, but here are some sites I frequently frequent:

  forum.YoYoGames.com

  A great community for asking and answering GameMaker related questions and issues.

  GameDeveloperStudio.com

  My favourite graphical assets site. Premade sprites, in high quality and fairly priced. Several assets are free, so a great place to visit if you have a low budget.

  SoundImage.org

  A huge collection of free music and many sound effects (credit asked for). If you are looking for something usable for your game, this is a great place to start.

  GraphicRiver.net

  A massive collection of premade sprites. Cheap for personal use, commercial use is a bit more expensive – but if you have the funds it’s a great place to buy from.

  CreativeMarket.com

  Another great site for purchase premade graphics.

  OpenGameArt.org

  Huge selection of artwork, mostly on CC or CC-BY. Great if you are working with a low or zero budget.

  Google

  Have a quick coding question? Need some example GML code? A well-formed search query will bring up some useful results.

  KickStarter.com

  A crowd funding site for raising funds for your project.

  IndieGoGo.com

  Another crowd funding site for raising funds for your project.

  Crediting Creators

  If you have ever made your own assets, you will appreciate how much time and effort goes into making them. As such you should also credit authors in the way they dictate, whether that would be just a name or website link. Some creators provide multiple licence options, maybe access for non-commercial use for $20, or $150 for single commercial use. Please buy the correct licence as a way of thanking the creator. Some assets (such as fonts) are usually free for private use, and perhaps a donation for commercial use.

  Consider providing a free copy of your game (or key) so creators can see their assets in use. Always check for usage terms for any assets you use, if in doubt contact the creator and ask.

  The above is not legal advice, I’m just pointing out that asset use generally has some terms attached for what you can use it for.

  Educational Use

  When I first got the bug for development (around the age of 8), there were few options available with regards to software and hardware for making games. Time have changed since then. GameMaker Studio 2 allows for quickly making mini game projects – without a hue understanding of programming but has the scope and power that allow commercial quality games to be made. How I wish something like GameMaker Studio existed when I started.

  GameMaker Studio 2 is ideally suited for educational use. The software itself has an educational licence option, a huge number of online tutorials and videos, along with some great books, such as the one that you are reading now ??.

  It’s great for younger students, who require instant satisfaction. With GameMaker Studio 2, within 5 minutes you can have an object moving around a screen, making noises and responding player input. As such over the course of a term students can start off with something very basic, and progressively be improved over a number of weeks. There are a few books available for teaching GML in the classroom, such as another of my books, Beginning GameMaker Studio 2.

  For educators looking to teach GameMaker Studio 2 and it’s GML language, the learning curve is quite small. If you have previous knowledge of C# or similar languages, the transition is not so tough.

  Like most programming languages, GML requires some understanding of maths to make the most out of it – therefore not making GML suitable for younger learners. Fortunately, GameMaker Studio 2 has a Drag & Drop system that allows creation of games with little or no code. This allows younger users to make basic games, and learn the logic needed for when they progress onto GML coding.

  Where Next

  OK, so you now know the basics. Where next?

  I have some other books out that teach further GML and game creation. The ones that may interest you are:

  Beginning GameMaker Studio

  Covers the basic of GML,
suitable for educational use.

  100 Programming Challenges

  100 challenges to push you GML skills to their limit. Shows the basic code you will need and leaves it to you to make a working example, solutions to the challenges in GMZ format.

  Practical GameMaker Projects

  Covers the coding of a number of games.

  Programming is just one part of making a game. Have a go at trying to learn to use software for the creation of graphics and audio. If you intend make a career out of game making, this are great skills to learn when you decide to full time indie or seek employment in a studio.

  Maths is integral to making games. Perhaps consider taking an evening class, or home study course in basic or more advanced – you’ll be amazed how much of what you learn can be applied to game design and programming.

  The website, forum.yoyogames.com holds regular game jams. These jams challenge you to make a game on a theme within the time period (usually 3 days). This is a great way to force you to actually finish a game (I have lots of unfinished projects). It’s a great way to see what other devs are making and to share feedback. There usually a number of community prizes, either for winning or just taking part. Certainly worth checking out.

  Conclusion

  Hopefully you will now have a better idea of how to approach your own game project and considerations to consider along your journey.

  I had a great time writing this book, and I hope that you had enjoyment from reading it.

  If you ever have any questions or issues about GML programming or GameMaker Studio in general, I suggest you try out the forums at forum.yoyogames.com. It a great and friendly place with lots of skilled GMS2 users willing to help you out – providing you can demonstrate that you have put some effort in and not expecting someone else to do all the work for you.

  If you find any issues of problems with this book (such as omissions or mistakes) please drop me an email to: [email protected]

  The appendix following covers some basic GML which you are more than likely to use within your game endeavours.

  Appendix

  This appendix gives a brief introduction to programming with GameMaker Studio 2’s GML language.

  It is suggested to use this for reference, or study after completing Chapter 7, or at least the programming introduction of Chapter 7. The contents in this appendix comes from my sister book, Beginning GameMaker Studio 2, which includes additional content, and material for educational use, and is available on Amazon.

  Appendix 1 Variables

  This section deals with the two main variable types: strings and numbers (also known as real values). You need to learn the different types, what you can do with them, how to combine them, and how to draw them on the screen.

  Variables are an important part of every game. You can use variables for things such as the following:

  Keeping track of score, health, and lives

  Processing data

  Performing math’s functions

  Moving objects

  Drawing data / text on screen

  Keeping track of a player’s progress

  Making a game easier / harder

  Saving values such as score

  Positioning instances

  Determing whether player has weapon upgrade

  + Lots more

  Note: There are a number of variable types. The ones focused on in this book are built-in, instance, local and global.

  Built-in variables include health, score, and lives. These are automatically global in nature and can be accessed by any other object.

  User-defined global variables that start with global. Infront of them, for example, global.weapon, can also be accessed by any other object within your game. You’ll learn more about instance and global variables, and how to use them as you work through this book.

  Instance variables, for example x and y, and size. These are used only by the specific instance that uses it.

  The basic code for drawing text is:

  draw_text(x_position, y_position, text);

  A real working example would be: To draw text “Hello World” at position 100x100:

  draw_text(100, 100, "Hello World");

  To draw a variable with a number (real value), for example:

  weight=250;

  draw_text(100, 120, weight);

  Create an object, obj_example_1, add a Create Event by clicking Add Event, followed by Create Event.

  Add the following GML to the Create Event, entering the following with your own name:

  example_text="My Name Is Ben";

  Create a Draw Event and add the following code. To do this, add a Draw Event, and put the following code:

  draw_text(200,200,example_text);

  Create a room room_example and place one instance of this object in the room. Do this by clicking the Create a Room button at the top of the screen. In the room editor, in the settings tab, set the name as room_1, click the object tab, and then click in the room to create an instance. Close the room, click File and Save As, and then give the project the name example 1.

  This will draw the value of example_text at the screen position 200,200, with 0,0 being at the top left. An example showing room positions is Figure A_1_1:

  Figure A_1_1. Showing various locations in a room

  Real numbers can be whole integers: for example, 20; or include decimals, for example, 3.14.

  Double-click on obj_example_1 in the resource tree. Change the Create Event code to:

  my_age=21;

  Then use the following code in the Draw Event:

  draw_text(100, 120, my_age);

  Save and test.

  You can add strings together using concatenation:

  first_name="Samuel";

  last_name="Raven";

  my_name=first_name+" "+last_name;

  .

  You can do mathematical operations on numbers:

  cakes=8;

  cost=5;

  total_cost=cakes*cost;

  You can perform mathematical calculations on real numbers, for example, +, -, * and /. GameMaker also allows use of other operators such as mod and div. For example:

  a=20;

  b=7;

  Where:

  c=a mod b;

  would set c as 6; (b goes into a twice with a remainder of 6).

  c=a div b;

  would set c as 2 (b goes into a 2 times).

  c=a / b;

  would set c as 2.65 (approx.).

  You can generate random numbers using a number of functions:

  number=irandom(20);

  The above would give an integer (a whole number) between 0 and 20 inclusive.

  To make testing easier, GameMaker Studio 2 will create the same sequence of numbers each time a game is played through. You can override this setting by using the following code:

  randomize();

  This only needs to be performed once, for example, in the room creation code.

  You cannot add together numbers and strings directly. For example, this would create an error:

  example_text="My age is:";

  my_age=17;

  name_and_age=example_text+my_age; //This Line Creates an Error

  You can convert a number to a string using this:

  name_and_age=example_text+string(my_age);

  This works, as it converts the number to a string and adds to the other string.

  draw_text(50,50,name_and_age);

  Will draw "My age is: 17" at position 50,50.

  Equally, you can change a string to a variable; however it will cause an error only when it doesn’t correspond to a number. For example “-5” and “2.45” consist of more than just numbers, but real() can process them fine.

  a="3.14";

  b=real(a);

  Would set a b as 3.14.

  Extra Useful Code:

  You can get a user to enter integer/string with this:

  age=get_integer("Age? ", 1);

  name=get_string("Name? ",
"Enter Your Name Here");

  Note: These two functions above should really be only used for testing purposes and are fine for beginners. as you advance, you should use get_integer_async and get_string_async, or create your own text input system. There is an example for each of these in the manual.

  Variables can also be set to true or false (which also return as 1 or 0, respectively, but you should really always try to use the built-in constants, true and false). These are generally called flags, and will be used a lot when you make larger games. This type of variable is discussed more in Appendix 2 Conditionals.

  There are also built-in constants and you can also define your own as macros.

  You should now be aware of the two main types of variables: first, numbers, such as these:

  age=10;

  pay_per_hour=2.17;

  bonus=5000;

  And second, strings, such as these:

  name="Ben";

  level_name="Dungeon";

  food="Cheese";

  date="Twentieth";

  Basic Projects

  A) Make a program that takes in name, age, and date of birth and displays it on the

  screen.

  Point for attempting this question - 1 Point for making a working example

  1 Point for using good variable names and tidy GML formatting

  B) Make a program that takes in five numbers and calculates the average.

  Point for attempting this question

  Point for using good variable descriptions

  Advanced Project

  C) Make a program where you enter the date and the program displays correct tag, like 1st, or 23rd.

  Point for attempting this question

  Point for good formatting

  Points for using their own data input system

  Point for displaying output nicely on screen

  PROJECTS NOTES

 

‹ Prev