Skip to content

dweam-team/world-arcade

Repository files navigation

☁️ World Arcade

Discord Windows Application

Run generative games on your own GPU.

Unlike traditional games, that run on a deterministic game engine, generative games use an interactive video model to generate every frame of the game in real-time, reacting to your button presses.

Currently, the models are dispersed across Github and hard to find. Even when you find one, it takes technical knowledge and time to run them yourself. So we're bringing them together for you to play.

World Arcade is an open-source platform that makes it easy to play them locally, or stream from a server.

Features

  • Browse open-source game models

    Collecting together all the available games made open-source by Diamond and other world creators!



  • Play Games

    Jump into Yume Nikki, CS:GO, Minecraft, Atari Arcade Games or Mario Kart 64.



  • Change Parameters

    Adjust settings to allow higher FPS on lower-end GPUs (at the expense of game stability/quality).



Requirements

The Minecraft games are only supported on Linux; you can use WSL on Windows to play them.

Let's Play!

Windows

  1. Download dweam-windows.zip from the latest release.
  2. Unzip the file using 7Zip.
  3. Double-click dweam.exe, wait for the games to install, and start playing!

Linux

Installing

Install and run Docker,

Install Docker compose.

Install NVIDIA Container Toolkit.

Running

git clone ssh://[email protected]/dweam-team/world-arcade
cd world-arcade
docker compose up --build

Once it's running, visit localhost:4321.

Exposing to the internet/local network

By default, the backend and frontend will only bind to localhost. Use a reverse proxy (like caddy or nginx) to forward the following ports:

  • 8080 TCP
  • 4321 TCP

Expose the following ports for WebRTC:

  • 3478 TCP/UDP
  • 5349 TCP/UDP
  • 50000-50010 UDP

Adding a game

Each set of games is implemented as a standalone python package that:

  1. Implements a Game class that subclasses dweam.Game.
  2. Provides a dweam.toml file with the game's metadata.

See diamond-yumenikki or diamond-csgo for an example.

Implement it

Subclass dweam.Game, and implement the step method.

# my_game/dweam_game.py

from dweam import Game
import pygame


class MyGame(Game):
    def step(self) -> pygame.Surface:
        """
        A step of your game loop, that runs in its own thread.
        Use `self.keys_pressed`, `self.mouse_pressed` and `self.mouse_motion` to generate the next frame,
        and return it as a pygame surface.
        """
        ...

    def on_key_down(self, key: int) -> None:
        """
        Optionally, implement logic via key presses directly
        Other methods like `on_key_up`, `on_mouse_down`, `on_mouse_up` and `on_mouse_motion` are also available.
        """
        ...

Add Metadata

Add a dweam.toml file with the game's metadata.

# my_game/dweam.toml

type = "Awesome Games"
entrypoint = "my_game.dweam_game:MyGame"
repo_link = "https://github.com/awesome-games/my-game"

[games.my_game]
title = "My Game"
tags = ["First Person"]
description = "A game made by me"

[games.my_game.buttons]
"⬆️ Forward" = "W"
"⬇️ Back" = "S"
"⬅️ Left" = "A"
"➡️ Right" = "D"
"🆙 Jump" = "Space"

Share it

For now we're hardcoding the game packages in the entrypoint.py file – please submit a pull request to add your game, in the form of a GitHub repo URL or python package.

Soon we'll make this a local configuration file ^w^"

Get Involved

Love any contributions from the community!

Open a GitHub issue or join our Discord server to chat.

Leave a star if you'd like to see this project grow! ❤️ ⭐️