Skip to main content

Adding Achievements to Your Game

You will learn how to add achievements to the game, group them and moderate. Unlock player achievements and track progress.

Adding achievements

We tried to make adding achievements as convenient as possible. To add an achievement, you need to go to the achievement management page of your project.

Then you need to click on the "Add achievement" button and the add form will open.

Let's look at all the fields in order.

  1. Tag is an optional tag for more convenient achievement selection. You can select achievements via a numeric ID or via a tag. For example, you can use the tag "COLLECT_COINS_100" with a self-explanatory name, instead of ID: 17561.

  2. VK mission ID - mission number in VK Direct Games. The field is visible when a Vkontakte platform connected. You can enter here any positive number > 2 corresponding to the mission number. Then, when the achievement is unlocked, the Vkontakte mission will be immediately completed.

    info

    You need to add a Service Key in the settings of the VK platform to unlock the mission.

  1. Name — The name of the achievement. Can be translated into any available language. Required field.
info

It is not necessary to fill in the field in English if the game is focused only on another language. If the user has Russian language, then the system will first look for a translation in Russian, and then English if no translation is found. You can just write in this field in the language you need.

  1. Description — Description - how to get the achievement. Can be translated into any available language. Optional field.

  2. Rarity — Rarity of achievement. The definition of rarity falls on your shoulders. You can select easy, hard, and very hard achievements and assign them a rarity. You can interpret rarity in your own way, experiment with it.

  1. Icon — Achievement icon. We recommend uploading an icon with a size of at least 256x256. But there is no restrictions on smaller icons, as well as larger ones. It's all up to you.

  1. Icon pack — Ready-made pack of icons for achievements. If you do not have icons at hand, then you can use our set without any problems. It has more than 60 icons and the list grows over time.

  1. After everything is filled in, click the add button and you're done!

Example of a completed form:

Adding a Group of Achievements

After the achievement was created, it was moved to the "Ungrouped" group. All achievements that have not yet been assigned to a group are stored there. The player sees them under the name "Others" after all the groups listed.

To somehow categorize the achievements, as well as be able to prioritize them — it is necessary to combine them into a group.

Let's create a group. Fields work in a similar way to achievement.

Created group:

Now you can create achievements inside the group. Or you can move the achievement to the group using Drag & Drop. You can also open the achievement edit form and manually select the group to transfer.

If you have several groups, achievements can be dragged from group to group. And the groups can be sorted using the arrows.

Viewing Achievements in the Game

Achievements overlay can be opened in the game using the appropriate method.

gp.achievements.open();

The first screen of the overlay shows the progress of the player's achievements. Below is a list of all the achievement groups. Each group has its own progress, and each achievement is marked with a medal if unlocked.

You can pause the game or mute the sound when the achievement window opens. If an achievement is unlocked during gameplay, the user will want to click on the achievement to view more details. In this case, it is better to pause the game. And continue when closing the overlay.

gp.achievements.on('open', () => {
game.pause();
audio.mute();
});

gp.achievements.on('close', () => {
game.resume();
audio.unmute();
});

You can draw the list of achievements yourself in the game, more details in the documentation.

Unlocking Achievements in the Game

Achievements can be unlocked using the appropriate method. You can pass ID or Tag as you like.

gp.achievements.unlock({ tag: 'COLLECT_COINS_100' });

After the achievement has been successfully unlocked — a toast will appear with the completed achievement and its rarity, if it is higher than common.

On the project page, you can see the 5 latest achievements unlocked.

Player Moderation

You are considered a full-fledged administrator of the game. So you decide to whom to give achievements, and from whom to take away.

In fact, managing players' achievements will allow you to solve problems with possible errors in obtaining achievements or cheating.

You can find the player in the list and open his list of achievements.

In this window, you can manage the player's achievements. Cancel or unlock them personally to the player. Keep in mind that the Vkontakte mission cannot be completed through the control panel. Only on the player's side directly in the game.

tip

This is a great way to check your achievements while testing your game. You can unlock an achievement in the game and cancel it in the panel.

That's all. We wish you success in making games!

Stay in Touch

Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.

GamePush Community Telegram: @gs_community.

For your suggestions e-mail: [email protected]

We Wish you Success!