Skip to content

Instantly share code, notes, and snippets.

@awinogrodzki
Last active June 25, 2025 05:13
Show Gist options
  • Save awinogrodzki/94ff06f4665ce3722783afe50a169517 to your computer and use it in GitHub Desktop.
Save awinogrodzki/94ff06f4665ce3722783afe50a169517 to your computer and use it in GitHub Desktop.
Game Generation API contract

Get game generation configurations

GET /api/rest/v1/configurations

Request: empty Example response:

{
  "target_groups": [
    {
      "id": "37aab470-e805-4be0-95a5-3c55a2121f05",
      "name": "Female, 35+, US/UK",
    }
  ],
  "products": [
    {
      "id": "f068d59a-422c-4c5f-90ca-74d111783f99",
      "name": "Visual Narrative"
    }
  ]
}

Create game bundle

POST /api/rest/v1/bundles/38a6270c-9493-491d-ada2-8a6e443bede4

Id is provided by the client

Example request:

{
  "target_groups": ["37aab470-e805-4be0-95a5-3c55a2121f05"],
  "products": ["f068d59a-422c-4c5f-90ca-74d111783f99"],
  "query": "vacation on island"
}

Example response: 201 No content

Realtime database stepper structure

Example realtime DB url: https://game-generator-bundles-rtdb.europe-west1.firebasedatabase.app/

Get bundle

https://game-generator-bundles-rtdb.europe-west1.firebasedatabase.app/38a6270c-9493-491d-ada2-8a6e443bede4

38a6270c-9493-491d-ada2-8a6e443bede4 is Game Bundle ID

Bundle structure:

{
  "steps": Step[]
}

Step is a union type of one of four types: PlotStep, CharacterStep, LocationStep, StoryStep. Each can have different payload.

GET https://game-generator-bundles-rtdb.europe-west1.firebasedatabase.app/38a6270c-9493-491d-ada2-8a6e443bede4

38a6270c-9493-491d-ada2-8a6e443bede4 is bundle ID

If any of the payload object property is null, it means data is loading

Example bundle data:

{
  "steps": [
     {
        "id": "fbdf5a24-cf51-4ce0-bd43-b61ecf9886fe",
        "type": "plot",
        "payload": {
          "dominant_theme": "WWII Romantic Drama",
          "main_plot": "In the shadows of occupied France..."
        }
     },
     {
       "id": "4e1a0dcb-fad2-4b93-9704-538415a16306",
       "type": "character",
       "payload": {
         "picture_url": "https://uc.uxpin.com/files/1296277/1245688/image_4_-176495bd736859f5cb82fcd23814171d-740d08.png", 
         "personal_data": {
           "name": "Emilie Dubois",
           "age": 26,
           "occupation": "Nurse",
           "traits": ["Compassionate", "Brave", "Resourceful", "Empathetic"]
         },
        "backstory": "Emilie, from a small French village..."
       }
     },
     {
       "id": "d602f9e9-fb5a-4649-9a38-b2fac4ceb991",
       "type": "location",
       "payload": {
         "backstory": "In a hidden, makeshift hospital in the French countryside",
         "scene": {
            "background_url": "https://uc.uxpin.com/files/1296277/1245688/image_11_-93c5195c5e37bc829df8a8a84d1f9601-3cc63e.png",
            "foreground_url": "https://uc.uxpin.com/files/1296277/1245688/image_11_-93c5195c5e37bc829df8a8a84d1f9601-3cc63e.png"
         },
         "gameplay_items": [
            {
               "id": "9b7442c3-cae4-485b-910c-11c8eb5218f3",
               "name": "Guitar",
               "picture_url": "https://uc.uxpin.com/files/1296277/1245688/bouzouki-9232686ad900af8b50ec0e39ae1d2065-c475c2.png"
            }
         ]
       }
     },
     {
       "id": "bea4e19d-c1cb-46a4-8c17-533d4c8f884a",
       "type": "story",
       "payload": {
         "text": "The sun set slowly over the French countryside,..."
         "bundle_file_url": "http://game-generation-bundle.com/bundle/12313/bundle.zip"
       }
     }
  ]
}

Request first OR confirm current and request next step

POST /api/rest/v1/steps/fbdf5a24-cf51-4ce0-bd43-b61ecf9886fe

Reject current and request new step (refresh step)

PUT /api/rest/v1/steps/fbdf5a24-cf51-4ce0-bd43-b61ecf9886fe

@bazz221
Copy link

bazz221 commented Jun 25, 2025

GitHub is a very powerful tool for collaborating on open source projects. I also read some articles about the game 1xbet e-sport https://az-esports.com/s1mplein-iem-dallas-2025-turnirinde-faze-clan-heyetindeki-debut-nece-kecdi/ recently, one of which was about FaZe Clan's debut at IEM Dallas 2025. It was very interesting to see how the team overcame challenges and adapted to new situations. If you are interested in team strategies and eSports, this article might be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment