Table of Contents
- Introduction
- 1. Separating the Responsibilities of Unity and CFAST
- 2. Stateful Simulation and Asynchronous Communication
- 3. Managing Multiple Fire Sources
- 4. Allocating Fuel Across Compartments
- 5. Investigating Ceiling Fire Sources
- 6. Requested HRR vs. Actual HRR
- 7. Why Fuel Pyrolysis Can Continue After Combustion Stops
- 8. Treating the Ceiling as a Structural Boundary
- 9. The Asynchronous HP Overwrite Problem
- 10. Fixing the State Management Problem
- 11. Validation Results
- 12. Extinguishing Events and Zero-HRR Commands
- 13. Different Completion Conditions in Stage01 and Stage02
- 14. Connecting Fire Sources, Doors, and Smoke Rendering
- 15. AI-Assisted Development and Acceptance Criteria
- 16. Current Implementation and Limitations
- 17. Interactive Technical Documentation
- 18. Conclusion
- References
- About the Project
Introduction
I am an independent developer working on a firefighting and disaster response game called SOKYU: OPERATION RESCUE BLAZE SERIES.
In the first development report, I introduced how I integrated CFAST, a fire simulator developed by the National Institute of Standards and Technology (NIST), with the Unity game engine.
The first report covered:
- Stateful fire simulation
- Real-time smoke rendering
- Inter-process communication
- Numerical solver instability
- Building model corrections
- Smoke rendering optimization
In this second report, I will focus on another engineering challenge:
How can a game engine and a scientific fire simulator manage combustion, fuel consumption, and extinguishing events without creating inconsistent states?
In a game, a player can apply water to a fire and reduce its health points (HP).
Meanwhile, CFAST calculates heat release rates, oxygen concentrations, fuel pyrolysis, smoke generation, and gas transport.
These two systems operate independently and update their states at different times.
Connecting them requires more than simply exchanging numerical data. It requires careful management of state ownership, asynchronous communication, and simulation consistency.
Table of Contents
- 1. Separating the Responsibilities of Unity and CFAST
- 2. Stateful Simulation and Asynchronous Communication
- 3. Managing Multiple Fire Sources
- 4. Allocating Fuel Across Compartments
- 5. Investigating Ceiling Fire Sources
- 6. Requested HRR vs. Actual HRR
- 7. Why Fuel Pyrolysis Can Continue After Combustion Stops
- 8. Treating the Ceiling as a Structural Boundary
- 9. The Asynchronous HP Overwrite Problem
- 10. Fixing the State Management Problem
- 11. Validation Results
- 12. Extinguishing Events and Zero-HRR Commands
- 13. Different Completion Conditions in Stage01 and Stage02
- 14. Connecting Fire Sources, Doors, and Smoke Rendering
- 15. AI-Assisted Development and Acceptance Criteria
- 16. Current Implementation and Limitations
- 17. Interactive Technical Documentation
- 18. Conclusion
- References
- About the Project
1. Separating the Responsibilities of Unity and CFAST
Unity is a game engine, while CFAST is a scientific fire simulation program.
Although they exchange information, their responsibilities are fundamentally different.
| Responsibility | Unity | CFAST |
|---|---|---|
| Player input | Managed | Not applicable |
| Water application | Managed | Receives corresponding fire input |
| Water hit detection | Managed | Not applicable |
| Fire HP | Managed | Not applicable |
| Requested heat release rate | Generates input | Receives input |
| Actual heat release rate | Uses simulation results | Calculates |
| Fuel pyrolysis | Uses simulation results | Calculates |
| Oxygen concentration | Uses simulation results | Calculates |
| Smoke optical density | Uses for rendering | Calculates |
| Door and window state | Managed | Receives input |
| Gas transport | Uses for visualization | Calculates |
| Stage completion | Managed | Not applicable |
CFAST does not understand gameplay concepts such as health points, player actions, or mission completion.
Similarly, Unity's gameplay state alone does not calculate compartment-level fire dynamics.
The architecture therefore separates gameplay responsibilities from scientific simulation responsibilities.
UNITY
─────────────────────────────────
Player Input
Water Hit Detection
Fire HP
Door and Window State
Game Progression
│
│ Simulation Input
▼
CFAST NATIVE WORKER
─────────────────────────────────
Combustion
Heat Release Rate
Fuel Pyrolysis
Oxygen Concentration
Smoke and Gas Transport
│
│ Simulation Results
▼
UNITY VISUALIZATION
─────────────────────────────────
Fire Rendering
Indoor Smoke Volume
Opening Smoke Particles
Fuel State Updates
The objective is not to make both systems independently manage the same information.
Instead, each system is responsible for the information it is designed to manage.
2. Stateful Simulation and Asynchronous Communication
As introduced in the previous report, I developed a stateful derivative of CFAST that runs as an independent native worker.
Unity sends a STEP request containing updated fire and opening conditions.
The CFAST worker advances the simulation from its previously accepted state to the requested simulation time.
Once the calculation is complete, the worker returns a new observation to Unity.
Unity CFAST Worker
│ │
│──── STEP Request ─────────────>│
│ │
│ Player movement continues │ Numerical
│ Water application continues │ calculation
│ Fire HP may change │
│ │
│<──── Simulation Results ───────│
│ │
│ Validate and accept results │
│ Update fire and smoke │
│ │
│──── Next STEP Request ────────>│
The game does not need to block its main thread while waiting for CFAST.
However, this introduces a state management challenge.
The gameplay state may change after a simulation request has been submitted but before its response arrives.
An asynchronous response must therefore be interpreted in the context of the request that generated it.
It cannot automatically be treated as the latest gameplay state.
3. Managing Multiple Fire Sources
Stage02 is based on a Japanese 2LDK residential layout.
The CFAST building model consists of the following compartments:
| Compartment | Description |
|---|---|
| R1 | Bathroom |
| R2 | Washroom and dressing area |
| R3 | Left bedroom |
| R4 | Living, dining, and kitchen area |
| R5 | Entrance hall |
| R6 | Toilet compartment |
| R7 | Right bedroom |
| R8 | Attic |
During development, I extended the CFAST integration to include the entrance hall floor and wallpaper as additional fuel sources.
The challenge was that Unity's combustible objects did not always correspond to a single CFAST compartment.
A single combustible surface could extend across multiple gas calculation regions.
Mapping Unity Fire Objects to CFAST Fire Sources
The resulting Stage02 model contains five native fire sources.
| Fire ID | Combustible Object | Compartment |
|---|---|---|
| F1 | Dedicated propane fire source | R4 |
| F2 | Hall floor | R5 |
| F3 | Hall floor | R6 |
| F4 | Hall wallpaper | R5 |
| F5 | Hall wallpaper | R6 |
The Unity-side representation is different from the CFAST representation.
Unity Combustible Objects CFAST Fire Sources
Hall Floor ───────────────────┬──> F2 / R5
│
└──> F3 / R6
Hall Wallpaper ───────────────┬──> F4 / R5
│
└──> F5 / R6
Unity manages the floor and wallpaper as two individual combustible objects.
CFAST represents them using four fire sources distributed across two compartments.
The integration must therefore maintain a mapping between gameplay objects and native simulation fire sources.
4. Allocating Fuel Across Compartments
When a single combustible surface is associated with multiple CFAST compartments, its fuel must be distributed without duplicating the original fuel quantity.
For this implementation, the allocation ratios were calculated from the contact areas between the combustible surface and the corresponding CFAST gas regions.
The allocation ratio is defined as:
$$
r_i=\frac{A_i}{\sum_j A_j}
$$
Where:
- $A_i$ is the contact area associated with compartment $i$.
- $r_i$ is the fuel allocation ratio for compartment $i$.
If the original fuel quantity is $M$, the allocated quantity is:
$$
M_i=r_iM
$$
The total allocated fuel must satisfy:
$$
\sum_i M_i=M
$$
Stage02 Fuel Allocation Results
The following allocation ratios were calculated from the existing building geometry.
| Combustible Object | R5 Allocation | R6 Allocation |
|---|---|---|
| Hall floor | 73.587% | 26.413% |
| Hall wallpaper | 23.609% | 76.391% |
The original fuel quantity is distributed rather than duplicated.
The allocation was also checked to ensure that the total initial fuel budget remained unchanged.
The displayed percentages are rounded. The implementation uses the original calculated values.
This approach is a geometric approximation used to map gameplay fuel objects to compartment-level simulation sources.
It is not a material combustion model calibrated against experimental fire tests.
5. Investigating Ceiling Fire Sources
Initially, I also considered connecting the ceiling to CFAST as an independent combustible source.
However, tests involving fire sources positioned near the ceiling revealed an interesting limitation of the two-zone model.
The Initial Upper Gas Layer
CFAST represents a compartment using upper and lower gas layers.
In the investigated Stage02 model, the initial upper layer occupied approximately 0.01% of the compartment volume.
For a compartment approximately 2.7 meters high, this corresponded to an initial upper-layer thickness of approximately 0.27 millimeters.
Ceiling
┌────────────────────────────────┐
│ Upper Gas Layer │
│ Approx. 0.27 mm initially │
├────────────────────────────────┤
│ │
│ │
│ │
│ Lower Gas Layer │
│ │
│ Approx. 99.99% of volume │
│ │
│ │
└────────────────────────────────┘
Floor
The diagram exaggerates the upper-layer thickness for readability.
A ceiling fire source placed inside this extremely thin upper layer may have access to only a small amount of oxygen through the modeled plume entrainment process.
Initial Oxygen Inventory
| Compartment and Layer | Initial Oxygen Mass |
|---|---|
| R5 upper layer | Approximately 0.377 g |
| R5 lower layer | Approximately 3.766 kg |
| R6 upper layer | Approximately 0.131 g |
| R6 lower layer | Approximately 1.309 kg |
Although the compartment as a whole contained a substantial amount of oxygen, the fire source was located in a layer with a very small initial oxygen inventory.
This distinction became important during the combustion tests.
The issue was not simply whether oxygen existed somewhere inside the room.
It was whether oxygen was available to the modeled fire source through the relevant gas transport and entrainment processes.
6. Requested HRR vs. Actual HRR
HRR stands for Heat Release Rate.
In the Unity integration, a requested HRR is sent to CFAST as an input condition.
However, the requested heat release rate is not necessarily equal to the actual heat release rate calculated by the simulator.
Requested Heat Release Rate
│
▼
CFAST Combustion Model
│
┌──────────┼──────────┐
│ │ │
Oxygen Source Plume
Conditions Position Entrainment
│ │ │
└──────────┼──────────┘
▼
Actual Heat Release Rate
CFAST can limit combustion according to oxygen availability and other modeled conditions.
During the ceiling fire investigation, I used a candidate input with a total requested HRR of approximately 520 kW.
The test also revealed an argument-order issue in the upper-layer plume calculation.
A corrected experimental worker was built separately to investigate the effect of this issue.
Comparison of Initial Actual HRR
| Test Condition | Initial Actual HRR |
|---|---|
| Before the argument-order correction | Approximately 520 kW |
| After the argument-order correction | Approximately 4.25 kW |
After the correction, the initial actual HRR was significantly lower than the requested value.
Furthermore, under the tested constant-input conditions, actual HRR reached zero within approximately 0.1 seconds.
Tests with different exterior opening conditions produced similar early behavior.
This result did not establish that a real ceiling fire would behave in the same way.
Instead, it revealed a limitation of the particular fire source representation, initial layer configuration, and combustion input used in this model.
The corrected experimental worker was used for investigation. Its use should not be confused with deployment of a replacement production worker.
7. Why Fuel Pyrolysis Can Continue After Combustion Stops
Another interesting result was that the calculated actual HRR could reach zero while fuel pyrolysis continued.
At first, this seemed inconsistent.
However, combustion and pyrolysis are not the same physical process.
Pyrolysis refers to the thermal decomposition of fuel material.
Combustion requires suitable conditions for the released fuel to react with oxygen and release heat.
In the investigated CFAST configuration, the prescribed fuel pyrolysis rate continued even when oxygen limitations reduced the actual heat release rate.
The unburned fuel gases accumulated in the upper layer.
Requested Heat Release Rate and Prescribed Pyrolysis
The native input processing uses the relationship:
$$
\dot{m}{fuel}=\frac{\dot{Q}{requested}}{\Delta H_c}
$$
Where:
- $\dot{m}_{fuel}$ is the prescribed fuel mass flow rate.
- $\dot{Q}_{requested}$ is the requested heat release rate.
- $\Delta H_c$ is the heat of combustion.
The prescribed pyrolysis rate and actual combustion rate must therefore be distinguished.
Observed Behavior
After correcting the plume argument order, the initial oxygen reduction was no longer primarily caused by extremely rapid combustion.
Instead, the continued supply of unburned pyrolysis gases diluted the oxygen mass fraction in the very thin upper layer.
In the investigated partial-opening condition, the upper layers retained most of their initial oxygen mass, but their oxygen mass fractions still fell below the combustion threshold.
This explains why examining oxygen concentration alone is insufficient.
The total oxygen mass, total gas mass, combustion consumption, and incoming fuel gases must also be considered.
Residual Smoke
Smoke can also remain after actual HRR becomes zero.
Soot generated during earlier combustion does not automatically disappear when the fire stops releasing heat.
Consequently, the following assumptions would be inappropriate:
- Zero actual HRR means zero smoke.
- Zero actual HRR always means zero prescribed pyrolysis.
- An open door guarantees sufficient oxygen at every fire source.
- A stopped fire source implies that all previously generated combustion products have disappeared.
Understanding the meaning of each simulation output is essential before connecting it to gameplay logic.
8. Treating the Ceiling as a Structural Boundary
CFAST allows thermal material properties to be assigned to compartment boundaries.
For example, ceiling materials can be used in heat transfer calculations involving conduction, convection, and radiation.
However, assigning a ceiling material does not automatically create a complete model of ceiling ignition, material pyrolysis, and flame spread across the ceiling surface.
Representing such combustion requires additional fire source definitions and suitable material-dependent combustion data.
During the Stage02 investigation, the ceiling object was identified as part of the existing structural ceiling.
No separate combustible ceiling finish was identified.
I therefore adopted the following design:
| Object | Representation |
|---|---|
| Hall floor | CFAST fuel source |
| Hall wallpaper | CFAST fuel source |
| Structural ceiling slab | CFAST thermal boundary |
| Existing Unity ceiling fire object | Retained as a gameplay object |
The ceiling was not connected as an independent native fuel source.
I also avoided introducing arbitrary source position offsets or artificial oxygen and HRR corrections merely to keep the ceiling fire burning.
The objective of this project is to develop a game with simulation-driven fire behavior, not to construct an experimentally validated ceiling material combustion model.
Understanding the limitations of a simulation model is just as important as implementing its capabilities.
9. The Asynchronous HP Overwrite Problem
After connecting the Hall floor and wallpaper to CFAST, another problem emerged.
Water damage applied by the player was sometimes lost while waiting for a simulation response.
The cause was an asynchronous state management conflict.
Behavior Before the Fix
Consider the following simplified example.
- A fire object has 100 HP.
- Unity submits a simulation request.
- CFAST begins calculating.
- The player applies water to the fire.
- Unity reduces the fire HP.
- CFAST returns a result associated with the earlier request.
- The previous fuel-related state overwrites the newly reduced HP.
Time ──────────────────────────────────>
Unity
HP = 100
│
├── Submit STEP request
│
├── Apply water
│
├── HP decreases
│
├── Receive earlier simulation result
│
└── HP overwritten by older state
CFAST
│
├── Receive STEP request
│
├── Calculate previous input conditions
│
└── Return simulation result
The result was that repeated water application did not always accumulate correctly.
This was not a failure of the CFAST combustion equations.
It was a software state management problem caused by updating related information at different times.
Similar problems occur in embedded systems, asynchronous network communication, distributed applications, and multi-threaded software.
10. Fixing the State Management Problem
The solution was to distinguish between the current gameplay state and the accepted simulation state.
The following information must be managed separately:
- Current Unity fire HP
- Latest water damage
- Accepted CFAST fuel state
- Submitted STEP request
- Corresponding accepted STEP response
A CFAST response belongs to the simulation request that generated it.
It must not overwrite newer gameplay changes simply because it arrives later.
Revised State Ownership
UNITY GAMEPLAY STATE
──────────────────────────
Current Fire HP
Latest Water Damage
Extinguishing State
│
│ Fire Input
▼
CFAST SIMULATION STATE
──────────────────────────
Requested HRR
Actual HRR
Pyrolysis
Accepted Fuel State
│
│ Accepted Response
▼
STATE RECONCILIATION
──────────────────────────
Validate Request Identity
Update Accepted Fuel State
Preserve Current Fire HP
Preserve Extinguishing State
In the revised implementation, Unity retains the HP changes caused by water application.
The accepted CFAST response updates the corresponding confirmed fuel state without discarding newer water damage.
This also prevents an outdated response from restoring a fire that has already been extinguished.
Required Behaviors
The implementation was designed to satisfy the following conditions:
- Water damage accumulates while a simulation request is pending.
- Older responses do not restore previous HP values.
- Duplicate responses do not apply the same update twice.
- A fire with zero HP is not restored by an outdated response.
- Existing reignition behavior is preserved.
- Accepted simulation results remain associated with their corresponding requests.
The purpose of the change was to preserve the existing gameplay behavior while integrating asynchronous scientific calculation results.
11. Validation Results
The revised state management implementation was tested in an isolated Stage02 ZERO scene.
During the test, the acceptance of a CFAST response was deliberately delayed.
Two water applications were then performed on each of the selected combustible objects.
Fire HP Retention
| Combustible Object | Initial HP | HP After Water Application | HP After STEP Acceptance |
|---|---|---|---|
| Hall floor | 100 | 86.5 | 86.5 |
| Hall wallpaper | 180 | 166.5 | 166.5 |
The reduced HP values remained unchanged after the corresponding CFAST response was accepted.
Hall Floor
Before water: 100.0
After water: 86.5
After CFAST reply: 86.5
Hall Wallpaper
Before water: 180.0
After water: 166.5
After CFAST reply: 166.5
This confirmed that the asynchronous response no longer erased the water damage in the tested conditions.
Additional Validation
A separate EditMode test suite covered the state management behavior.
| Validation Item | Result |
|---|---|
| EditMode tests | 49 passed |
| Older response handling | Passed |
| Duplicate response handling | Passed |
| Final extinguishing state | Passed |
| Existing reignition behavior | Passed |
| Independent code review | PASS |
The tests were performed against the relevant implementation candidate.
The subsequent Hall integration was incorporated into the production source code.
These results establish the behavior within the tested scope rather than guaranteeing every possible gameplay sequence or hardware configuration.
12. Extinguishing Events and Zero-HRR Commands
Another important design decision concerns the meaning of extinguishing a fire.
In Stage02, Unity manages water hit detection, fire HP, and the final gameplay extinguishing decision.
When the HP of a fire object reaches zero, Unity immediately records that object as extinguished.
The next available STEP request specifies a requested HRR of zero watts for the corresponding CFAST fire sources.
Player Applies Water
│
▼
Unity Water Hit Detection
│
▼
Reduce Fire HP
│
▼
Is HP Zero?
│ │
No Yes
│ │
│ ▼
│ Confirm Gameplay
│ Extinguishing State
│ │
│ ▼
│ Send 0 W to CFAST
│ in the Next STEP
│ │
└─────┴──> Continue State Updates
Mapping an Extinguishing Event to Multiple Fire Sources
The Hall floor is represented by two native fire sources.
When Unity extinguishes the Hall floor, both corresponding fire source inputs are set to zero.
Unity Hall Floor
HP = 0
│
├──> F2: Requested HRR = 0 W
│
└──> F3: Requested HRR = 0 W
The same principle applies to the Hall wallpaper.
Unity Hall Wallpaper
HP = 0
│
├──> F4: Requested HRR = 0 W
│
└──> F5: Requested HRR = 0 W
The zero-HRR command changes the prescribed fire and pyrolysis input.
It does not represent a detailed simulation of water droplets, water evaporation, or direct cooling of the combustible material.
Those phenomena would require additional physical models and corresponding input data.
13. Different Completion Conditions in Stage01 and Stage02
During development, I also identified a difference between the existing Stage01 and Stage02 implementations.
Stage01 contains a completion-wait mechanism for selected native fire sources.
For example, after Unity records an extinguishing event for the sofa fire source, the game waits for a corresponding CFAST response confirming that the relevant actual and theoretical HRR values have reached zero.
Stage02 uses a different completion condition.
Its gameplay completion logic is based on the number of remaining active game fire objects.
The CFAST zero-HRR response is not a mandatory stage completion condition.
| Behavior | Stage01 Selected Sources | Stage02 |
|---|---|---|
| Unity water hit detection | Yes | Yes |
| Gameplay extinguishing state | Yes | Yes |
| Zero-HRR input to CFAST | Yes | Yes |
| Waiting for native fire-stop confirmation | Yes, for selected sources | No |
| Gameplay completion | Includes the relevant native confirmation | Based on remaining game fire objects |
These differences are currently preserved.
The existence of different implementations does not automatically mean that one of them is defective.
Before introducing a unified completion mechanism, I would first need to determine whether that change is required by the game design.
This became an important lesson in defining the scope of software development and acceptance testing.
14. Connecting Fire Sources, Doors, and Smoke Rendering
The fire state is only one part of the simulated environment.
Opening conditions also influence gas transport, smoke distribution, and oxygen availability.
Stage02 now includes six interactive interior doors.
The opening conditions are sent from Unity to CFAST, where the resulting compartment and gas transport calculations are performed.
PLAYER
│
┌────────────┴────────────┐
│ │
Water Application Door Operation
│ │
▼ ▼
Unity Fire State Unity Opening State
│ │
└────────────┬────────────┘
│
▼
CFAST WORKER
│
┌────────────┼────────────┐
│ │ │
Combustion Gas Layers Gas Transport
Fuel State Optical Flow Rate
Actual HRR Density Flow Direction
│ │ │
▼ ▼ ▼
Fire Rendering Indoor Smoke Opening Smoke
Fuel Updates Rendering Rendering
The objective is to make gameplay interactions change the simulation inputs rather than merely triggering predefined effects.
For example, opening a door creates a possible gas transport path between compartments.
The actual amount and direction of gas transport are determined by the CFAST calculation.
Applying water changes the gameplay fire state and subsequently changes the corresponding fire input.
The calculated smoke and gas conditions are then visualized in Unity.
This provides a connection between gameplay events and the evolving simulated environment.
15. AI-Assisted Development and Acceptance Criteria
This project is being developed with the assistance of OpenAI Codex.
I use separate implementation and review roles to support software development, investigation, and testing.
However, integrating a scientific simulation into a game revealed an additional challenge in AI-assisted engineering.
AI agents can introduce validation requirements for functionality that has never been designed or approved.
For example, the following behaviors were initially considered during testing:
- Smoke exhaust after complete extinguishment
- Post-fire cooling
- Oxygen recovery after extinguishment
- Waiting for every zero-HRR response before allowing stage completion
Although some of these phenomena may be relevant to scientific fire simulation, they were not all defined as independent gameplay acceptance requirements.
Treating their absence as an implementation failure caused unnecessary investigation and repeated testing.
Revised Development Policy
I therefore established a clearer distinction between approved requirements and proposed functionality.
| Status | Meaning |
|---|---|
| PASS | An approved requirement is satisfied. |
| FAIL | An approved requirement is not satisfied, or a regression exists. |
| BLOCKED | A required verification cannot be completed because of a concrete blocker. |
| NOT_RUN | An applicable verification has not been executed. |
| N/A | The functionality is outside the current scope. |
| PROPOSAL | A proposed feature or design change requiring approval. |
An undesigned feature should not automatically result in a failed acceptance test.
However, if an unexpected behavior prevents an existing approved feature from working, that impact must still be investigated.
Development Workflow
Potential Requirement or Issue
│
▼
Is It Required by the Game?
│
┌─────┴─────┐
│ │
No Yes
│ │
▼ ▼
Outside Scope Additional Design
│
▼
Developer Approval
│
▼
Implementation
│
▼
Testing
│
▼
Independent Review
│
▼
Final Acceptance
AI makes it possible to perform extensive source code investigations and generate large numbers of tests.
But the number of tests is not itself a measure of software quality.
The engineering objective must remain clear.
The purpose of testing is to validate the intended software behavior, not to expand the project indefinitely.
16. Current Implementation and Limitations
The following table summarizes the development results discussed in this report.
| Development Item | Status |
|---|---|
| Stateful CFAST integration | Implemented |
| Multiple native fire source mapping | Implemented |
| Geometry-based fuel allocation | Implemented |
| Hall floor integration | Integrated into production source |
| Hall wallpaper integration | Integrated into production source |
| Structural ceiling treatment | Implemented |
| Independent native ceiling fuel source | Not adopted |
| Asynchronous HP retention | Implemented and validated |
| Zero-HRR fire input | Implemented |
| Dynamic interior opening conditions | Implemented |
| Independent code review | Passed for the adopted Hall integration |
There are also important limitations.
The current implementation does not claim to reproduce every aspect of combustion or firefighting physics.
For example:
- Water droplets and direct material cooling are not explicitly simulated by this CFAST input mechanism.
- The ceiling combustion investigation does not establish a validated physical ceiling fire model.
- The fuel allocation ratios are based on game geometry rather than material combustion experiments.
- Successful asynchronous state management tests do not guarantee every possible gameplay sequence.
- The corrected experimental plume worker must be distinguished from the existing production worker.
The purpose of this implementation is to improve simulation-driven gameplay and fire visualization.
It is not a certified firefighting training system or a validated real-world fire prediction model.
17. Interactive Technical Documentation
I have also prepared technical documentation on the project website.
The website presents the CFAST and Unity integration through diagrams, animations, and interactive technical explanations.
CFAST × Unity Technical Guide
CFAST and Unity Fire Simulation Technical Guide
Stage02 Technical Validation
Stage02 — Numerical Stability, Smoke Rendering, and Opening Control
The technical documentation covers:
- CFAST's two-zone simulation model
- Stateful communication between Unity and CFAST
- Compartment and opening geometry
- Indoor volumetric smoke rendering
- Smoke transport through openings
- DASSL numerical solver instability
- Building model corrections
- Smoke rendering optimization
- Interactive interior door control
The website is primarily presented in Japanese, but includes visual diagrams and animations to explain the technical concepts.
If you are interested in scientific computing, simulation-driven gameplay, real-time graphics, or AI-assisted software engineering, please take a look.
18. Conclusion
Integrating a fire simulator into a game engine is not simply a matter of obtaining numerical data and displaying smoke.
The integration must account for differences in system responsibilities, execution timing, state ownership, and physical modeling.
The main engineering challenges discussed in this report were:
- Mapping Unity combustible objects to multiple CFAST fire sources
- Allocating fuel without duplicating the original fuel budget
- Understanding the difference between requested and actual HRR
- Distinguishing combustion from prescribed fuel pyrolysis
- Investigating the limitations of ceiling fire source modeling
- Preventing asynchronous responses from overwriting current gameplay states
- Maintaining consistent extinguishing events
- Defining appropriate acceptance criteria for AI-assisted development
As someone with experience in embedded software development, I find many similarities between this project and embedded systems engineering.
Asynchronous communication, state machines, ownership boundaries, data consistency, and resource management are all important in both fields.
Unity provides the interactive environment.
CFAST provides the compartment-level fire simulation.
The integration architecture connects these two systems while preserving their individual responsibilities.
In the next development report, I will focus on how CFAST's numerical outputs are transformed into real-time smoke rendering inside Unity.
That report will cover volumetric smoke, optical density, opening flow visualization, particle systems, and rendering performance optimization.
References
About the Project
SOKYU: OPERATION RESCUE BLAZE SERIES
An independently developed firefighting and disaster response game combining:
- Fire simulation
- Unity game development
- Scientific computing
- Real-time computer graphics
- Embedded systems
- Robotics
- Artificial intelligence
Developed by Motomachi Digital Making Lab, Yokohama, Japan.
Project Technical Website:
https://ronsard.sakura.ne.jp/sokyu/cfast-guide.html
CFAST × Unity Development Report #2
November 26, 2026
Top comments (0)