LogoLogo
  • Get Started
  • Getting Started
    • Initial Setup
    • Create Your First Game
    • API Reference
    • Build Your First World Map
    • Multiplayer Testing
    • Use Templates & Examples
    • Styling & Assets
      • Modeling Guidelines
      • Texturing Guidelines
      • Default Assets
  • Build Faster With AI Tools
  • SDK Guides
    • Assets
    • Audio & SFX
      • Audio Manager
    • Blocks & Chunks
      • Block Types
      • Block Type Registry
      • Chunks
      • Chunk Lattice
    • Camera
    • Chat & Commands
    • Debugging
    • Entities
      • Animations
      • Block Entities
      • Colliders & Hitbox
      • Child Entities
      • Entity Controllers
        • Base Entity Controller
        • Pathfinding Entity Controller
        • DefaultPlayer Entity Controller
        • Simple Entity Controller
      • Entity Manager
      • Model Entities
      • Movement & Pathfinding
      • Player Controlled Entities
    • Events
    • Input & Controls
    • Lighting
      • Ambient Light
      • Light Manager
      • Point Lights
      • Spot Lights
      • Sun Light (Directional)
    • Mobile
    • Persisted Data
    • Players
      • Player Manager
      • Persisted Player Data
    • Plugins
    • Physics
      • Colliders
      • Collision Groups
      • Debugging
      • Gravity
      • Raycasts
      • Rigid Bodies
    • User Interface
      • Overlay UI
      • Scene UIs
      • Scene UI Manager
    • Worlds
      • Map Data Format
  • Helpful Resources
    • HYTOPIA Architecture & Platform Overview
    • Useful Third-Party Tools
Powered by GitBook
On this page
  • Multiple World Instances
  • World Management
  • World Skybox
  • Diving Deeper
Export as PDF
  1. SDK Guides

Worlds

PreviousScene UI ManagerNextMap Data Format

Last updated 4 months ago

A World is a core part of a HYTOPIA game's lifecycle. You can think of a world as a container for all controls related to gameplay - audio, entities, lighting, physics, chunk terrain, tick loop, and more.

When you start your server, a default world is automatically created and provided for you to use. This world houses everything related to its own gameplay.

Multiple World Instances

Creating additional world instances allows you to create completely isolated game world instances within your server. These instances exist in the same physical server instance. If you've played games like Minecraft, you can think of multiple world instances in a similar way to how Minecraft seperates The Overworld, The Nether, and The End worlds.

By default, players will automatically join into the default world when they join your game, but you can at any point in time join them to another World instance within your server through the player.joinWorld()method, documented in .

In nearly all cases, you won't need to use any other world instances besides the default one returned in the callback of startServer(world => {}) .

Using additional world instances beyond the default world may only make sense in the following situations.

  • Your game needs to explicitly isolate its physics simulations where isolated world instances could achieve this, since each world runs its own physics simulation.

  • Your game needs control of environment lighting and visuals in a way that can't be done with a single world. Such as if your game has an overworld with sunny lighting, but also requires another world in "outer space" setting where no lighting, or completely different environmental lighting is required.

For now, we strongly recommend you isolate gameplay to a single world in most cases unless you know what you're doing.

World Management

A World instance exposes all of the managers and various functionality required to control game behavior.

You can find the most up to date list of available managers as properties of a World instance in the .

World Skybox

You can change the skybox of your world by adding cubemap images to an assets/cubemaps/skyboxfolder in your project.

This assets/cubemaps/skyboxfolder should include the following 6 images to use for the skybox.

  • +x.png

  • +y.png

  • +z.png

  • -x.png

  • -y.png

  • -z.png

These 6 images will be used for the 6 faces of the skybox on their appropriately named axes.

If no cubemap is provided by you in a assets/cubemaps/skyboxfolder that you create, then the default skybox will be used.

Diving Deeper

The World class is constantly evolving. You Can find the latest .

If there are features that we don't currently support for Worlds that you'd like to see added to the HYTOPIA SDK, you can .

World API Reference here
submit a feature request here
World API Reference here
Player Methods
The default skybox with a light blue color and clouds.