How to Build a Game Backend with HyperShip in 1 Hour

Introduction

Want to create a game with a robust backend but hate complex setups? HyperShip’s WordPress plugin turns your WordPress site into a Backend-as-a-Service (BaaS), letting you define custom API endpoints and data types with ease. In this tutorial, we’ll build a simple game backend for a Godot/Redot-based 2D RPG.

Prerequisites

  • WordPress site with HyperShip plugin installed
  • Godot/Redot Engine
  • Basic PHP and WordPress knowledge

Step 1: Install HyperShip

  1. Download the HyperShip plugin from GitHub.
  2. Upload and activate it in your WordPress admin panel.
  3. Navigate to the HyperShip dashboard to create your first app.

Step 2: Define Data Types with ACF

  1. Install the Advanced Custom Fields (ACF) plugin.
  2. Create a field group for your game (e.g., “Player Data” with fields like username, score, level).
  3. Enable “Show in REST API” in ACF settings.
  4. Add the types in the App Dashboart (TODO: make this better)

Step 3: Create a Custom API Endpoint

  1. In the HyperShip dashboard, select your app and add a new endpoint (e.g., /players).
  2. Write PHP code to fetch player data:

    $players = get_posts([
        'post_type' => 'hypership-app',
        'numberposts' => -1,
        'post_status' => 'publish'
    ]);
    $data = [];
    foreach ($players as $player) {
        $data[] = get_fields($player->ID);
    }
    return rest_ensure_response($data);
  1. Test the endpoint at yoursite.com/wp-json/hypership/v1/players.

Step 4: Connect to Godot/Redot

  1. In Godot, use the HTTPRequest node to fetch data from your endpoint.
  2. Parse the JSON response to display player scores.

Conclusion

With HyperShip, you’ve created a game backend in under an hour! Join our Discord community to share your project and get feedback.

Want to try it? Download HyperShip free on GitHub or get a managed server for $17/month.

Leave a Reply