Documentation Index
Fetch the complete documentation index at: https://v5.rpgjs.dev/llms.txt
Use this file to discover all available pages before exploring further.
Use a game with Studio
UseprovideStudioGame when the current RPGJS game should load its maps, database, media references, and player start configuration from RPGJS Studio data.
Install the package
Studio mode
In Studio mode, the game reads data from RPGJS Studio. AddprovideStudioGame to both the client and server configurations and pass the Studio project identifier.
Client configuration:
projectId is set, the runtime uses online Studio data by default.
MMORPG mode
In MMORPG mode, Studio data is loaded on both sides with different responsibilities:- the server loads the Studio project, map, database, hitboxes, and events, then synchronizes players and events to clients;
- the client loads Studio map data only to render the CanvasEngine map component.
/map/update flow.
Live map updates from Studio
When Studio pushes a live update to a running MMORPG server, it should call the map room update endpoint:RPGJS_MAP_UPDATE_TOKEN, Studio must also send one of these credentials:
id: Studio map id without themap-room prefix.widthandheight: map dimensions in pixels, used by server movement and viewport logic.config: project-level configuration used by server hooks, includingstartMapId,hero, andworldMaps.data: Studio map document used by Studio server hooks. It should includeparams,start,weather,lighting, and map-specific metadata.events: placed Studio events. These become authoritative RPGJS dynamic events and are synchronized to clients.hitboxes: collision data used by server physics.positions: named positions used byplayer.changeMap("map-id", "position-name").damageFormulas: optional formula overrides merged with RPGJS defaults.
Offline mode
Offline mode lets the game run from exported Studio data without calling the Studio API. Export the project data from Studio into the game public directory, using the default bundle path:provideStudioGame without projectId, or force runtimeMode to "offline":
/game-data. Use bundleBasePath only if the exported folder is served from another path:
spCost, hitRate, power, and coefficient fields, and enemies can learn skills referenced by their skills array.
The project can define hero skill progression with skills or skillsToLearn. At runtime, provideStudioGame() creates a default RPGJS class containing those entries, then RPGJS learns each skill when the configured level is reached:
player.onSkillChange hook and displays a notification when the hero learns or forgets a skill.
Enemy records can also drive action-battle AI. Use behavior on the enemy to set fields such as enemyType, behaviorKey, visionRange, attackRange, attackCooldown, dodgeChance, dodgeCooldown, fleeThreshold, attackPatterns, patrolWaypoints, groupBehavior, or the nested behavior gauge options. The older aiBehavior field is still accepted as a compatibility alias. If the enemy has attackSkillId, that skill is used for attacks; otherwise the first learned enemy skill is used.
Auto mode
Use"auto" when the game should try the exported bundle first, then fall back to Studio if local data is missing:
Options
projectId: Studio project identifier. When provided, the default runtime mode is"online".runtimeMode: data loading strategy. Use"online","offline", or"auto".bundleBasePath: public path for exported Studio data. Defaults to/game-data.displayTitleScreen: display the Studio title screen when supported by the project.startMapId: force the map used to start the player.