Introducción al Desarrollo de Videojuegos con GameMaker · Module 10: Level Design, Cameras, and Game Progression
Level Design with Difficulty Progression
Lesson 47 of 60 · 60 min
Also available in: ES
Fundamentals of Level Design and Difficulty Progression
Level design is the art and discipline of constructing the interactive spaces where a game's core mechanics come to life. In earlier modules, you learned how to give your main character responsive movement, resolve physics collisions, animate states, and configure adversaries with basic patrol AI. However, having a character that handles tightly does not automatically guarantee an enjoyable game. True engagement happens when the environment challenges the player in a fair, varied, and stimulating way, guiding them along a smooth learning curve.
An effective difficulty curve is rooted in maintaining what psychologist Mihály Csíkszentmihályi termed the "flow state." If obstacles are trivial or devoid of danger, boredom sets in. Conversely, if a pixel-perfect jump or an erratic enemy punishes the player without warning or time to react, frustration takes over. As an aspiring level designer, your goal is to structure challenges so that every section introduces, reinforces, and tests a skill without resorting to unfair traps or abrupt difficulty spikes.
To structure this progression cleanly, many game developers rely on the classic four-act structure known in East Asian narrative tradition as Kishōtenketsu, which translates seamlessly to platformer level design: 1) Introduction (Ki): Introduce an obstacle or mechanic in a completely safe environment. 2) Development (Shō): Revisit the mechanic with a slight variation or added demand. 3) Twist (Ten): Combine the mechanic with another established element, shifting the player's pacing. 4) Conclusion (Ketsu): Present a mastery check that brings the lesson together before transitioning to a new area or reward.

Player Metrics: The Invisible Grid Rule
Before placing a single ground tile in a GameMaker room, you must know the exact mathematical limits of your character's movement. In technical terms, these are your "player metrics." If you design without calculating your avatar's maximum jump height and horizontal clearance, you are designing blind—forcing yourself into endless cycles of trial-and-error adjustments.
In the platformer project we have been building throughout this course, the physics variables for our player object (`obj_player`) were defined in its Create event with specific values. Let us review the variables that govern airborne movement and acceleration:
// Configuration snippet in obj_player -> Create Event
move_speed = 4; // Pixels traversed horizontally per frame
grv = 0.3; // Gravity acceleration per frame
jump_speed = -7.5; // Initial upward vertical impulse on jump
hsp = 0; // Current horizontal speed
vsp = 0; // Current vertical speedFrom these constants, we can calculate the jump's physical boundaries. When the player presses jump, the character starts with an initial vertical velocity of -7.5 pixels/frame. On each subsequent frame, gravity (`grv = 0.3`) counteracts that velocity until it reaches zero at the apex of the arc. The number of frames required to reach this peak is simply the jump impulse divided by gravity: 7.5 / 0.3 = 25 frames. During those 25 rising frames, the maximum height reached (h) equals (jump_speed^2) / (2 * grv), giving (56.25) / (0.6) ≈ 93.75 pixels.
Assuming our tilemap grid uses 32x32 pixel cells, 93.75 pixels translates to roughly 2.9 cells. This means the character can clear a 2-tile ledge comfortably, clear a 3-tile ledge only with near-frame-perfect timing and a running start, and can never reach a 4-tile ledge without a bounce pad or double jump. Similarly, total airtime on level ground is double the rise time (50 frames). Moving horizontally at 4 pixels/frame, the maximum theoretical horizontal leap is: 50 frames * 4 pixels/frame = 200 pixels, or approximately 6.25 grid cells of 32 pixels each.
| Metric Type | Measurement (Pixels) | Grid Units (32x32) | Level Design Application |
|---|---|---|---|
| Comfortable Jump Height | 64 px | 2 blocks | Standard platforms for smooth, low-friction navigation. |
| Maximum Jump Height | 92 px | 2.8 blocks (approx. 3) | Secret areas, optional collectibles, or precision challenges. |
| Standing Horizontal Jump | 64 - 96 px | 2 to 3 blocks | Introductory gaps where the player jumps without a running start. |
| Running Horizontal Jump | 160 - 180 px | 5 to 5.5 blocks | Wide chasms demanding committed momentum and precision timing. |
| Ceiling Clearance (Headbonk) | 48 px | 1.5 blocks above head | Required overhead space to prevent accidental jump cutoffs. |
💡 Designer's Golden Rule: Always build critical-path routes around 80% to 85% of the player's maximum physical reach. Reserve jumps requiring 95% to 100% execution strictly for optional routes leading to secrets, collectibles, or bonus lives.
Structuring Jumps: From Core Mechanics to Spatial Challenges
With your metrics defined, you can organize platforming challenges based on spatial awareness and motor demands. In well-designed levels, jumps never repeat in a monotonous, uniform rhythm; they alternate across distances, elevations, timing windows, and margins of error.
1. **Pacing and Rest Jumps:** These are short jumps spanning 1 to 2 grid units onto wide landing surfaces (at least 3 to 4 blocks wide). Their role is to establish an enjoyable cadence while the player advances or gathers basic pickups.
2. **Ceiling-Constrained Jumps (Headbonk):** This setup involves placing a low ceiling or a row of solid blocks directly above the jump's starting edge. If the player jumps too aggressively or prematurely, their head strikes the ceiling before hitting the arc's apex, dumping them into the pit. This forces the player to control their forward momentum and time the leap carefully.
3. **Precision Landing Jumps:** Rather than widening the gap, this jump narrows the landing target down to a single 32x32 block. The player must let go of horizontal input mid-air or feather the stick to avoid sliding off the far edge upon touchdown.
4. **Descending / Waterfall Jumps:** The destination platform sits several tiles lower than the departure point. Because gravity accelerates downward velocity, deep drops obscure the landing zone unless camera framing or level geometry clearly guides the eye. This is where beginner projects often stumble into the worst platforming trap: the blind jump.
💡 Never include blind jumps. A blind jump forces the player to leap into an off-screen void without confirming a landing platform exists. Use coin arcs (`obj_coin`), background torches, or descending terrain silhouettes to signal safe ground below.
Strategic Enemy Placement as Kinetic Obstacles
In Module 7, we built `obj_patrol_enemy`, an enemy that paces horizontally from left to right, reversing direction when encountering a wall or an edge. Scattering these enemies randomly across flat ground turns them into mere target dummies that players casually hop over. For an enemy to enhance gameplay, it must function as a dynamic obstacle locked into the surrounding geometry.
Here are three fundamental spatial roles for patrol enemies:
**A) The Ledge Guardian:** Position an enemy patrolling right at the edge of a landing platform. This turns a routine jump into a timing challenge. The player cannot simply leap across on instinct; they must track the patrol cycle and commit to the landing precisely when the enemy turns its back.
**B) The Pacing Enforcer:** Placed along a long horizontal corridor. If moving in the same direction as the player, it creates pressure and urgency in narrow passages. If approaching head-on, it breaks full-sprint momentum, prompting the player to either hurdle over it or seek vertical cover in ceiling cutouts.
**C) The Mid-Air Stepping Stone:** Place a chasm too wide to cross with a standard jump, featuring a small central platform patrolled by an enemy. The player must calculate an arc to stomp the enemy from above, taking advantage of the bounce impulse (`vsp = jump_speed * 0.8`, implemented in previous lessons) to launch across to the opposite ledge.
Practical Case: Building a Metric Test Room (rm_metric_test)
Professional game designers never balance jump physics in a final production environment. They construct a mechanics testing gym or metric test room first. Let us build one step by step in GameMaker to physically validate your character's capabilities.
Structuring a Full Level Across Four Progressive Segments
Armed with validated metrics from our test room, we can now assemble an entire stage (such as `rm_level_1`). We will divide the stage into four distinct segments, building a natural and satisfying difficulty progression.
**Segment 1: Safe Zone and Calibration (Punishment-Free Learning)** The level begins with a solid wall to the left to prevent backward wandering. The player heads right across continuous, flat terrain. Ahead lies a simple row of coins at floor level, followed by a gentle 2-block-high rise with coins arranged in an arc. This coin arc intuitively demonstrates the character's jump parabola. There are no lethal pits or threats; failing the jump simply means missing a collectible, without losing health or progress.
**Segment 2: Enemy Introduction and Baseline Jumps** Just past the hill, the player meets their first `obj_patrol_enemy`. The terrain remains flat, allowing the player to observe its patrol behavior without the added threat of an abyss. Taking a hit costs 1 hit point (based on our `obj_player` health logic), establishing the threat. Past this encounter sits the stage's first pit, intentionally made only 2 blocks wide with a safe floor below and stairs back up. Failure here teaches the mechanic without imposing a fatal penalty.
**Segment 3: The Combined Challenge (The Twist or 'Ten')** Now individual mechanics combine into a compound challenge. The player faces a bottomless pit that will cost a life upon falling. Crossing requires landing across two floating platforms, each 2 blocks wide. The second platform hosts an active patrol enemy. The player must gauge forward momentum, land cleanly, track the enemy's facing direction, and execute a timed stomp to bounce across to the far ledge. To prevent frustration, place a checkpoint flag (`obj_checkpoint`) right before this segment.
**Segment 4: Climax, Mastery, and Pacing Resolution** The final stretch tests complete mastery of airborne control. A vertical shaft requires climbing under low ceilings that penalize over-jumping, combined with patrol enemies pacing along the ledges. Clearing this ascent leads to an open, hazard-free plateau featuring a treasure chest or exit door (`obj_door`), delivering a moment of relief and accomplishment before transitioning to the next room.
Visual Guidance and Environmental Signposting
A frequent oversight among junior developers is assuming the player naturally knows where to go. In a 2D environment, presenting multiple paths without visual hierarchy leads to confusion and wandering. Environmental signposting resolves this problem organically.
Signposting does not mean plastering the screen with bright arrow markers; it relies on subtle artistic and composition techniques:
1. **Collectible Breadcrumbs:** Coins (`obj_coin`) are the clearest guidance tool in platformer design. Placing coin trails not only rewards exploration, but literally sketches the safe jump arc through the air, guiding players through hazards and blind curves.
2. **Lighting and Visual Hierarchy:** The human eye instinctively tracks high-contrast and brighter focal points. Walkable elements (ground, walls, ledges) must maintain crisp silhouettes and clear separation from the background. Keep backgrounds desaturated or slightly darker so the gameplay plane remains readable at a glance.
3. **Directional Environmental Props:** Wall torches, angled foliage, tilted wooden support beams, and stone cracks can subtly lead the player's peripheral vision forward (typically left to right in classic western platformers).
Code Implementation: Risk Area Visualizers and In-Game Debugging
During level construction in GameMaker, having an in-engine overlay that displays enemy patrol ranges and jump thresholds during gameplay test runs (F5) is invaluable. Let us write a lightweight debug overlay inside `obj_patrol_enemy` to track its patrol vectors without altering final game art.
Open `obj_patrol_enemy` and locate its Draw event. If this object previously lacked a Draw event, GameMaker was drawing its sprite automatically. When defining a custom Draw event, always call `draw_self()` first so the sprite renders normally, then draw debug vectors conditionally when a global debug flag is enabled.
// obj_patrol_enemy -> Draw Event
// 1. Draw the base sprite with its normal transforms
draw_self();
// 2. If debug mode is active, render spatial guides
if (global.debug_mode == true)
{
// Draw a directional vector showing patrol heading
var line_length = 32;
var target_x = x + (dir * line_length);
draw_set_color(c_red);
draw_line_width(x, y, target_x, y, 2);
// Draw a semi-transparent danger circle showing contact threat radius
draw_set_alpha(0.25);
draw_circle_color(x, y, 16, c_yellow, c_red, false);
draw_set_alpha(1.0); // Always restore default alpha
draw_set_color(c_white); // Always restore default draw color
}To toggle these debug overlays during testing, use your persistent manager object (such as `obj_game_controller`), binding the F1 key inside its Step event:
// obj_game_controller -> Step Event
// Toggle debug visualization with F1
if (keyboard_check_pressed(vk_f1))
{
global.debug_mode = !global.debug_mode;
}Ensure you initialize `global.debug_mode = false;` in the Create event of `obj_game_controller` to avoid referencing an undeclared variable. Toggling F1 during test runs reveals active enemy patrol trajectories, letting you instantly spot overlapping hazards or crowded landing zones.
Common Level Design Mistakes and How to Fix Them
When starting out with level design, it is easy to fall into patterns that frustrate players without creating meaningful challenge. Recognizing these design traps early will save you significant iteration time and keep your levels feeling responsive and fair:
1. **Uniform Grid Syndrome:** Designing where every platform is 3 tiles wide, separated by identical 2-tile pits across the entire stage. The layout may function technically, but it lacks rhythm and personality. Vary your cadence: alternate sprint sections with single-block precision hops and vertical ascents.
2. **Disproportionate Early Punishment:** Placing lethal spikes or instant-death pits within the first 10 seconds of stage one demoralizes players before they have a feel for character weight and momentum. Early mistakes should cost positioning or a minor sliver of health, never an instant reset.
3. **Blind Landing Hazards:** Forcing a high leap onto an elevated platform where an enemy collides with the player on frame one leaves no reaction window. Ensure threats are visible before the jump begins, or telegraph them via audio cues and environmental signposting.
4. **Sensory and Mechanical Overload:** Introducing a moving platform, two projectile enemies, ceiling spikes, and a maximum-distance leap simultaneously causes cognitive overload rather than excitement. Introduce mechanics in isolation first, combining them only after the player has demonstrated confidence with each component.
Practical Exercises
Apply your understanding of jump metrics, level pacing, and debug tooling by completing these three practical exercises in your GameMaker project:
Summary
- Effective level design preserves the player's 'flow state,' striking a balance between trivial repetition and unfair difficulty spikes.
- The Kishōtenketsu structure (Introduction, Development, Twist, and Mastery) provides a proven blueprint for introducing and compounding spatial mechanics.
- Player metrics (maximum height, jump distance, and run speed) mathematically determine safe platform spacing and layout limits.
- Critical-path obstacles should demand roughly 80% to 85% of character reach, reserving near-maximum limits for optional secrets.
- Enemies function as kinetic obstacles: when placed thoughtfully, they serve as ledge guardians, pacing enforcers, or aerial bounce pads.
- Environmental signposting with coin trails and visual contrast eliminates disorientation and removes frustrating blind jumps.
- In-engine debug overlays built in GML enable real-time tracking of patrol ranges and collision thresholds during playtesting.
Practise what you learned
Exercise 1 · 1 point
Place the four stages of the Kishōtenketsu structure in chronological order as applied to level design and mechanic progression:
- 1Conclusion (Ketsu): A mastery challenge that consolidates what was learned before moving forward.
- 2Development (Shō): Reiterating the mechanic with a minor variation or additional requirement.
- 3Twist (Ten): Combining the mechanic with another familiar element to disrupt the rhythm.
- 4Introduction (Ki): Introducing the obstacle or mechanic in a safe, risk-free environment.
Exercise 2 · 1 point
Based on the physics metrics for the player object (`obj_player`), where total airborne jump time over level ground is 50 frames and horizontal speed (`move_speed`) is 4 pixels/frame, what is the maximum theoretical horizontal distance traveled in the air?
Exercise 3 · 1 point
Match each spatial role of the patrol enemy (`obj_patrol_enemy`) with its strategic level design function:
- Ledge Guardian
- Pacing Enforcer
- Coordinated Aerial Trap
Sign in to save your progress — Sign in