Tag Archives: GameMaker Studio 2

GameMaker Studio 2 hands-on experience

After getting our hands-on experience with a variety of apps and game engines, I decided to team up with Daniel and Meng to explore a game engine we found online called “GameMaker Studio 2“.

About GameMaker Studio 2

To give you a brief intro: GameMaker Studio 2 is a game engine developed by YoYo Games Ltd. It’s a cross-platform engine so you can make games for Windows, Mac, mobile devices or even gaming consoles like Nintendo Switch! You can find a huge community for this engine. On top of that, there’s a sufficient amount of tutorials and support documents on the website. As a new game maker, you should be able to find the support you need on the website with ease. Sadly though, the engine is not free, but you can get a 30-day trial before purchasing the actual licenses.

The main feature about GameMaker Studio2 is that there’re two ways to make games:

  • DnD (Drag and Drop) method:
    This method is recommended to people who have the passion to make games but doesn’t have the extensive coding knowledge. Via this method, you can rely more on the graphical UI to program the game for you. As long as you have the idea, you can make it a reality.
    (My buddy Daniel has some deeper insight on this method so go ahead if you’re interested in learning more about the DnD method)

  • GML (GameMaker Language) method:
    It might sound intimidating but to put it in simple words, it’s just the same UI but without the Graphical elements. You have to go back to your root – do the coding/programming yourself. As for the language itself, you should feel at home if you have previously learned a programming language before. Just like any other programming language(javascript, Python, html, etc.) out there, the overarching logic is pretty much the same. It’s just that there’re several teeny-tiny bits of differences here and there. As a TLM student, you should be able to pick up GML(at least the basics…) real fast after reading the documentation.

Let’s talk about how to “actually” localize game in GameMaker Studios 2 via the GML method…

So here we have a sample game to demonstrate: Space Rocks
If you follow the tutorial online, you should be able to make one yourself!

Space Rocks

So the idea I have is pretty similar to Javascript i18n “24 ways”. For GameMaker Studio 2 though, we’re going to be using json files instead of javascript. Here’s a quick concept map of how am I going to localize games in GameMaker Studio 2 using the GML method:

To localize games in GameMaker Studio 2 via the GML method…
  1. Create functions to handle linguistic assets.
  2. Wrap the translatable strings with the function.
  3. Create another function to manage the file.
  4. Holding the string in json files
  5. Create a function to cycle the language(or create a language picker if you prefer.
  6. That’s it!

Here we go!

For details on the actual functions and language manager file, I recommend you checking out this Multilingual game tutorial guide by YawningDad on Youtube. This video tutorial helps me out a lot during the research phase. Without his clear explanation of how everything works together in GameMaker Studio 2, I wouldn’t have been able to make this happen.

Alright, now you need to wrap your strings just as you would with JavaScript 24 ways. Here’s a quick sample of your game files before & after you wrap the strings with the function:

Then, you need to create json files to hold all the actual text which are now wrapped by our functions. In the json file, there’re two rules you need to follow.
You need to…

  • Declare the language for the file.
  • Pair up the correct strings and variables

And this is what the json file should look like:

We’re almost there. Now we just need to add an event (or a dropdown menu) to choose the language we want. To do so, all you need is to add an event in the game object to call the cycle language function. In this case, we’ll use the key “L” as our language switcher.

Press “L” to switch your language

That’s it. Now it’s time to run your game!

Careful! Font and Unicode issue

One thing to remind you is that you might need to check your font setting if there’s accent (á, é, í, ó, ú, ü, ñ, ¿, ¡… ) or CCJK characters involved. Your text might not display properly if you don’t have your font setting on point.

Here’s how to fix the issue:

  • First, you need to check the font and see if it’s Unicode supported. Some fonts do not support characters out of their own locale. If that’s the case, you might have to use a different font instead.
  • In GameMaker Studio 2, you can select what characters to use in your font setting. For most Romance language, characters range from 32 ~ 255 within the ASCII table should get you covered. As for CCJK, you have to look them up on the Internet and catch them as specific as possible.

    Why not just select a huge, random range like 1 ~ 1000000000?
    Well, that wouldn’t work cause it’s gonna create a huge file and that would cause performance issues. Plus, GameMaker Studio 2 would have to compress the font file to make sure the font loads. Even if you actually get the characters selected, the characters still would not display as it should be because they’re compressed.

Success!!!

Congrats!! Now you know how to localize aa game in GameMaker Studio 2. Of course, there are definitely rooms for improvement for the code. But for now, you should give yourself a pat on the back for your success on localizing a game in GameMaker Studio 2! Yeah!