🎮 Gaming Server

Real-time game server infrastructure. 100,000+ players per server at 10,000Hz tick rate.

API Endpoint

api.44s.io:8500

HTTP REST + WebSocket

Features

🎯 Lock-Free ECS

Entity Component System with zero lock contention for 100K+ entities

⚡ 10,000Hz Tick Rate

HFT-style event processing enables unprecedented tick rates

🗺️ Spatial Hashing

Lock-free spatial index for collision/visibility queries

🎲 Matchmaking

Built-in skill-based matchmaking with customizable rules

🏆 Leaderboards

Real-time leaderboards with instant updates

💬 Chat & Social

Channels, DMs, friends, parties, presence

Quick Start

Connect via WebSocket

// JavaScript client
const ws = new WebSocket('wss://api.44s.io:8500/ws?api_key=44s_your_api_key');

ws.onopen = () => {
  console.log('Connected to 44s Gaming');
  
  // Join a game world
  ws.send(JSON.stringify({
    type: 'join_world',
    world_id: 'battle-royale-1'
  }));
};

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  
  switch (msg.type) {
    case 'world_state':
      // Full state sync
      updateWorld(msg.entities);
      break;
    case 'state_delta':
      // Incremental update
      applyDelta(msg.changes);
      break;
    case 'player_joined':
      addPlayer(msg.player);
      break;
  }
};

// Send player input (high frequency)
function sendInput(moveX, moveY, action) {
  ws.send(JSON.stringify({
    type: 'input',
    move_x: moveX,
    move_y: moveY,
    action: action,
    timestamp: Date.now()
  }));
}

REST API for Game Setup

# Create a game world
curl -X POST https://api.44s.io:8500/worlds \
  -H "Content-Type: application/json" \
  -H "X-API-Key: 44s_your_api_key" \
  -d '{
    "name": "battle-royale-1",
    "max_players": 100,
    "world_size": 10000,
    "tick_rate": 60
  }'

# Get world status
curl https://api.44s.io:8500/worlds/battle-royale-1 \
  -H "X-API-Key: 44s_your_api_key"

# Response
{
  "name": "battle-royale-1",
  "players": 47,
  "max_players": 100,
  "tick": 152847,
  "entities": 1284,
  "avg_tick_us": 42
}

Backend-as-a-Service APIs

Player Storage

# Save player data
curl -X PUT https://api.44s.io:8500/players/player_123/data \
  -H "Content-Type: application/json" \
  -H "X-API-Key: 44s_your_api_key" \
  -d '{
    "inventory": ["sword", "shield", "potion"],
    "stats": {"level": 42, "xp": 15000},
    "settings": {"sensitivity": 0.8}
  }'

# Get player data
curl https://api.44s.io:8500/players/player_123/data \
  -H "X-API-Key: 44s_your_api_key"

Matchmaking

# Queue for matchmaking
curl -X POST https://api.44s.io:8500/matchmaking/queue \
  -H "Content-Type: application/json" \
  -H "X-API-Key: 44s_your_api_key" \
  -d '{
    "player_id": "player_123",
    "skill_rating": 1850,
    "game_mode": "ranked",
    "region": "us-east"
  }'

# Response (when match found)
{
  "match_id": "match_abc123",
  "world_id": "ranked-game-5847",
  "players": ["player_123", "player_456", ...],
  "server": "api.44s.io:8500"
}

Leaderboards

# Update score
curl -X POST https://api.44s.io:8500/leaderboards/global/scores \
  -H "Content-Type: application/json" \
  -H "X-API-Key: 44s_your_api_key" \
  -d '{
    "player_id": "player_123",
    "score": 15847
  }'

# Get top 100
curl "https://api.44s.io:8500/leaderboards/global?limit=100" \
  -H "X-API-Key: 44s_your_api_key"

# Get player rank
curl "https://api.44s.io:8500/leaderboards/global/rank/player_123" \
  -H "X-API-Key: 44s_your_api_key"

# Response
{"player_id": "player_123", "score": 15847, "rank": 42}

Lobbies & Rooms

# Create a lobby
curl -X POST https://api.44s.io:8500/lobbies \
  -H "Content-Type: application/json" \
  -H "X-API-Key: 44s_your_api_key" \
  -d '{
    "name": "Alice'\''s Party",
    "max_players": 4,
    "game_mode": "co-op",
    "private": true
  }'

# Response
{
  "lobby_id": "lobby_xyz789",
  "code": "ABC123",
  "players": [{"id": "player_123", "name": "Alice", "ready": false}]
}

# Join by code
curl -X POST https://api.44s.io:8500/lobbies/join/ABC123 \
  -H "X-API-Key: 44s_your_api_key" \
  -d '{"player_id": "player_456"}'

Unity Integration

using UnityEngine;
using WebSocketSharp;
using System;

public class GameClient : MonoBehaviour {
    private WebSocket ws;
    private string apiKey = "44s_your_api_key";
    
    void Start() {
        ws = new WebSocket($"wss://api.44s.io:8500/ws?api_key={apiKey}");
        
        ws.OnMessage += (sender, e) => {
            var msg = JsonUtility.FromJson<ServerMessage>(e.Data);
            HandleMessage(msg);
        };
        
        ws.Connect();
    }
    
    void Update() {
        // Send input every frame
        if (ws.ReadyState == WebSocketState.Open) {
            var input = new InputMessage {
                type = "input",
                move_x = Input.GetAxis("Horizontal"),
                move_y = Input.GetAxis("Vertical"),
                action = Input.GetButtonDown("Fire1") ? 1 : 0
            };
            ws.Send(JsonUtility.ToJson(input));
        }
    }
    
    void HandleMessage(ServerMessage msg) {
        // Apply state updates to game objects
        foreach (var entity in msg.entities) {
            UpdateEntity(entity.id, entity.x, entity.y, entity.z);
        }
    }
}

Performance

Metric44s GamingTraditional
Players per server100,000+~64-100
Tick rate10,000Hz possible20-128Hz
Tick latency<100μs~1-10ms
Entity updates/sec100M+~100K

Architecture

44s Gaming uses HFT-style event-driven architecture:

// Traditional: Per-player sequential processing
for player in players:
    process_input(player)      // Lock contention!
    update_position(player)    // Lock contention!
    check_collisions(player)   // Lock contention!

// 44s: Parallel phase-based processing
Phase 1: Collect all inputs (lock-free queue)
Phase 2: Process inputs in parallel (no locks)
Phase 3: Apply physics in parallel (lock-free ECS)
Phase 4: Detect collisions in parallel (lock-free spatial hash)
Phase 5: Broadcast deltas (lock-free)