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
  • 1. Install cloudflared
  • 2. Start your server without SSL
  • 3. Start a tunnel
  • 4. Share your tunnel link & play
  • Next Steps
Export as PDF
  1. Getting Started

Multiplayer Testing

PreviousBuild Your First World MapNextUse Templates & Examples

Last updated 1 month ago

Running your server locally and allowing friends or testers to connect to it is a great way to get feedback on your game or debug it with multiple players. You can quickly allow players to connect by using cloudflare's free tunneling service, cloudflared.

1. Install cloudflared

First, install cloudflared on your the computer or server that will run your game server.

.

2. Start your server without SSL

Local development by default uses SSL with a self-signed certificate, but a cloudflare tunnel will provision it's own SSL certificate. We need to disable the one our server uses to prevent conflicts.

We can do this and run our game at the same time by running the following command in our terminal. Setting NODE_ENV=productionwill signal the server to not use it's own SSL certificate.

If you're using a Mac or Linux terminal, run the following command.

# Start our game server without SSL
NODE_ENV=production bun --watch index.ts

If you are using Windows Powershell, use the following command:

# Start our game server without SSL using Windows Powershell
$env:NODE_ENV="production"; bun --watch index.ts

3. Start a tunnel

Next, open another terminal window and run the following command to start your cloudflared tunnel. This assumes your game is running on the default port, which is 8080.

# Start our tunnel!
cloudflared tunnel --url http://localhost:8080

Once started, you should see something like this:

4. Share your tunnel link & play

Copy your tunnel link from your terminal. Your tunnel link will be different, but for context, in our previous example our example link was:

https://sie-perception-directories-currency.trycloudflare.com

Your tunnel link will be different each time you start your tunnel!

You can alternatively make players auto-join your server with a link by using the ?join=query parameter like this:

https://hytopia.com/play?join=sie-perception-directories-currency.trycloudflare.com

Just make sure you replace the value of join with your own tunnel url!

Next Steps

You and others can now connect to your server by going to and entering your tunnel link when prompted to enter a server to connect to.

Follow this guide to install cloudflared
https://hytopia.com/play

Use Templates & Examples

Start creating games from one of the many available examples and templates.