Archived legacy rasterized real-time flame graphic generation, written in 2000 using Smalltalk-80 on the Squeak platform.
[](https://github.com/redgreenshift/FireDemo/blob/main/README.md)
# Flames.st
[](https://squeak.org/)
[](https://en.wikipedia.org/wiki/Smalltalk)
[](LICENSE)
An archived Squeak/Smalltalk change demonstrating the real-time generation of flame graphics.
`Flames.st` is a self-contained collection of Smalltalk code written in Smalltalk-80 for the [Squeak](https://squeak.org/) platform. Squeak is a _dialect_ of the [Smalltalk-80 programming language](https://wiki.squeak.org/squeak/373).
## Algorithm
The flame effect is based on a simple cellular-automaton-style algorithm:
1. Seed the bottom edge of a grid with random "hot coal" values.
1. For each pixel, average its value with the three pixels directly below it:
```text
. . .
. 5 .
1 2 3
```
1. Apply a cooling factor to the averaged value.
1. Repeat the process continuously to produce the rising flame effect.
Despite its simplicity, this process creates a convincing real-time flame animation.
## Project History
In 2000, I wrote this prototype after someone said, "Smalltalk is too slow for real-time fire generation," and I just had to prove them wrong.
I liked the result, even with plain constant cooling. The palette isn't great, but it demonstrates that real-time fire is possible in Smalltalk.
Rendered in blue, it really reminds me of the flame from a propane grill that I watched as a child while my dad cooked burgers.
It is preserved as an example of exploratory programming written in Smalltalk-80 and is **not under active development**. It may require modifications to work with current Squeak versions.
## Related Projects
### Successor Projects
[`FireDemo`](https://github.com/redgreenshift/firedemo) is the direct successor to `Flames.st`.
It expanded this prototype into a broader real-time lighting-effects playground
including fire, lightning, and plasma.
## Credits
The basic high-level flame-generation algorithm was inspired by code attributed to Evan Jones.
This implementation is not a port of the original code. None of that code is included here, and I have not been able to locate it. The pixel neighborhood, cooling behavior, and color palette were developed independently through experimentation.
A note identifying Evan Jones as the source of the algorithmic inspiration was preserved in the `Flames.st` Smalltalk prototype, so credit is given for the basic algorithmic concept.