Problem
RPGJS Studio is preparing a direct map-generation flow with an “Explore the map” action. Generated maps currently store a start point at the center. A generated element hitbox can cover that point. The runtime honors the start point / explicit coordinates through player.changeMap(...), but inspection of the current server/physics APIs did not find a public helper that resolves a nearby collision-free spawn for the actual player hitbox.
Proposed API
Add an opt-in server map API such as map.findSpawnPosition({ preferred: { x, y }, hitbox, maxDistance }), returning coordinates or null, and document its integration with player.changeMap. The exact public naming is open to framework maintainers.
Expected behavior
- Evaluate the real map collider data and player hitbox, including Studio element hitboxes and map bounds.
- Return a deterministic nearby traversable position, with clearance for the player to move.
- Return
null when no suitable location exists; never silently place the player in a collider or disable collisions.
- Preserve existing explicit-position behavior unless the option/helper is used.
- Test an occupied center, edge positions, narrow passages, and a fully blocked map.
Studio integration
The direct generation release will continue to use the existing exploration launcher. Automatic safe-spawn guarantees remain pending this API; no custom collision workaround is being added in the local game project.
Problem
RPGJS Studio is preparing a direct map-generation flow with an “Explore the map” action. Generated maps currently store a
startpoint at the center. A generated element hitbox can cover that point. The runtime honors the start point / explicit coordinates throughplayer.changeMap(...), but inspection of the current server/physics APIs did not find a public helper that resolves a nearby collision-free spawn for the actual player hitbox.Proposed API
Add an opt-in server map API such as
map.findSpawnPosition({ preferred: { x, y }, hitbox, maxDistance }), returning coordinates ornull, and document its integration withplayer.changeMap. The exact public naming is open to framework maintainers.Expected behavior
nullwhen no suitable location exists; never silently place the player in a collider or disable collisions.Studio integration
The direct generation release will continue to use the existing exploration launcher. Automatic safe-spawn guarantees remain pending this API; no custom collision workaround is being added in the local game project.