Skip to main content

Overview

Regions organize servers and Game Server Nodes by geographic location. Proper region configuration ensures:
  • Optimal player latency
  • Efficient server selection for matches
  • Accurate location-based filtering
  • Improved matchmaking quality

Creating a Region

Click Create on the Regions page to add a new region.

Region Configuration

interface Region {
  value: string;              // Region identifier (e.g., "us-east")
  description: string;        // Human-readable name (e.g., "US East")
  is_lan: boolean;           // LAN/local network region flag
  steam_relay: boolean;      // Use Steam Datagram Relay
  status: string;            // Region status
}
Required Fields:
value
string
required
Unique region identifier. Use lowercase with hyphens (e.g., us-east, eu-west, asia-pacific).
description
string
Display name for the region. This appears in server selection dropdowns and match scheduling interfaces.

Example Region Configuration

mutation CreateRegion {
  insert_server_regions_one(
    object: {
      value: "us-east"
      description: "US East (Virginia)"
      is_lan: false
      steam_relay: false
    }
  ) {
    value
  }
}

Region Properties

LAN Configuration

LAN Regions

Mark regions as LAN/local network to:
  • Separate LAN servers from public listings
  • Use private IP addresses for connections
  • Optimize for local network tournaments
  • Bypass internet routing for minimal latency
Enable LAN mode with the Use LAN IP toggle:
// Update region LAN status
mutation UpdateRegionLAN($value: String!, $isLan: Boolean!) {
  update_server_regions_by_pk(
    pk_columns: { value: $value }
    _set: { is_lan: $isLan }
  ) {
    value
    is_lan
  }
}
When enabled, servers in this region will use their lan_ip for connections instead of public_ip.

Steam Datagram Relay (SDR)

Steam Datagram Relay

Valve’s SDR network provides:
  • Optimized routing through Steam infrastructure
  • Protection against DDoS attacks
  • Improved connection quality
  • Reduced packet loss and jitter
Enable Steam Relay with the Use Steam Relay toggle:
// Update Steam relay configuration
mutation UpdateSteamRelay($value: String!, $useRelay: Boolean!) {
  update_server_regions_by_pk(
    pk_columns: { value: $value }
    _set: { steam_relay: $useRelay }
  ) {
    value
    steam_relay
  }
}
Steam Relay is recommended for public servers exposed to the internet. It provides better DDoS protection and routing optimization at no additional cost.

Server Capacity

The regions page displays real-time server availability:
interface RegionCapacity {
  total_server_count: number;        // Total servers in region
  available_server_count: number;    // Idle servers ready for matches
}
Capacity Indicators:
  • 10 / 20 - 10 available servers out of 20 total
  • Low availability may cause match scheduling delays
  • Monitor capacity during peak hours

Region Status

Regions can have different operational states:
  • Active: Region operational and accepting matches
  • Maintenance: Region temporarily unavailable
  • Deprecated: Region being phased out
Servers in maintenance or deprecated regions will not be selected for new matches.

Editing Regions

Update existing region configuration:
1

Access Edit Dialog

Click the edit icon (✏️) next to the region you want to modify.
2

Update Fields

Change the description or other properties. The region identifier (value) cannot be changed after creation.
3

Save Changes

Click Update to save your changes.

Deleting Regions

Deleting a region requires:
  • No active servers assigned to the region
  • No pending matches in the region
  • No Game Server Nodes configured for the region
Deletion is permanent and cannot be undone.
To delete a region:
  1. Click the delete icon (🗑️) next to the region
  2. Confirm the deletion in the dialog
  3. Region is removed from the system

Best Practices

Use consistent naming patterns:Identifier (value):
  • Lowercase with hyphens
  • Geographic reference + location
  • Examples: us-east, eu-west, asia-pacific, au-sydney
Description:
  • Human-readable format
  • Include city/state for precision
  • Examples: “US East (Virginia)”, “Europe West (Frankfurt)”, “Australia (Sydney)”
Balance between specificity and simplicity:Recommended:
  • Major geographic areas (continents/sub-continents)
  • Important population centers
  • Strategic data center locations
Avoid:
  • Too many small regions (management overhead)
  • Overlapping geographic coverage
  • Regions with insufficient server capacity
Separate LAN and internet regions:
  • Create distinct regions for LAN tournaments
  • Use descriptive names (e.g., lan-venue-1, lan-event-hall)
  • Keep LAN regions disabled when not in use
  • Document LAN region IP ranges and network configuration
Monitor server availability:
  • Maintain 20-30% overhead capacity
  • Scale up before peak hours
  • Set up alerts for low availability
  • Balance servers across regions based on demand

Match Server Selection

When scheduling matches, 5Stack selects servers based on:
  1. Player Locations: Analyze player IP addresses
  2. Region Proximity: Calculate distance to each region
  3. Server Availability: Check available servers in optimal regions
  4. Load Balancing: Distribute matches evenly
// Simplified server selection algorithm
function selectMatchServer(players: Player[]): Server {
  // Calculate optimal region based on player locations
  const optimalRegion = calculateOptimalRegion(players);
  
  // Find available servers in that region
  const availableServers = getAvailableServers(optimalRegion);
  
  if (availableServers.length === 0) {
    // Fallback to nearby regions
    const fallbackRegions = getNearbyRegions(optimalRegion);
    return selectFromRegions(fallbackRegions);
  }
  
  // Load balance across available servers
  return loadBalanceSelect(availableServers);
}

GraphQL API

Query Regions

subscription GetRegions {
  server_regions(
    order_by: { value: asc }
  ) {
    value
    description
    is_lan
    status
    steam_relay
    total_server_count
    available_server_count
  }
}

Create Region

mutation CreateRegion(
  $value: String!
  $description: String
  $is_lan: Boolean
) {
  insert_server_regions_one(
    object: {
      value: $value
      description: $description
      is_lan: $is_lan
    }
  ) {
    value
  }
}

Update Region

mutation UpdateRegion(
  $value: String!
  $description: String
  $steam_relay: Boolean
  $is_lan: Boolean
) {
  update_server_regions_by_pk(
    pk_columns: { value: $value }
    _set: {
      description: $description
      steam_relay: $steam_relay
      is_lan: $is_lan
    }
  ) {
    value
  }
}

Delete Region

mutation DeleteRegion($value: String!) {
  delete_server_regions_by_pk(
    value: $value
  ) {
    value
  }
}

Integration Examples

Server Assignment

When creating servers, assign them to regions:
// Create server with region assignment
const createServer = async (config: ServerConfig) => {
  await apolloClient.mutate({
    mutation: gql`
      mutation CreateServer {
        insert_servers_one(
          object: {
            label: "${config.label}"
            region: "${config.region}"  // Region value
            host: "${config.host}"
            port: ${config.port}
            enabled: true
          }
        ) {
          id
        }
      }
    `
  });
};

Game Server Node Configuration

// Assign node to region
const assignNodeRegion = async (nodeId: string, region: string) => {
  await apolloClient.mutate({
    mutation: gql`
      mutation UpdateNodeRegion {
        update_game_server_nodes_by_pk(
          pk_columns: { id: "${nodeId}" }
          _set: { region: "${region}" }
        ) {
          id
          region
        }
      }
    `
  });
};

Common Region Configurations

North America

const northAmericaRegions = [
  { value: 'us-east', description: 'US East (Virginia)' },
  { value: 'us-west', description: 'US West (California)' },
  { value: 'us-central', description: 'US Central (Texas)' },
  { value: 'ca-central', description: 'Canada Central (Toronto)' },
];

Europe

const europeRegions = [
  { value: 'eu-west', description: 'Europe West (Frankfurt)' },
  { value: 'eu-north', description: 'Europe North (Stockholm)' },
  { value: 'eu-south', description: 'Europe South (Milan)' },
  { value: 'uk', description: 'United Kingdom (London)' },
];

Asia Pacific

const asiaPacificRegions = [
  { value: 'asia-east', description: 'Asia East (Tokyo)' },
  { value: 'asia-southeast', description: 'Asia Southeast (Singapore)' },
  { value: 'au-southeast', description: 'Australia (Sydney)' },
  { value: 'india', description: 'India (Mumbai)' },
];

South America

const southAmericaRegions = [
  { value: 'sa-east', description: 'South America East (São Paulo)' },
  { value: 'sa-west', description: 'South America West (Santiago)' },
];

Troubleshooting

Symptoms: Servers exist but don’t show in region listSolutions:
  1. Verify server region field matches region value
  2. Check server is enabled
  3. Confirm region query filters
  4. Refresh region capacity aggregations
Symptoms: High latency, players routed to distant regionsSolutions:
  1. Verify region Steam relay configuration
  2. Check player IP geolocation accuracy
  3. Review server availability in optimal regions
  4. Ensure region descriptions match actual locations
  5. Test server selection algorithm with player locations
Symptoms: LAN region servers fail to connectSolutions:
  1. Confirm is_lan flag is set correctly
  2. Verify servers have lan_ip configured
  3. Check network connectivity on LAN
  4. Ensure firewall allows LAN IP range
  5. Test direct connection to lan_ip:port

Dedicated Servers

Assign servers to regions for match hosting

Game Server Nodes

Configure node regions for automated deployment

Public Servers

View public servers organized by region

Build docs developers (and LLMs) love