Skip to content
  • Our Product
    • Namazu Elements
      • What is Elements?
      • Why open source?
      • Docs
        • Namazu Elements in Five Minutes or Less
        • RESTful APIs Library
        • Security Model
        • Accessing the Web UI (CMS)

    Our Product

    A logomark with three layered rhombuses adorning the lettermark that says Elements in bold all-caps sans-serif letters.
    • What is Namazu Elements? Discover our easy-to-use backend network solution built for online games. Rapidly enables full-scale multiplayer games or online solo adventures.
    • Why open source? Is there a truly open source server backend for connected games? There is now. Download and run a local copy of Namazu Elements and try it for yourself.
    Download Namazu Elements

    Get started

    • Quick start Read our Elements 5-minute quick start guide
    • Documentation Read our developer docs for learning more about Elements
    • RESTful APIs A full list of core API specs for working with the Elements framework
    • Security An overview of the server-authoritative security model of Elements
    • Accessing the CMS Manage your game with ease via the Namazu Elements CMS.

    Co-development Reimagined

    • Reduce your costs Would you rather outsource your backend development? Hire Namazu Studios to build your server backend with the power of Namazu Elements.
      Co-dev

    Recent Posts

    • The watercolor-styled Namazu Studios logo over a giant namazu lurking in the depth
      Namazu Studios Featured in San Diego Business Journal
      22 Sep 2025 Press
    • Namazu Elements 3.1 Released – Service Layer Fixes, Secure APIs, and Steam Bug Fix
      22 Apr 2025 Release Notes
  • Case Studies
  • About Us
  • News
  • Services
  • Book a call
namazu-studios-logo
Book a call

Getting Started

  • Namazu Elements in Five Minutes or Less
  • Accessing the Web UI (CMS)
  • CMS Feature Overview

Fundamentals

  • Why You Need a Server (and What “Authoritative” Means)
  • Elements as a Game Runtime
  • Where Your Authoritative Code Runs
  • Lifecycles and Flows

General Concepts

  • Overview
  • Custom Elements
  • Data Models
  • Security Model
  • N-Tier Architecture

Namazu Elements Core Features

  • User Authentication / Sign In
    • What is a User?
    • User Authentication in Elements
    • Auth Schemes
      • Auth Schemes
      • OAuth2
      • OIDC
  • Features
    • Applications
    • Sessions
    • Users and Profiles
    • Digital Goods
    • Progress and Missions
    • Progress and Missions (3.4+)
    • Leaderboards
    • Matchmaking – Comprehensive Guide
    • Followers
    • Friends
    • Receipts
    • Reward Issuances
    • Save Data
    • Metadata
    • Metadata (3.4+)
    • Queries
    • Web3
      • Wallets
      • Vaults
      • Omni Chain Support
      • Smart Contracts
        • Smart Contracts
  • Queries
    • Advanced Operators
    • Object Graph Navigation
    • Boolean Queries
    • Base Query Syntax
  • Advanced Operators
    • .name
    • .ref

Your Game Code - Adding Custom Elements

  • Custom Code Overview
  • Windows Setup
  • Mac OS Setup
  • Ubuntu Linux Setup
  • Element Anatomy: A Technical Deep Dive
  • Introduction to Guice and Jakarta in Elements
  • Structuring your Element
  • Events
  • Packaging an Element with Maven
  • Deploying an Element
  • Preparing for code generation
  • Properties
  • Websockets
  • RESTful APIs
  • Direct MongoDB Access (3.5+)

Configuration

  • Matchmaking – Comprehensive Guide
  • Direct Database Access and Batch Configuration
  • Batch Samples
    • Mission Upload Bash Script Sample
    • Item Upload Bash Script Sample

RESTful APIs

  • Importing into Postman
  • RESTful APIs Library
  • Swagger and Swagger UI

Add-Ons

  • Custom Elements
    • Crossplay
      • Namazu Crossfire (Multiplayer)
      • Deploying Namazu Crossfire in your game
  • Game Engines
    • Unity
      • Elements Codegen
      • Crossfire
    • Roblox
      • Roblox Overview
      • Secure Player Authentication & Registration
      • Global Matchmaking
      • Roblox Security Best Practices

Troubleshooting

  • Common Issues with Docker
  • Local SDK
    • Unable to deploy application : dev.getelements.elements.sdk.exception.SdkElementNotFoundException
    • Could not load class : java.lang.NoClassDefFoundError
  • Namazu Elements Community Edition
    • Common Issues with Docker
    • Unable to deploy application : dev.getelements.elements.sdk.exception.SdkElementNotFoundException
    • Running in the IDE
      • Exception in monitor thread while connecting to server localhost:27017
      • Could not deployAvailableApplications Jetty server Failed to bind to /0.0.0.0:8080 Address already in use

Releases

  • 3.6 Release Notes
  • 3.5 Release Notes
  • 3.4 Release Notes
  • 3.3 Release Notes
  • 3.2 Release Notes
  • 3.1 Release Notes
View Categories
  • Home
  • Docs
  • Fundamentals
  • Elements as a Game Runtime

Elements as a Game Runtime

Est. read time: 4 min read

Elements is not just a backend service that you call from your game – it is a server-side runtime capable of hosting your game’s authoritative logic.

This page explains what that means, how it differs from traditional architectures, and when you might choose to run your game logic directly inside Elements.


The Big Idea #

In most game architectures, you write game logic in one place and run it somewhere else:

  • a custom backend service
  • a cloud function platform
  • a managed game server

With Elements, you have another option – your game’s authoritative logic can run inside Elements itself.

This is done by writing Custom Elements, which are full server-side applications hosted and executed by the Elements platform.


What a Custom Element Is #

A Custom Element is:

  • a server-side Java application
  • loaded and executed by Elements
  • running in a trusted, non-player-controlled environment
  • isolated from other Elements at the classpath level

A Custom Element is not:

  • client code
  • a scripting sandbox
  • a restricted rules engine

You write real Java, with full control over logic and data access.


Acting as the Game Server #

A Custom Element can act as the core game server.

Depending on your game, this may include:

  • handling REST requests for turn-based gameplay
  • managing real-time sessions via WebSockets or WebRTC
  • validating player actions
  • enforcing game rules
  • mutating authoritative game state

From the player’s perspective, the client still communicates with “the server” – the difference is that the server logic lives inside Elements.


Direct Access to Game State #

Custom Elements have unrestricted access to the Elements data model.

This allows you to:

  • read and write directly to the database
  • manage custom tables and relationships
  • integrate tightly with (and even expand upon) Elements systems, such as inventory, rewards, missions, and leaderboards

Because this code runs authoritatively, there is no need to proxy through an external backend just to apply state changes.


Real-Time and Turn-Based Games #

Elements supports both interaction models:

Turn-Based Games #

  • Clients make REST calls
  • Custom Elements validate and apply moves
  • Game state is stored and enforced by Elements

This model is well-suited for:

  • async games
  • strategy games
  • games with simple state transitions

Real-Time Games #

  • Clients establish persistent connections (WebSockets / WebRTC)
  • Custom Elements manage sessions and events
  • Elements acts as the authoritative host

This model is well-suited for:

  • real-time multiplayer
  • synchronous co-op or PvP
  • fast-paced interactions requiring low latency

Composability and Multiple Elements #

Multiple Custom Elements can be loaded at the same time.

This enables a composable architecture, where:

  • one Element handles core gameplay
  • another handles purchases or receipt validation
  • another manages promotions or live events

Each Element:

  • runs independently
  • is classpath-isolated
  • can be developed, tested, and deployed separately

Example: Payment Processing as a Custom Element #

A payment provider can ship a Custom Element that:

  • validates receipts against external app stores
  • verifies transactions
  • issues digital goods using Elements inventory APIs

For game developers, this means:

  • no custom purchase-validation backend
  • no duplicated logic across games
  • a trusted, reusable integration

Using Elements Alongside External Services #

Running your game inside Elements does not prevent you from using other services.

Common hybrid setups include:

  • Custom Elements for authoritative gameplay logic
  • external services for analytics, matchmaking, or social features

Elements does not force a single architecture – it provides a runtime where authority can safely live.


Choosing the Right Model #

You might choose to run your game logic inside Elements if:

  • you want to minimize backend infrastructure
  • you want authoritative access to game state
  • your logic is tightly coupled to Elements features
  • you want composable, reusable server-side modules

You might choose an external server if:

  • you already have significant backend investment
  • your architecture depends on specialized infrastructure
  • you want to keep Elements focused on state and services

Many teams generally prefer to keep everything within Elements, but sometimes it makes sense to use both.


How This Fits Into the Rest of the Docs #

When other documentation refers to:

  • “server-side code”
  • “authoritative logic”
  • “Custom Elements”

It may be referring to logic that runs inside Elements itself.

Understanding Elements as a game runtime will make feature-level documentation clearer and more flexible.


What to Read Next #

  • Why You Need Authority – understanding trust and permanence
  • Where Your Authoritative Code Runs – choosing between deployment models
  • Lifecycles and Flows – seeing how systems work end-to-end

What are your Feelings
Still stuck? How can we help?

How can we help?

Updated on February 5, 2026
Lifecycles and Flows
Table of Contents
  • The Big Idea
  • What a Custom Element Is
  • Acting as the Game Server
  • Direct Access to Game State
  • Real-Time and Turn-Based Games
    • Turn-Based Games
    • Real-Time Games
  • Composability and Multiple Elements
  • Example: Payment Processing as a Custom Element
  • Using Elements Alongside External Services
  • Choosing the Right Model
  • How This Fits Into the Rest of the Docs
  • What to Read Next
  • Documentation
  • Terms of Service
  • Privacy Policy
  • Contact us
  • Linkedin
  • Join our Discord

Namazu Studios LLC is powered by Namazu Elements, an Elemental Computing Inc. product.

Elements
  • Download
  • About Elements
  • Open source
  • Documentation
  • Support
About Namazu
  • Case Studies
  • About Us
  • News
Get in Touch
  • info@namazustudios.com
  • Book a call
  • (619) 862-2890
  • Linkedin
  • Discord

©2008-2025 Namazu Studios. All Rights Reserved.