Best Practices

Focus

Behavior nodes have a 1:1 relationship with their associated inputs/outputs within the behavior tree. Cause nodes should adhere to the Single Responsibility Principle, a vital part of the SOLID object-oriented design practices. If done correctly, the Cause node will be individually responsible for solely evaluating specific conditions. Similarly, using this principle with effect nodes means each node executes a single action.

Coupling

Coupling between nodes in code can lead to brittle behavior. Nodes should only communicate through input and output sockets; they should not depend on each other in code. This allows for easy modification and extension of the behavior tree without affecting other system parts, thereby conforming to the Open/Closed Principle.

Structured Architecture

Behavior nodes cannot be Unity MonoBehaviors. They are Plain Old C# Objects (POCO). This practice of using POCOs creates a more structured application architecture that makes nodes platform-agnostic, performant, reusable, easier to control, and easier to troubleshoot. While MonoBehaviors are tightly coupled with Unity's lifecycle and primarily used for GameObject components, behavior tree nodes operate independently of Unity's GameObject architecture. To leverage Unity's lifecycle events, the SparkSDK offers the Lifecycle class.

“Interacted” and “Grabbed” Effects Require “Is Interactable” Trait

When adding an "Interacted" or "Grabbed" Behavior Node to a Spark, ensure that the "Is Interactable" trait is checked. It is common for new creators to overlook this step, leading to confusion about the inability to grab or interact with Sparks.

Setting UI Button Sort Order

When configuring UI buttons, make sure the Sort Order of the button is set higher than other UI elements within the same container (such as a Billboard or Screen Space UI) if symbols or elements overlap the button, as shown in the image. This ensures the button stays on the top layer, making it clickable and fully functional.

If no other UI elements overlap the button (like in the image below), having the same Sort Order is fine and should work as expected.

Troubleshoot Missing Assets: Click ‘Spark’ Breadcrumb

If a downloaded asset doesn’t appear immediately, try clicking the breadcrumb labeled "Spark" at the top of the interface to ensure the asset is properly loaded.

Keep Utilization Under 200% for Optimal Performance in Bonfire Builder

Always monitor the Utilization Bar in the Bonfire Builder and ensure it does not exceed 200%. Exceeding this limit can cause performance issues and lead to lag within your Book.

Quickly Return to Main Folder in Spark Browser with Breadcrumbs

To quickly navigate back to the main folder while in a sub-folder within the Spark Browser, simply click the breadcrumb labeled "Spark" at the top of the interface. This will immediately take you back to the main Spark directory, saving time and making navigation smoother.

Easily Locate Nodes or Chapters with "Zoom to Fit Selected" in Behavior and Chapter Windows

In the Behavior Window and Chapter Window, use the "Zoom to Fit Selected" button to quickly focus on or locate specific behavior nodes or chapters. This button automatically adjusts the view to center on the selected item, making it easier to find and edit nodes or chapters in complex layouts.

Customize Your Bonfire Builder Layout for a More Efficient Workspace

You can customize your window layout in the Bonfire Builder to suit your workflow preferences. Adjusting the layout can help you manage your workspace more efficiently when creating or editing Books.

Manage and Save Your Workspace Layouts in Bonfire Builder Settings

In the Settings window of Bonfire Builder, you can easily reset, save, and open your saved layout configurations. This feature allows you to customize your workspace and maintain your preferred setup across sessions.

Quickly Find and Edit Sparks Using the Search Bar Across Multiple Windows

In the Chapter Window, Behavior Window, Spark Browser, Map Browser, Config Window, Entities Window, and Symbols Window, you can use the search bar to quickly locate or modify specific Sparks.

Use the "Report a Bug" Button to Submit Bugs or Feature Requests in Bonfire Builder

If you find a bug or want to request a new feature in Bonfire Builder, click the "Report a Bug" button.

To make your report clear:

  1. Be Specific: Describe exactly what happened or what you want.

  2. Test Before Reporting: Make sure the bug happens more than once.

  3. Provide Details:

    • Steps to Reproduce: List what you did before the bug appeared.

    • Screenshots or Videos: Include visuals if possible.

    • System Info: Add your device and Bonfire version.

This helps the team understand and fix issues faster!

Last updated

Was this helpful?

#18: Add Best Practices Content

Change request updated