Treez (Base Game Fork)

by Sudain

Tree-seed placing is blue-print compatible and with robots and slow growth mechanics. Originally a fork of treez by idisssnakes (https://mods.factorio.com/mod/treez).

Tweaks
19 hours ago
2.0
135
Environment

Changelog

Version: 1.20.5
Date: 2026-07-10
  Bugfixes:
    - Fixed a crash when planting seeds with space age enabled.
Version: 1.20.2
Date: 2026-07-02
  Changes:
    - Restored the original "Treez (Base Game)" mod title so the mod list shows this fork's original branding instead of the generic "Treez".
Version: 1.20.1
Date: 2026-07-02
  Changes:
    - Complete backend rewrite. The growth engine, queue system, and all internal storage structures have been rebuilt from scratch. The priority goal of this release was UPS efficiency; feature parity with 1.x was deliberately sacrificed to achieve it.
    - Tree growth now uses a dual-queue architecture: a depth queue keeps the first M trees advancing as fast as possible, while a breadth queue spreads one stage advance per remaining tree across each daylight period. M scales with Sapling Growth research level.
    - Growth only occurs during daylight hours. Each surface tracks its own day/night cycle independently so modded surfaces behave correctly.
    - All C++ boundary crossings in the tick handler are now cached. Surface constants (evening, morning, ticks_per_day, platform flag) are read once per surface per game session. Rain state is cached for 300 ticks. Chunk pollution is cached for 3600 ticks. Research state is cached in storage and only recomputed on research events.
    - The tick handler now iterates only surfaces that have active growing trees, not all game surfaces. Surfaces are removed from tracking automatically when their queue empties, so UPS scales with active work rather than world size.
    - Trees marked for deconstruction by a player or robot now pause at their current growth stage rather than advancing through it. The deconstruction mark is preserved when the stage entity is replaced.
    - Biome-aware species selection: trees planted by seed or cloud seeding are chosen based on nearby species and native biome data. Native species receive a weighted preference over non-native ones.
    - Growth is blocked stochastically by chunk pollution. Higher pollution in the chunk increases the chance a growth tick is skipped.
    - 200 growth stages are generated per species (up from fewer in 1.x). Sprites scale on a square-root curve from 5% to 100%; collision boxes scale linearly from 20% to 100%.
    - Dead trees and stumps are excluded from stage generation. They will no longer appear as valid species for new plantings.
  Features:
    - Cloud Seeding technology chain (6 levels, requires Arboreal Agriculture). When Dynamic Rain is installed, rain events scatter tree seeds in pollution-cleaned chunks. Seed count scales with Cloud Seeding research level.
    - Dynamic Rain integration: rain growth boost (halves the per-stage tick delay during active rainfall), storm detection with per-surface per-storm deduplication, and a 300-tick rain state cache.
    - Space Exploration compatibility: Arboreal Agriculture requires the SE Rocket Science Pack technology as a prerequisite when SE is installed. Cloud seeding technologies include SE Rocket Science Pack as a research ingredient.
    - Krastorio 2 compatibility: K2 injects its basic tech card into any technology with a single automation science pack ingredient. The data-final-fixes stage strips this injection from the Sapling Growth chain and Cloud Seeding chain.
    - AAI Industry compatibility: Sapling Growth 1 gates on the AAI-adjusted automation prerequisite when AAI is installed.
    - Space Age compatibility: Cloud Seeding technologies include the Space Science Pack ingredient when Space Age is installed.
    - /treez diagnostic command shows per-surface queue depth, growth stage distribution, day/night state, and rain state.
    - Rain debug, rain growth boost, and rain seed enabled settings (shown only when Dynamic Rain is installed).
  Optimizations:
    - Replaced on_tick with on_nth_tick(10) for the main growth handler.
    - Surface day/night constants cached in module-level tables; only surface.daytime is read live each tick.
    - remote.interfaces availability check for Dynamic Rain cached as a module-level boolean after the first call.
    - storage.tree_growth_researched latch eliminates 3 C++ technology lookups on every tree-mined event once Tree Growth is researched.
  Removed:
    - Nitrate / soil crystal system removed entirely. This system will be re-implemented as a separate companion mod. Soil crystal (white and black) items, recipes, entities, and technologies are not present in this release. Any nitrate pellets placed in the world by a previous version of the mod will be lost when upgrading.
    - Sapling soil enrichment (tile upgrading as trees grow) is not implemented in this release.
    - Tree Seeder area selection tool is not implemented in this release.
    - Foreign tree and ghost sweep is not implemented in this release.
    - Restorative Rains (rain-placed nitrate pellets) is not implemented in this release. The cloud seeding system (seed scattering during rain) is implemented.
    - Winter Is Coming and TerrainEvolution2 integrations are not implemented in this release.
    - Script-raised build compatibility (/treez fix-sites, script_raised_revive handler) is not implemented in this release.
  Migration:
    - Saves from version 1.1.x or earlier: any tree-seed-site or seed-waiting entities that were placed but not yet fulfilled will likely be lost. Active growing trees that had reached stage 1 or later are migrated to the new queue format where possible.
    - Saves from version 1.1.x or earlier: all soil crystal and nitrate pellet entities will be lost. There is no migration path for these; the entire system has been removed.
    - The internal storage schema has changed completely. The mod will attempt to migrate the growing-tree list from the old flat storage.growing format on first load. Any entries that reference invalid or missing entities will be dropped silently.
Version: 1.1.6
Date: 2025-01-01
  Changes:
    - Final release of the 1.1.x series before the 1.2.0 backend rewrite.