Repository navigation
Version 4.1.0
·
31 commits
to master
since this release
4.1.0
Bonfire 4.1 brings a complete lighting system: cutout and additive lights,
gradient falloffs, pulse and candle-like flicker, shadow casting with occluders,
quality and debug helpers, and day/night presets. Occluders can be declared in
Tiled following the same pattern used by collision, and a layer/object can be a
collision and an occluder at the same time.
LightingConfig keeps its previous defaults, so existing lights keep working as
before; the behaviour changes are listed under Fixed.
4.1 also ships Agent Skills with the package, so AI coding agents write code
against the installed version instead of guessing from 3.x.
Lighting
Added
LightingMode.additivedraws emissive lights (torches, magic, explosions) on
top of the scene, even when no ambient darkness is configured.LightingApi.animateTo(config, duration, curve)transitions the radius,
color, blur and alignment of a light smoothly.gameRef.lighting.fadeIn(color)/fadeOut()animate the ambient light.LightFalloff.linearandLightFalloff.smoothrender the light edge with a
radial gradient instead ofMaskFilter.blur, with a configurable
innerRadius(full-intensity core).intensitymultiplies the light color alpha andadditiveBlendModeallows
BlendMode.screenand others on additive lights.LightFlickeradds a deterministic candle-like variation to radius and
intensity.LightSourcewithgameRef.lighting.addLight(...)/removeLight(...)allows
lights that are not attached to any component (explosions, muzzle flashes,
ambient details).LightingType.rect(size)andLightingType.polygon(points)add rectangular
and polygonal lights. WithuseComponentAngle: truethey rotate with the
component.- Shadow casting:
LightingConfig.castShadowsclips a light with the registered
LightingOccluders. Add static geometry with
gameRef.lighting.addOccluder(...)/removeOccluder(...)or moving obstacles
with theWithLightingOcclusionmixin. LightingQuality(low,medium,high) controls how many rays are cast
per light when computing the shadow silhouette (24,64,160).gameRef.lighting.debugdraws the light shapes, the shadow clip and the
occluders, to debug lights that are not reaching somewhere.LightingPreset(day,dusk,night,dungeon) withapply(...)fades
the ambient color for the common day/night setups.- Tiled integration:
WorldMapByTilednow registersLightingOccluders
declared in Tiled. Tile layers and objects with thelighting_occluder
class become occluders; occluder tile layers are not rendered and adjacent
tiles are merged into rectangles. Object layers and objects can declare
several roles separated by commas (e.g.collision,lighting_occluder), so
the same wall blocks movement and light without being duplicated in the map.
The combination is not supported on tile layers, where collisions come from
the tileset.
Fixed
gameRef.lightingandgameRef.colorFilterno longer throw
Bad state: No elementwhen read from another component'sonLoad
(for instanceWorldMapByTiledregistering Tiled occluders). Flame empties
the viewport children while mounting the tree, so the layers are now
resolved once in theBonfireGameconstructor.LightingConfig.copyWithnow preservesalign(it used to reset it to zero)
and acceptsalign,mode,falloff,innerRadius,intensity,
additiveBlendModeandflicker.PulseValuenow honorspulseCurve, never exceedspulseVariationand keeps
the previous pulse timing.- Arc lights now respect
radiusinstead of being drawn with twice the
configured radius, so switching betweenarcandcirclelights keeps the
same coverage. - Arc lights with
isCenter: trueare now centered on the component angle even
whenstartRadAngleis not zero (the start angle was being ignored). - Additive lights are now composited below the ambient darkness, so the ambient
color darkens them instead of the light being painted over the night color. - Lights follow the camera transform, staying aligned when the camera is rotated
or uses a custom anchor. - Arc lights rotate around the component absolute center.
blurBorder: 0now produces a crisp edge instead of an invalid blur.- Pulse updates no longer depend on rendering and
LightingComponent.updatenow
callssuper.update(dt).
Agent Skills
Added
- The package now ships Agent Skills in
skills/: prescriptive guides for AI coding agents covering getting started,
player, enemy AI, collisions/sensors, maps, decorations/effects, dialogs/HUD
and the 4.x API-object reference. Install them in a game project with
dart run skills@ get(or--all). Seedocs/ai-skills.mdx.