FableFlow Engine

The core engine for FableFlow visual novels. This package provides the fundamental building blocks for creating interactive visual novel experiences in Flutter.

Features

  • πŸ“– Scene Management: Support for multiple scene types including regular scenes, cutscenes, and ending scenes
  • πŸ’¬ Dialog System: Character-based dialog system with customizable text and name styles
  • 🎭 Character System: Support for character sprites with positioning (left, right, center) and states
  • πŸ”€ Branching Logic: Conditional branching with variable support
  • 🎡 Audio Support: Background music and sound effects with multiple audio sources (network, local, assets)
  • πŸ’Ύ Save/Load System: Multiple save slots with scene and variable persistence
  • 🎨 Customization: Customizable dialog boxes, text styles, and UI elements
  • πŸ–ΌοΈ Asset Loading: Support for network images, local files, and bundled assets

Getting Started

Add this package to your pubspec.yaml:

dependencies:
  fable_flow_engine: ^0.1.0

Usage

Basic Scene Display

import 'package:fable_flow_engine/models/scene.dart';
import 'package:fable_flow_engine/widget/scene_widget.dart';

SceneWidget(
  scene: Scene(
    id: 'scene_1',
    image: 'https://example.com/background.png',
    behaviors: [
      Behavior(
        character: Character(
          id: 'char_1',
          name: 'Alice',
          color: Colors.blue,
        ),
        dialog: 'Hello, world!',
        position: Position.left,
      ),
    ],
  ),
  variables: {},
  onComplete: () {
    // Handle scene completion
  },
)

Loading from JSON

import 'package:fable_flow_engine/models/Interlude.dart';
import 'package:fable_flow_engine/widget/future_interlude_widget.dart';

FutureInterludeWidget(
  path: 'assets/story.json',
  onComplete: () {
    // Story completed
  },
)

Customizing Dialog Appearance

SceneWidget(
  scene: myScene,
  variables: {},
  onComplete: () {},
  dialogBoxDecoration: BoxDecoration(
    color: Colors.black.withOpacity(0.8),
    borderRadius: BorderRadius.circular(10),
  ),
  characterNameStyle: TextStyle(
    color: Colors.yellow,
    fontSize: 20,
    fontWeight: FontWeight.bold,
  ),
  dialogTextStyle: TextStyle(
    color: Colors.white,
    fontSize: 16,
  ),
)

Models

Scene

Represents a game scene with background, behaviors, and optional branching.

Behavior

Defines character actions including dialog, position, and state.

Character

Character definition with ID, name, and visual properties.

Branch

Conditional branching with variable modifications.

Interlude

A complete story with multiple scenes and global variables.

Additional Information

For more information on creating visual novels with FableFlow, check out the lite package for a simplified player experience.