Skip to content

feat: add SMOKE material and update related logic in archetypes and systems#19

Merged
VoX merged 1 commit into
mainfrom
develop
Feb 13, 2026
Merged

feat: add SMOKE material and update related logic in archetypes and systems#19
VoX merged 1 commit into
mainfrom
develop

Conversation

@VoX

@VoX VoX commented Feb 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 13, 2026 19:34
@VoX VoX enabled auto-merge February 13, 2026 19:34
@VoX VoX merged commit 867d8ae into main Feb 13, 2026
8 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new SMOKE particle/material to the simulation and adjusts related rising/fire behaviors, while also tuning a few fluid/fire interactions for performance/behavior.

Changes:

  • Introduces SMOKE as a new particle ID, color entry, and archetype.
  • Updates rising-system logic so fire can produce smoke and smoke behaves like gas (shared rising logic); adds additional fire drift/chaos behavior and tweaks cloud water spawning.
  • Tweaks liquid lateral spread scaling and makes water’s fire-extinguish pass probabilistic to reduce overhead.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/sim/systems/rising.ts Adds SMOKE handling in rising physics; adjusts fire movement and cloud water spawning behavior.
src/sim/systems/liquid.ts Tunes hydrostatic pressure cap and lateral spread range.
src/sim/systems/falling.ts Makes water extinguishing adjacent fire probabilistic to reduce per-tick work.
src/sim/constants.ts Adds SMOKE numeric ID and a color entry.
src/sim/archetypes.ts Adds SMOKE archetype; adjusts CLOUD archetype properties.
Comments suppressed due to low confidence (1)

src/sim/constants.ts:25

  • SMOKE was added as a new type ID, but the Material union and MATERIAL_TO_ID mapping are not updated to include a 'smoke' entry. This makes the constants/API inconsistent and prevents smoke from being representable via the material/tool typing and ID lookup (e.g., worker input painting). Add 'smoke' to Material and map it to SMOKE in MATERIAL_TO_ID (and keep any UI/tool lists in sync).
export const SMOKE = 68

export type Material = 'empty' | 'sand' | 'water' | 'dirt' | 'stone' | 'plant' | 'fire' | 'gas' | 'fluff' | 'bug' | 'plasma' | 'nitro' | 'glass' | 'lightning' | 'slime' | 'ant' | 'alien' | 'quark' | 'crystal' | 'ember' | 'static' | 'bird' | 'gunpowder' | 'tap' | 'anthill' | 'bee' | 'flower' | 'hive' | 'honey' | 'nest' | 'gun' | 'cloud' | 'acid' | 'lava' | 'snow' | 'volcano' | 'mold' | 'mercury' | 'void' | 'seed' | 'rust' | 'spore' | 'algae' | 'poison' | 'dust' | 'firework' | 'bubble' | 'glitter' | 'star' | 'comet' | 'blackhole' | 'firefly' | 'worm' | 'fairy' | 'fish' | 'moth' | 'vent'

export const MATERIAL_TO_ID: Record<Material, number> = {
  empty: EMPTY, sand: SAND, water: WATER, dirt: DIRT, stone: STONE, plant: PLANT,
  fire: FIRE, gas: GAS, fluff: FLUFF, bug: BUG, plasma: PLASMA,
  nitro: NITRO, glass: GLASS, lightning: LIGHTNING, slime: SLIME, ant: ANT, alien: ALIEN, quark: QUARK,

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sim/archetypes.ts
Comment thread src/sim/systems/rising.ts
if (y < rows - 1 && rand() < 0.013) {
const sdx = Math.floor(rand() * 3) - 1
const snx = x + sdx
if (snx >= 0 && snx < cols && g[idx(snx, y + 1)] === EMPTY) g[idx(snx, y + 1)] = WATER

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cloud water spawning writes directly into g[idx(snx, y + 1)] but doesn't wake/mark the destination chunk. Since ChunkMap.updateActivity() only recomputes checksums for currently-active chunks, spawning into a sleeping chunk can leave the new WATER unrendered and unprocessed until something else wakes that chunk. Consider passing chunkMap into this handler (or using a helper like simSetCell) to wakeChunk/mark dirty for the destination cell’s chunk when spawning water (especially now that spawning can be diagonal into neighboring chunk columns).

Suggested change
if (snx >= 0 && snx < cols && g[idx(snx, y + 1)] === EMPTY) g[idx(snx, y + 1)] = WATER
if (snx >= 0 && snx < cols) {
const d = idx(snx, y + 1)
if (g[d] === EMPTY) {
g[d] = WATER
stampGrid[d] = tickParity
}
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants