flame-engine / flame-engine/flame

[proposal] Flame Studio

Open
#2,319 8 comments 19 reactions 0 assignees View on GitHub
enhancement
Dominant language
Dart
Stars
10.8k
Forks
1k
Avg merge
1d 20h
Merged PRs (30d)
21

Description

# Problem to solve

We need to have a UI to make developing games with Flame easier. All other game engines have it: Unity, Unreal, Godot, GDevelop, etc.

This has been asked many times before, but we never had a concrete proposal. So, here it goes:

# Proposal

We create a new package `flame_studio`, which will be responsible for the UI. The package exposes a single function `runFlameStudio()`, which is a replacement for `runApp()`:
```dart
import 'package:flame_studio/flame_studio.dart';

void main() {
runFlameStudio(
Blah(
child: BlahBlah(
child: GameWidget(game: MyGame()),
),
),
);
}
```

In release mode, the function `runFlameStudio` collapses into simple `runApp()`. However, in debug mode it builds a FlameStudio UI framework around the provided widget. When you run this instrumented game in a browser, it displays the UI and connects it to the `GameWidget` found inside the widget tree.

The UI has multiple capabilities, among those:
- pause the game at any time;
- inspect the component tree;
- view/modify properties of components at runtime;
- add/delete/move components at runtime;
- inspect the game world outside of game canvas (i.e. a new camera that can look at the world independently).

In addition, the FlameStudio would still have access to the file system, which allows it to inspect the code, and maybe even allow scene modification from within the UI -- for example, the user adds an object to the scene, and the studio automatically writes code that would add that object in `onLoad()`. Similarly, one could permanently modify some properties of objects from within the studio.

There should also be a mechanism for writing extensions to Flame Studio -- say, `flame_jenny` could add a UI for inspecting dialogue trees, `flame_bloc` could show the state of all `Bloc`s, and `flame_tiled` work with Tiled maps directly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.