Library / SDK
RafaelBarbosatec/bonfire avatar
RafaelBarbosatec/bonfire

Bonfire 4.0 for Flutter RPG development

(RPG maker) Create RPG-style or similar games more simply with Flame.

1,485 stars197 forksDartMIT

At a glance

What is it?
Bonfire is a Dart and Flutter library for building RPG-style games on top of Flame. Version 4.0 reorganizes its feature mixins around a consistent resource API and updates the Flame dependency, but it also introduces substantial migration work for projects built on 3.x.
Who is it for?
Bonfire 4.0 fits Flutter developers starting an RPG-style game or already using Flame who want map, combat, input, behavior, and interface components in one library. It is less suitable for a 3.x project unless the team can absorb the documented breaking changes or verify compatibility with its existing component code.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 46 days ago.
What is it written in?
Mainly Dart, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Bonfire's role in a Flutter game project

Bonfire addresses a specific gap between a general game engine and a reusable RPG framework. Flame supplies the underlying Flutter game runtime, while Bonfire provides higher-level components for players, enemies, allies, NPCs, decorations, maps, combat, and interfaces. That makes it relevant to developers who want to assemble a top-down RPG or a similar game without writing every common system from individual Flame components.

The intended audience is Dart developers working in Flutter. The repository identifies mobile, desktop, and web as supported platforms through Flame, while its input components cover joystick, keyboard, and mouse controls. A project can use the same library across those targets, although the documentation excerpt does not promise identical controls or presentation on every platform.

Bonfire is not a general-purpose visual editor or a complete game shipped by itself. It is a code library. The README directs developers to a bundled example app containing maps, players, enemies, attacks, life bars, and interface elements. That distinction matters when comparing it with a full game engine or a tool that creates a project through a graphical interface. Bonfire supplies programmable building blocks, but the repository does not describe authoring scenes without code.

Maps, actors, and runtime composition in Bonfire

Bonfire organizes a game around Flame components and extends them with RPG-specific behavior. Its actor components include Player, Enemy, Ally, Npc, and GameDecoration. The documented GameComponent API is the common foundation for those entities, allowing map actors and game systems to remain connected to the underlying Flame component model rather than relying on a separate runtime architecture.

Map support includes Tiled maps, multi-map worlds, custom or matrix maps, collisions, and portals. These features correspond to common structure in an RPG: a level contains physical boundaries, characters occupy positions on that level, and portals connect one area with another. The README does not expose the exact object schema or a minimal map-loading example in the installation section, so it would be unsafe to invent configuration keys or asset-loading code.

The library also includes projectiles, melee and ranged attacks, life bars, dialogs, text effects, minimaps, and HUD components. Visually related systems include particles, lighting, shaders, camera effects, parallax, color filters, and force physics. Based on the repository layout and documented API names, Bonfire is intended to reduce the number of independent systems a developer must assemble for a conventional top-down game. The cost is a substantial public API whose naming and organization must be learned before the component model feels predictable.

Bonfire 4.0's WithFeature API restructuring

Version 4.0 is a major API restructuring rather than a small feature addition. Earlier mixins placed methods and fields directly on the component. When a component mixed in Movement, Jumper, Sensor, PathFinding, Pushable, or RandomMovement, those members crowded the component namespace and reduced the usefulness of autocomplete.

The 4.0 pattern places feature access under named resources. Documented resources include jumper, sensor, randomMovement, pathFinding, collision, attack, vision, lighting, shader, util, and others. WithCollision is also based on event listeners, while movement is intentionally different because it retains direct access. This exception makes movement a frequent part of an entity's update logic rather than an isolated resource.

The release notes describe several correctness changes. Diagonal movement uses exact normalization based on `sqrt(2)/2`. Forces default to no drag. The changelog notes correction of duplicate damage from `FlyingAttackGameObject`, and the project now uses Flame's `Color` API with `withValues`. Simple player and enemy classes drive eight-direction sprite animations from the current `direction`.

This design is clearer when several features coexist, but adopting the version is not a routine dependency update for 3.x code. Legacy movement members and helpers were removed, and collision handling moved to listeners and a `bodyType` API. The repository therefore points users to `MIGRATION_3_TO_4.md` and `CHANGELOG.md`, which are the correct files to inspect before estimating migration work.

Running the bundled Bonfire example

The README's fastest first use is the bundled example project. Add the package to an application's `pubspec.yaml` when integrating Bonfire into an existing Flutter project. The documented dependency declaration is:

yaml
dependencies:
  bonfire: ^4.0.0

For an immediate look at the complete setup, the README instructs developers to open the `example/` directory and run it with Flutter. These commands install the example's declared packages and launch it using the available Flutter device or browser target:

sh
cd example
flutter pub get
flutter run

The reader should see the example game rather than a command-line-only tool. The example contains actual map and gameplay files under `example/lib/`, assets under `example/assets/`, shaders under `example/shaders/`, and its own `pubspec.yaml`. This makes it a better first inspection point than inventing a small component from incomplete documentation.

For an existing application, the README additionally states that a first map and character should run inside `BonfireWidget`. It does not provide the complete widget construction code or a minimal Tiled asset format, so this article does not invent those details. The documentation site, `docs.page/rafaelbarbosatec/bonfire`, is the repository's stated source for complete examples.

Behavior trees and bounded cases for Bonfire

Bonfire 4.0 introduces a behavior-tree system with `BSelector`, `BParallel`, and `BOnce`, plus debugging support. The existing behavior and AI feature list also names pathfinding, random movement, sensors, and vision. These components support decisions that depend on an entity's surroundings, but the README does not define their exact execution priorities or callback signatures. Developers evaluating enemy behavior should therefore inspect the API documentation rather than assume that the tree selectors correspond directly to a particular behavior-tree notation.

A genuine constraint is migration risk. Projects using direct mixin methods must move feature calls behind resources such as `randomMovement`, `pathFinding`, or `collision`, unless they continue to use an earlier version. The removal of legacy movement members makes this more than a formatting change. Code, tests, custom mixins, and tutorials that refer to removed fields may all need review.

Bonfire is also the wrong choice when the required result is primarily a browser-based level editor, a complete commercial RPG framework with a visual workflow, or a project that must avoid Flutter and Dart. The repository presents a source-code library built on Flame. It may support web output, but web deployment does not turn it into a visual game editor. The evidence supports adopting Bonfire for code-first Flutter game construction, not for those different requirements.

Comparing Bonfire with direct Flame development

The closest documented alternative is developing the game directly against Flame. Flame is the underlying engine used by Bonfire, so the difference is not a competing rendering model or a replacement for Flutter. It is the level of RPG-specific structure added above Flame.

Direct Flame development leaves the developer responsible for assembling player and enemy components, controls, maps, collisions, attacks, pathfinding, interface elements, and any behavior system. That control can be useful for a game whose mechanics differ substantially from Bonfire's documented RPG model. It also avoids the Bonfire 4.0 migration boundary when the new API does not fit the project.

Bonfire is more immediately suited to the documented feature set. Its `Player`, `Enemy`, `Ally`, `Npc`, Tiled support, joystick input, attacks, life bars, and `GameComponent` API remove repeated implementation work for a conventional RPG. The trade-off is a larger opinionated API and, for existing 3.x applications, the work described in `MIGRATION_3_TO_4.md`.

Bonfire 4.0 depends on Flame `^1.38.0`. The two projects should therefore be evaluated together when checking compatibility. The repository's MIT license permits use and modification under that license, with the license file containing the governing terms. It is a Dart package published through pub.dev, and the repository also lists `bonfire_bloc` and `bonfire_spine` as related packages.

Bonfire maintenance and upgrade considerations

The repository is not archived, and the last push was on 2026-09-07. The listed releases show `v4.0.0` on 2026-09-07, preceded by `v3.17.1` and `v3.17.2` on 2026-04-23. Based on those repository facts, Bonfire is receiving recent development attention, although upgrade planning should still account for the major API break in 4.0.

The largest upgrade cost is not dependency resolution. It is the code migration from direct mixin members to `WithFeature` resources. Collision overrides need review because `WithCollision` exposes listeners and `bodyType`. Movement code needs review because direction fields now reflect current velocity and older stop helpers were removed. Custom classes using `Jumper`, `Sensor`, `PathFinding`, `Pushable`, `RandomMovement`, attacks, vision, lighting, shaders, or life bars may be affected by the resource-based access pattern.

The README says `example/` and `awesome/` were updated to the new APIs and analyzed by CI. That gives adopters concrete places to inspect, but it does not replace project-specific testing. The first verification step for an existing game is to read `MIGRATION_3_TO_4.md`, then check the example and test suite against the project's custom components.

Editorial conclusion

Bonfire 4.0 fits Flutter developers starting an RPG-style game or already using Flame who want map, combat, input, behavior, and interface components in one library. It is less suitable for a 3.x project unless the team can absorb the documented breaking changes or verify compatibility with its existing component code. Before adoption, inspect MIGRATION_3_TO_4.md, confirm the example app against the required Flutter environment, and map each custom game component to the new WithFeature pattern.

Frequently asked questions

What is Bonfire used for?

Bonfire is used to build RPG-style and similar games with Dart and Flutter on top of Flame. It provides actors, maps, input, combat, behavior, effects, and interface components.

How do I install and run the Bonfire example?

Add `bonfire: ^4.0.0` to a Flutter project's dependencies, or use the bundled example directory. The README gives `flutter pub get` followed by `flutter run` for the example app.

What changed in Bonfire 4.0?

Bonfire 4.0 reorganized mixins around `WithFeature` resources such as `pathFinding`, `collision`, and `randomMovement`. It also updated Flame to `^1.38.0`, changed movement and collision APIs, and added behavior trees.

Can I migrate an existing Bonfire 3.x game to version 4.0?

The repository provides `MIGRATION_3_TO_4.md` for this purpose. The release includes breaking API changes, so developers should review the migration guide and changelog against their custom components.

Official sources

  1. License: MIT
  2. Project website
  3. RafaelBarbosatec/bonfire on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/rafaelbarbosatec-bonfire.svg)](https://hysenlabs.com/projects/rafaelbarbosatec-bonfire)

Was this useful?