Player Experience (XP) Framework

:warning: Framework Tutorial, still in progress.

:mortar_board: LESSON 48 :mortar_board:

Player Experience (XP) Framework

In this post, I will share my Player Experience Framework and, over time, I will update, maintain, and incorporate new features into this framework, as well as gather community feedback to improve it. After all, let’s learn together!

What is an experience (XP) Framework?

An Experience (XP) Framework in game design refers to a structured system that manages how players earn and calculate experience points (XP) in a game. This framework is essential for games where progression is tied to leveling up characters, unlocking new abilities, or accessing new content. Typically, the XP defines the rules and mechanics through which players gain experience based on their actions within the game, such as completing quests, defeating enemies, or achieving specific milestones.

What should you know previously about GM?

You only need to know how to use the Game Maker Interface. I believe that with Pandapops’ video on basic Game Maker, you will have all the necessary information to reproduce this Framework. If you have difficulty doing it, please leave comments here and I will make sure to adapt and improve the Tutorial.

Terms Definitions

In The Sandbox Game Maker, “Logic” refers to the fundamental programming units that do not use traditional coding. These are implemented through “Behaviors” and “Components,” B/C, Messages, and Tags, which are predefined building blocks that define how objects in the game behave and interact.


Rules represent the second layer of programming which utilizes an interactive UI, similar to Unity’s Visual Scripting. Rules are designed to accommodate more complex logic designs that involve, Rule Sets, as mathematics, HUD control, comparisons between variables, and other advanced functionalities.


Mechanics refer to groups of Logics and Rules that work together to perform specific actions within the game. Typically, these mechanics are formed by many logics operating together. Some examples are “Only Logic” Mechanics or they have both Logic and Rules, known as Game Rules.


Frameworks are foundations of mechanics built to solidify other applications and facilitate future innovations. They provide a structure on which additional mechanics can be built.

Core Mechanics

Core Mechanics are complex sets of one or more frameworks operating simultaneously to form the basis of a game’s main gameplay. These are essential for the core game experience.

Scalability and Control of Level Progression

In many role-playing and action games, the progression of player levels is designed with scalability and control in mind. This ensures a balanced and engaging player experience, while also maintaining the game’s long-term challenge and appeal. Typically, games such as World of Warcraft and Diablo set a finite upper limit on levels, often capping around 80 to 100. This finite scaling is crucial for allowing developers to carefully design each level’s progression, ensuring that each step feels rewarding and significant.

Level scalability refers to the game’s ability to maintain gameplay balance and challenge as the player progresses. This includes not only increasing the player’s power through levels and abilities but also scaling the difficulty of the game environments and enemies. A well-scaled game keeps the player challenged throughout their journey, avoiding scenarios where early levels feel trivial or where later levels become impossibly difficult.

Control over level progression is another critical aspect of game design. Developers often implement systems that allow for detailed control of how players advance through levels. This might involve adjusting the amount of experience points required to level up or changing the rewards and challenges presented at different game stages. Such control helps in creating a paced learning curve and keeps the game interesting for players across various skill levels.

Semi-dynamic control of level progression is a method used by developers to manage this scalability. While not fully dynamic, this approach allows for some flexibility in how the game responds to player actions. For example, experience requirements might increase as players approach higher levels, or additional quests and challenges might become available to gradually introduce more complex game mechanics.

It’s also important to consider how level caps influence game design. By setting a maximum level, developers can plan a definitive endgame, crafting experiences and content that are tailored to high-level play. This endgame content often includes more complex challenges and powerful rewards, providing motivation for players to reach and explore the upper limits of level progression.

Ultimately, the design of level progression systems must balance player satisfaction with technical and narrative constraints. The scalability and control of these systems determine not only the pace at which players progress but also how they experience the game’s story and its world. Through careful planning and implementation of level scalability and control, developers can craft compelling, immersive worlds that players are eager to explore and master.

The impact of level progression on the game economy is a critical aspect that developers must manage carefully to maintain game integrity and ensure a balanced experience. As players progress through levels, the way they earn and spend in-game resources changes significantly. For instance, higher levels might introduce more expensive items or abilities, which can drastically alter the economic dynamics of the game.

Developers need to ensure that the availability and cost of these resources are balanced against the players’ ability to earn in-game currency, preventing economic inflation or deflation that could skew the gameplay experience. Facilitating easy adjustments to these economic parameters is essential, allowing developers to fine-tune the game based on player interactions and feedback. This adaptive approach helps in maintaining an engaging and fair play environment, encouraging sustained player involvement and satisfaction.

Framework Goals
  1. Level Definition
    1.1. Establish a maximum level cap (Level 100).
    1.2. Each level requires an increasing amount of experience points (XP) to advance. (Manually)

  2. Experience Gains:
    2.1 Increase the XP awarded for more difficult actions or stronger enemies.
    2.2 Award XP for actions:
    -Defeating diferent enemies
    -Completing quests
    -Discovering new locations.
    -Openning Chests
    -Collecting Materials
    -Crafting Materials

  3. Scalability of Challenges:
    3.1 Adjust the difficulty of enemies and quests as the player’s level increases.
    3.2 Introduce enemies with unique and challenging abilities at higher levels.

  4. Rewards and Equipment:
    4.1 Offer equipment and items that can be unlocked or purchased as the player progresses.
    4.2 Items at higher levels should be visibly more powerful and useful.

  5. Semi-Dynamic Progression System:
    5.1 Implement a semi-dynamic progression system where game elements adjust based on the player’s actions and progress.
    5.2 Include special events or quests that can accelerate the player’s progression if completed.

  6. Economic Impact:
    6.1 Balance the game economy so that earning and spending resources are proportional to the player’s level.
    6.2 Prevent inflation or deflation by adjusting costs and rewards as the player advances through levels.

  7. Abilities and Skill:
    7.1 Unlock new abilities or enhance existing ones at certain level milestones.
    7.2 Allow customization of skills to suit different play styles.

  8. Narrative, Quests, NPCs and Locations:
    8.1 Integrate level progression with the game’s narrative, with story developments driven by the player’s advancement, adjusting Quest, NPCs and Locations depending of the Player’s Level.
    8.2 Diversify quests with varied objectives that encourage exploration and engagement.

  9. User Interface and Feedback:
    9.1 Provide clear and immediate feedback on level progression and XP gains through the user interface.
    9.2 Display progress milestones and future rewards to motivate players.

  10. Testing and Adjusting:
    10.1 Monitor how players interact with the progression system and make adjustments as needed to maintain balance and fun.
    10.2 Conduct A/B testing for different progression approaches and implement the most effective ones.

:mortar_board:Lesson 48-1

Basic XP Variable

Starting from scratch, with a new experience, let’s initially add 2 assets.

Initially, we will create an XP variable controlled by a message with arguments that adds integers to this variable, as shown below.

Logic :point_down:

Flowchart Explained :point_down:
In the logic mechanic, when a player kills an NPC, a message is sent to increase the XP variable using an Rules addition operation and the variable argument, which automatically updates the XP count on the UI.

With this, you will get the following result
YT Video Lesson 48-1 :point_down:

:mortar_board:Lesson 48-2

Implementing Cap to the Variable XP
Why XP have a variable cap?

In game design, the concept of an ‘Experience Cap’ plays a critical role within an Experience (XP) Framework. This cap sets a maximum limit on the amount of experience points (XP) a player can earn at a particular level. Once players reach this cap, they cannot accumulate any more XP until they level up, at which point the cap is often raised, allowing them to continue gaining experience towards the next level. This mechanism ensures a balanced progression system, preventing players from becoming too powerful too quickly. Additionally, the Experience Cap can also involve a minimum threshold, or ‘Minimum Cap’, which is the least XP a player needs to advance to the next level, ensuring players engage with the game’s content sufficiently before progressing.

Change the logic in the following way :point_down:

Next, we need to add Rules and set the “XP Variable” to zero when the max cap is reached. Adding this to the Rules, whenever the MAX cap is reached, that is, the player will level up, we have that the XP variable will return to 0, as follows: :point_down:

With this, you will get the following result
YT Video Lesson 48-2 :point_down:

:mortar_board:Lesson 48-3

Implementing the Level Variable

We therefore need to include which Level we are on along with XP.cap. So let’s delete the message and redo it. Don’t forget to add XP.cap back correctly in the Rules.

How to delete messages?

Go to Edit, Settings, at Messages click on “CHECK LIST”, scroll through the messages, select the desired message, and click on Delete.

Next, let’s create the new message with arguments.

Additionally, we will take three steps

  1. Add the new variable, LEVEL.
  2. We will also ensure that every time XP.cap is triggered, we modify the LEVEL variable to the value of the LEVEL message argument, using a “Set Number Value.”
  3. Add the LEVEL variable to the HUD.

HUD Locations

You can freely change the positions of the variables as you wish; there’s no wrong option here. :point_down:

Future Improvements Notes
HUD UI - XP icon and XP Name

In our framework, the icon already indicates the name in the UI. What would be great here is if the proper name “XP” were placed with the “Level” Number or Text, where we would have a very optmized solution. However, in the current version GameMaker (0.10.6), in the HUD Rules, the name cannot be modified by variable, so we will have to wait a bit for the implementation of the level within the XP slot.

With this, you will get the following result
YT Video Lesson 48-3 :point_down:

:mortar_board:Lesson 48-4

Framework Logics

We’re using a framework that includes just one asset for controlling the levels, named Asset Controller, and another asset, Asset Visual Indicator, that serves as a visual indication to track errors.

Starting when LvL 1, we have a visual indication for each stage. :point_down:

Logic - Level 1 to n :point_down:

Future Improvements Notes

When we are working here at the numpad level, where we need visual cues to easily locate, which in this case is which numpad refers to the level, we will use numpads with numbers to indicate the numpad that has the configuration for the desired level, thus facilitating the handling of logic within GameMaker. Below, I will provide links for those who want the numpads with numbers. Image below :point_down:

I’m still investigating the best way to distribute the numpads to the community, whether through the wishlist or by distributing the file for free. Currently, the format of the catalyst prevents the widespread distribution of these.

This results in the following Video Lesson 48-4 visual response :point_down:

Video Lesson 48-4

:mortar_board: 2. Experience Gains

2.1 Increase the XP awarded for more difficult actions or stronger enemies

Initially, let’s illustrate a progression of 3 levels.

Now, let’s create presets with enemies of different strengths that give varying amounts of XP.

With this, we have the following video Lesson 48-5 :point_down:

Completing Quests

First, we’ll implement the following quest.

This gives us the following result :point_down: (1)


Discovering new locations

(To Do)


Openning Chests

(To Do)


Collecting Materials

(To Do)


Crafting Materials

(To Do)



I’ve been through the videos and am kind of uncertain how to add exp as was shown. The videos show experience being counted but not how you set it up to count it


@Darkist , GM
Thank you for the suggestion, I added a reinforcement on the argumentative messages and how it works in Lesson 48-1 → Flowchart Explained. Thank you for the suggestion. :point_down:

1 Like