Dynamic object editor

Dynamic Tree

Dynamic Tree creates procedural trees, bushes and vines inside the Ancient Machines editor. The generator bakes branches, bark texture, and foliage into one texture while preserving the full setting data for save, load, and export.

What it is

A procedural tree object for the level editor

Dynamic Tree is a generated object type registered as dynamic_tree. It appears in the dynamic object library and opens its own Object Settings controls when selected.

Generated Visual

The editor generates a full tree or bush from sliders, draws the result into a Starling RenderTexture, then uses that baked texture as the visible object.

Editable Data

All generator settings live in dynamicTreeData, so a saved level can load the exact same tree configuration and redraw it later.

Scene Object Friendly

A Dynamic Tree can be used as a decorative scene object or as an object with a simple physics body, while the generated art keeps its own tree shape.

Texture Support

Branches can be plain colored strokes or use the same grouped stroke texture picker used by physics-line skins, including bevel, scale, compression, and flip controls.

Generation modes

Tree mode and bush mode

The same generator can create a single trunk tree or a bush made from several main stems.

Tree

Tree mode starts with one trunk at level 0. The trunk can continue through leading branch segments, while side branches start from the selected branch levels.

Bush

Bush mode uses level 0 as the main bush branch level. Several main stems spread across the base width, then each stem uses the same branch and leaf systems as a tree.

Regenerate Skeleton

Regenerate Skeleton redraws the structure from the current seed and branch rules. Change Seed first when you want a different deterministic tree layout.

Seed

Seed makes the generated layout deterministic. Use it to find a good structure, then tune branch and leaf controls without losing the overall tree identity.

Global structure controls

Controls that define the whole object

These controls sit at the top of the Dynamic Tree settings panel and decide the broad shape before level-specific tuning starts.

Generation Type

Switches between Tree and Bush. Tree uses one trunk; Bush spreads multiple main stems from the base.

Regenerate Skeleton

Redraws the structure from the current seed and branch rules. Change Seed first when branch placement itself should change.

Seed

Controls deterministic random generation. Different seeds produce different branch skeletons and visual variations.

Canopy Shape Vertical

Bends the global crown vertically by affecting branch angles as depth increases. It can make the crown feel taller, flatter, raised, or drooping.

Bush Base Width

Only matters in Bush mode. It controls how far the main bush stems spread horizontally from the base.

Per-level controls

Selected Branch Level settings

Branch levels run from 0 to 7. A branch can continue through several depths, but level settings describe where that branch starts. Branch Tip Thickness At Level therefore controls the final tip of branches that start on that level, even if the branch visually continues to a deeper depth.

Apply To All Levels

Writes compatible per-level changes into every level instead of only the selected branch level.

Selected Branch Level

Selects which level's branch settings are visible and editable.

Max Children At Level

Controls the maximum number of child branches that can start from branches on this level.

Branch Layout At Level

Chooses Random, Alternating, or Bagrem Parallel layout for side branches on the selected level.

Canopy Shape Horizontal At Level

Shifts the selected level's branch angle balance horizontally, useful for crown asymmetry or directional growth.

Use Fixed Branch Angle

Uses a fixed angle instead of canopy spread calculation for children at this level.

Fixed Branch Angle

When fixed angle is enabled, this angle is applied from the parent tangent to the child side.

Canopy Spread Angle

Controls how far child branches can spread away from the parent when fixed angle is off.

Branch Angle Randomness At Level

Adds controlled random drift to child branch angles on this level.

Leading Branch Max Depth

Controls how many additional depth steps the first child can continue as the leading branch. This creates natural trunk and branch continuation.

Branch Length Scale At Level

Scales the length of branches that start on the selected level.

Branch Tip Thickness At Level

Sets the final tip thickness for branches that start on this level. The taper is distributed over the whole leading chain until the real visual tip.

Visual Angle Randomness At Level

Adds visual-only angle variation after the structural branch angle is chosen.

Branch Sway At Level

Adds small left/right sway to branches on this level.

Horizontal Shift At Level

Biases branches horizontally, useful for leaning crowns or wind-shaped silhouettes.

Length Randomness At Level %

Controls how much the selected level's branch length can vary around its base scale.

Branch Start Position At Level

Controls where side branches begin along their parent branch, from base to tip.

Branch Start Randomness At Level

Allows the branch start position to vary around the selected branch start value.

Branch Probability At Level

Controls how likely potential child branches are to appear.

Branch Arc At Level

Curves branches from this level. A value of 0 draws straight branches; higher values create quadratic curve arcs.

Leaf Amount At Level

Multiplies how much foliage appears on branches at this level.

Leaf Size Randomness At Level

Adds level-specific variation to broadleaf size and needle length.

Global branch controls

Branch shape, color, and texture

These controls affect the whole tree or bush, independent of the currently selected branch level. Branch count, layout, angle spread, arc, per-level length scale, and per-level randomness are controlled in the Selected Branch Level section.

Branch Levels

Controls the maximum recursive depth used by the tree.

Branch Base Length

Base length used before recursive and per-level scale factors.

Branch Recursive Scale

Scales branch length as depth increases.

Branch Color

Tints the branch stroke when branches are drawn with plain color or with a stroke texture.

Branch Alpha

Controls branch transparency.

Enable Branch Texture

Turns branch stroke texture drawing on or off.

Use Branch Bevel Texture

Requests the bevel-capable version of the selected branch texture when available.

Branch Texture Type

Uses the same grouped stroke texture library as other line-based tools.

Branch Texture Scale

Changes how large the stroke texture pattern appears on branches.

Branch Texture Compression

Compresses or stretches the stroke texture along the branch path.

Branch Texture Flip Vertical

Mirrors the branch texture vertically.

Branch Texture Flip Horizontal

Mirrors the branch texture horizontally.

Branch Bend Horizontal

Globally bends branches left or right.

Visual Length Ratio Scale

Global parent-to-child branch length ratio.

Visual Thickness Ratio Scale

Controls how thick child branches are compared with their parent branch's stable logical thickness.

Visual Initial Thickness

Initial trunk thickness in Tree mode, or main stem thickness in Bush mode.

Foliage controls

Leaf types, layouts, colors, and whorls

Leaves are generated after branches, so foliage appears on top of wood. The leaf system supports broad leaves, circles, single needles, alternate pine needles, Bagrem pairs, and whorl clusters.

Leaf Type

Chooses Normal Ellipse, Needle, or Circle drawing.

Leaf Layout

Chooses Random, Bagrem Parallel, Pine Needles, or Pine Whorls placement.

Leaf Color

Primary foliage color used by generated leaves.

Use Leaf Second Color

Adds the second foliage color to the random leaf color palette.

Leaf Second Color

Second foliage color available when enabled.

Use Leaf Third Color

Adds the third foliage color to the random leaf color palette.

Leaf Third Color

Third foliage color available when enabled.

Leaf Alpha

Controls leaf transparency.

Leaf Angle

Base angle used for leaves and needles relative to the branch tangent.

Leaf Amount

Global foliage amount multiplier. Combine it with Leaf Amount At Level for level-specific density.

Leaf Base Width

Base width for ellipse and circle leaves.

Leaf Base Height

Base height for ellipse and circle leaves. Needle length is controlled by Leaf Length.

Leaf Size Scale

Global multiplier for leaf size.

Leaf Size Randomness %

Global random variation in broadleaf size and needle length.

Leaf Length

Base length for needle leaves.

Leaf Length Randomness %

Random variation for needle length.

Leaf Thickness

Stroke thickness used by needle leaves.

Whorl Slots

Number of positions used for Pine Whorls.

Whorl Min Leaf Count

Minimum number of needles generated from each whorl position.

Whorl Max Leaf Count

Maximum number of needles generated from each whorl position.

Whorl Spread Angle

Fan angle used by Pine Whorls. It is only active when the whorled leaf layout is selected.

Renderer behavior

How the tree is drawn

The AS3 renderer follows the original generator idea but draws directly into the game's Starling rendering system.

Bounds First

The renderer walks the same generated branches and leaves before baking so the texture grows around the real tree bounds instead of clipping long branches or wide needle clusters.

Branch Pass

Branches are drawn first as sampled quadratic curves. Each sampled segment uses lineTo(), allowing dynamic thickness change along the stroke.

Leaf Pass

Leaves are drawn after branches. Leaf points use the branch curve position and tangent so foliage follows straight and curved branches correctly.

Tip Thickness

Branch tip thickness is calculated across the complete leading branch chain. A setting on level 1 affects the tips of branches that start on level 1, even if those branches visually continue deeper.

Line Thickness Change

Starling changes stroke thickness per lineTo() call. Dynamic Tree therefore calculates the change ratio from the total number of generated line segments to make the final tip land on the requested thickness.

Physics Body

For a tree with physics, the collision skeleton follows the main trunk and first-level side limbs, including their leading continuations. Leaves, fruit and secondary side branches are visual detail.

Save and load

DynamicTreeData and persistence

The generated texture is recreated from data. The level stores the settings, not a flattened bitmap-only result.

Stored JSON Field

dynamicTreeData is stored with the object, following the same pattern used by other custom JSON fields such as physics-line and special visual object data.

Level Settings Array

Per-level values are stored in levelSettings, one object per branch level from 0 to 7.

Dimensions In Meters

UI dimensions are stored in physics meters and converted to pixels only while drawing. The baked render width and height are updated from the generated texture bounds.

Runtime Recreation

When the level loads, the display factory reads dynamicTreeData, recreates the Dynamic Tree display object, draws the tree, and uses the baked texture in the scene.

Practical setups

Useful Dynamic Tree recipes

These setups are a quick way to get predictable results while authoring a level.

Clean Broadleaf Tree

Use Tree mode, moderate Branch Levels, Random leaf layout, ellipse leaves, and a small amount of level angle randomness. Keep Branch Arc low for a readable silhouette.

Stylized Bush

Use Bush mode, raise Bush Base Width, reduce leading depth, and give level 0 several main branches. Use Leaf Amount At Level to control how dense the bush becomes.

Pine Needles

Choose Needle leaf type and Pine Needles layout. Increase Leaf Length and Leaf Amount, then use level leaf amount to avoid needles on lower structural branches.

Pine Whorls

Choose Pine Whorls layout. Tune Whorl Slots, Whorl Min Leaf Count, Whorl Max Leaf Count, and Whorl Spread Angle to create clustered needle fans.

Bagrem Style Leaves

Use Bagrem Parallel leaf layout with ellipse leaves. Each point on the branch gets a left/right pair, creating a clean paired-leaf look.

Textured Bark

Enable Branch Texture, choose a bark-like stroke texture, then adjust Texture Scale and Compression until the grain reads well on both trunk and small branches.

Creator guide

Physical trunks and branches

Use these options alongside the controls described above.

Wood-shaped collision

When a Dynamic Tree has physics, its body follows the trunk and first-level side limbs, including their leading continuations.

Leaves and fruit

Leaves, fruit and finer secondary branches remain visual detail. Do not rely on them as solid platforms.

Bush and vine forms

Bush generation uses several stems. Supported vine forms use the same root-chain approach for their physical wood.

Scene decoration

Use scene layers when the tree is decorative, or enable the supported physics setup when it should act as part of a puzzle.

Creator guide

Vines, leaf artwork, fruit and flowers

Use the expanded generation options to create hanging vines, canopies, curtains and decorated plants.

Expanded Dynamic Tree controls

Expanded Dynamic Tree controls options
OptionWhat it does
Generation Type / VineChoose Tree, Bush or Vine. Vine exposes its own mode, direction and strand controls.
Vine ModeChoose Single, Branching, Canopy, Curtain or Bush for the desired vine layout.
Vine DirectionChoose Up or Down growth.
Vine Constant ThicknessSet the constant thickness used by vine branches.
Vine Waviness Amplitude At LevelTune the size of the bends for the selected branch level.
Vine Waviness Count At LevelTune how many waves appear along branches at the selected level.
Vine Leaf Stem Length At LevelSet the leaf stem length for the selected level.
Vine Spread WidthSet the spread of supported vine layouts.
Vine Curtain HeightSet the height of a curtain layout.
Vine Root CountChoose how many roots the supported vine layout uses.
Vine Curtain Strands / Vine Curtain Padding (m)Set strand count and the spacing used by the curtain layout.
Draw Real Leaf / Real Leaf TypeUse leaf artwork and select its type rather than relying only on simple generated foliage.
Leaf Stem Offset / Leaf Stem AngleTune how leaves are attached to their stems.
Enable Fruit / FlowersAdd fruit or flower artwork to the generated structure.
Fruit / Flower TypeChoose the fruit or flower artwork.
Fruit / Flower Scale / Scale Randomness %Set the size of the fruit or flower and its size variation.
Fruit / Flower Density %Tune how densely the fruit or flowers appear.
Fruit / Flower Branch LevelsChoose the branch levels on which fruit or flowers can appear.
Fruit / Flower Rotation Offset / OrientationTune the orientation and additional rotation of the artwork.