Part II · Artifacts & accessories
Evolution: how its results are chosen—and why they are predictable
Candidate lists, planting order, and previews determine a reproducible sequence.
7 min read
In this chapter
Evolution's choices follow a reproducible shuffle sequence. In the recorded checks, the same starting conditions produced the same results, and predictions fixed before play matched subsequent checks. The candidate list, planting order, and previews explain how that happens.
Catalog counts in this article are those of build 4.2.4.399, and counts captured in 4.2.2 are marked as such. The calculator uses the 4.2.4 plant data, which the reference implementation built from the Android package and which matches the iOS 4.2.4.399 declarations.
A repeatable sequence behind the choice
The picker builds an ordered candidate list, shuffles the whole list, and takes its first plant. It uses the library's two-argument std:, backed by an mt19937 engine starting from seed 5489. Captured raw outputs and full permutations replay from that state.11The separate libc++ shuffle streamThe imported __rs_get and __rs_default symbols identify two-argument std::random_shuffle. Its forward permutation uses uniform_int_distribution with rejection. Live PlayCover captures record raw outputs matching mt19937 seed 5489, complete permutations and selections; the host-library probe is separate evidence. Recorded iPad outcomes corroborate specified routes without identifying the loaded iPad library. Evolution and Modern portals share this library stream.0x1009a92800x1001210440x10001bf38
The engine belongs to the process. A full game restart returns it to its initial sequence. Earlier shuffles advance it, including the Evolution previews on the artifact screen. Entering a level can advance it as well: a level whose wave list includes gravestone-spawning wave actions shuffles each action's bag of gravestones once on the same engine as it loads, in wave order, and the calculator's level descriptions carry those bag sizes.22Level entry shuffles the gravestone bagsIn the 4.2.4 executable, loading a level builds each gravestone-spawning wave action its wave list references, in wave order, and runs the library shuffle on a vector holding every pool entry Count times, on the same engine as the artifact. Three fresh-launch captures matched exactly: Dark Ages 21 (bags of 10, 10, 10) consumed 42 outputs from offset 0; Dark Ages 19 (bags of 3, 6, 3) consumed 10 outputs from offset 0 and 9 after two previews; an earlier Dark Ages 4 capture (bags of 3, 3, 4) consumed 8. An alias declared twice resolves to its first declaration, and an action no wave references builds nothing. Every selection after those entries, including a Draftodil row shuffle over 4 objects, matched the model. Whether restarting such a level repeats the shuffles was not measured.0x101bc92fc0x1004009d0 Levels without such actions did not advance or reset the engine at entry or on restart in the recorded checks, so the documented direct-entry routes begin at the state reached after the previews and any entry shuffles.33Captured preview structures and consumptionThe original 4.2.2 cost-50 rank-1 capture records nine 226-entry shuffles and 2,874 outputs from offset 0. Two later 4.2.2 display-board captures at cost 47 retain 153 selections and 36,152 outputs, including two Draftodil row shuffles and the add order. One records a fresh-launch mixed route; the other begins at previews 10–11 after nine reported previews, whose starting offset is reconstructed. Played checks distinguish bare pads from plant objects and confirm rejected values in a row shuffle. Level entry and restart consumed no library outputs on the measured routes in levels without gravestone-spawning wave actions; note 25 covers the levels that have them.0x1009a73800x1009a92800x1009a7138
A pseudorandom algorithm can be useful without exposing a predictable sequence. Here, the fixed starting state and shared preview history make the recorded outcomes reproducible in advance. The problem is more specific than occasionally seeing the same plant twice.
Predict a result or find a setup →
Each source has its own candidate list
The registry order matters. Configured names in Plant come first, followed by the remaining types in the observed fresh-load order. Shuffling the same plants in declaration order can select a different result, even with identical random outputs.44Registry order and live registration orderThe registry rebuild appends configured PlantTypeOrder names, then remaining weak handles in unsigned handle order. In the captured 4.2.2 fresh loads that tail matches declaration order; all 360 enabled entries match. The live-slot allocator inserts at the head and the snapshot walks forward. Reversing freshly planted sources changed target traversal prospectively. Movement, deletion and restoration need their own registration history.0x1000feec00x100100cd40x1036733f80x1036730300x1009a6b5c
Seven catalog filters leave 259 of the 385 plant definitions. They remove disabled types, explicit aliases, vine classes, hero types, parallel_ types, consumables, and the artifact's result blacklist. The stage rule, level seed-bank bans, and the source cell's planting checks narrow the list further.55Seven catalog filtersThe Enabled default is true. Enabled, four literal aliases, four overriding plant classes, HeroProperties, the parallel_ prefix, IsConsumable, and plantBlackList reduce the 385 definitions to 259. The exported projection retains the input fields. Cost, stage eligibility, and per-tile planting checks further restrict the result. The stage virtual has a Lily Pad override.0x1009a66400x1009a8b48
The price test compares two different quantities:
The source's effective price can include level adjustments, discounts, and a zero lower bound. The candidate uses its declared Cost. A discounted source can therefore produce a plant with a lower listed price than its own original listed price. At effective cost 500 or above, the filtered catalog has no more expensive candidate; the source remains unchanged.66Effective source cost versus declared candidate costThe source calls PlantType virtual +0x70 with arguments -2 and 0. Its base path applies mode prices, level deltas, discounts, multipliers, and a zero clamp. Candidates read the raw Cost field and require Cost > source cost. The filtered catalog maximum is 500; its three entries are wintermelon, banana, and cobcannon. An empty result returns a null handle and the driver creates no removal effect.0x1009a88380x10183629c0x1009a8d840x1009a8f18
In the calculator, each starting plant carries its effective sun cost. Wanted plants need none, because candidates are compared by their declared cost. Starting plants whose effective costs lie between the same two candidate costs share one candidate pool, so the search treats them as one option. Plants in other cost bands give it more options, including bands above a target's cost: their pools cannot produce the target, but they advance the sequence by different amounts. The search tries preview routes from the shortest. When it has checked every route within its limit without finding a recipe, and its memory guard stopped nothing, no setup exists for those routes and starting plants.
The cell also matters. In the Memory Lane configuration captured in 4.2.2, at effective source cost 0:
These are counts for that level and cost. The dry shore admits Lily Pad; a plant standing on a pad uses the pad restrictions whether the shore is dry or flooded. Those restrictions exclude Cactus. The flooded pool without a pad matches the declared CanLive flag in that capture. Equipped water or sky boosts can change the latter rule. Cob Cannon and Intensive Carrot have additional board prerequisites, so their exclusion in a fresh ordinary setup is not a universal ban.77Measured cell pools and the flooded-cell ruleCandidate lists were captured before the shuffle. Ground, shore, pad and plank rules are measured effects under the recorded setups, not complete reconstructions of every planting predicate. Separate Beach checks over dry shore and water produced identical pad pools at cost 0. Cactus appeared in the ground pools and was absent on pads; the earlier Memory Lane level had already banned Cactus, so it could not establish pad eligibility. The flooded rule admits CanLiveOnWaves, accessory boost 17 or 40, or supported cell objects. The captured unboosted pool follows the declared flag. Cob Cannon requires adjacent Kernel-pults; Intensive Carrot requires a valid revival record.0x1015976180x1013cd58c0x101afc2380x1020c1170
Planting order connects draws to cells
The active skill collects eligible plants overlapping its 3×3 area. Newly registered plant objects are inserted at the head of the live list, which the target query walks forwards. For freshly planted sources, the newest plant is therefore processed first.4
Reversing the planting order in the recorded Egypt 13 trial reversed which cells received the selections. This is registration order, not a fixed scan from one corner of the board. Moving or restoring an existing plant requires its actual registration history.
Each processed source consumes the complete shuffle for its own candidate list. Changing a cost or cell condition can change the list length, the result, and the stream position inherited by later sources. An empty list leaves the source in place without consuming shuffle outputs.
Previews advance the same stream
A preview runs the same activation on the artifact screen’s display board, centered at 4-2. Rank 1 starts with nine Sunflowers in columns 3–5 and rows 1–3. Their effective sun cost matters: in the captured 4.2.2 data, cost 50 gives a 226-entry evolution pool and 2,874 outputs for the first preview; cost 47 gives 243 candidates and 3,115 outputs. Set the preview Sunflower cost separately from in-level source costs in the calculator.3
Rank 4 starts with three Sunflowers in column 3. It evolves them newest first, selects a Lily Pad beneath each, and selects six spawns in columns 4–5, down each column. The captured 4.2.2 spawn pool has 55 entries; a single-candidate pad selection consumes no outputs. Placements run in reverse selection order. A pad can reject its selected replacement, leaving a bare pad. The later display-board captures record these cells and the plant-add order.
Placing a Draftodil also shuffles the plant objects in its row using the shared engine. The count excludes Lily Pads, includes the Draftodil itself, and reflects the sources already removed and plants already placed. Rejection sampling can consume extra outputs, so the calculator replays this shuffle rather than adding a fixed adjustment. A preview’s end includes these effects; an in-level activation’s reported end covers its selections only, because subsequent effects and other events need the rest of the level state.3
Recorded prospective checks cover a reversed Egypt 13 planting order, preview routes in Egypt 8, requested results in Memory Lane and Penny's Pursuit, and a mixed rank-1/rank-4 preview sequence. The records distinguish captured selections from reported outcomes; confirming a requested plant does not establish every unrecorded cell.88What the prospective checks confirmThe reversed Egypt 13 planting trial was predicted before play and instrumented. Saved forecasts for Egypt 8, Memory Lane and Penny’s Pursuit were subsequently reported matched; the retained claims concern the requested cells. The mixed rank-1/rank-4 preview forecast was also reported matched. These are distinct from retrospective replay, and do not establish arbitrary routes, Android, or higher-rank in-level activations.0x1009a8b480x1009a9280
The pvzreport/evolution-artifact repository provides the reference implementation, level inputs, and recorded candidate-list fixtures. The web calculator offers rank-1 and rank-4 prediction and setup search, ordered preview routes, candidate inspection, all 16 upstream level presets, and the Terror from Tomorrow preset. Setup search plans the previews run after a full restart in one of three route styles, continuing any previews already done, and returns the shortest route, then the fewest planted sources. A custom level description can supply the stage, dimensions, cell conditions, seed-bank restrictions and the gravestone bags shuffled at entry. Reproducing a calculation also requires the stated preview history and effective source costs.
Choosing a result and replacing a plant are separate steps
Selection creates a delayed effect carrying the chosen type, cell, and original plant level. On its animation event, the code removes the old plant, then checks whether the replacement can be planted. A failed final check skips the addition without restoring the source.99Deferred replacement and unequal checksThe effect stores a cell, replacement type, animation name, original level, and old-plant weak pointer. The loop event tags and kills the old plant before checking replacement placement. Selection excuses blocked-reason 79; the final check excuses no reason. Failure skips AddPlant, with no rollback in this path. This ordering is traced in native instructions; the picker captures did not instrument later insertion callbacks. Other source-plant state is not copied through this effect; AddPlant may obtain new state from the board or profile.0x1009a841c0x1009a981c0x1009a9b4c0x1009a9b8c
Selection excuses blocked-reason 79; the final check does not. Board state can also change while the effect is pending. An empty candidate list is different: it creates no removal effect and leaves the original plant untouched.
Higher ranks have additional rules
The rank-2 rate getters use the 26-name Targetable whitelist, although the description expresses a 300-sun threshold. Eleven ordinary plants meeting that threshold are absent from the list. The getter membership check and its downstream effect on plant statistics are distinct evidence questions.1010Three separate passive pathsThe two rank-2 rate getters consult the 26-entry TargetablePlantTypes whitelist. The rank-3 timer advances one interval per due update and draws rows 0–4. Rank 4 scans empty cells before the deferred removals, selecting plants with Cost <= 100. Its level fold starts at 1 and takes a minimum, so ordinary positive packet levels cannot raise it. The report traces the rate getters; their callers into final plant statistics need separate attribution.0x1009a77280x1009a78c00x1009a75d00x1009a6d1c0x1009a90b0
Rank 3 has a timed spawn path. Rank 4 adds a second selection pass after transformations: it visits the clipped 3×3 down each column and then to the right, while the original sources still occupy their cells. Empty cells select eligible bonus plants costing at most 100. An occupied shore or water cell can select a Lily Pad beneath its source, a singleton pool that consumes no outputs. Effects then apply in reverse selection order. A pad added first can block a replacement, and a second pad on the same cell is rejected. The calculator models these selections and placement outcomes.1111Rank-4 selections and placement conflictsThirteen 4.2.2 normal-level captures retain 100 selections and 10,437 selection draws. They cover empty and mixed areas, board edges, gravestones, Pirate planks, water and pads. Most offsets were reconstructed for replay; two Beach follow-ups used routes forecast before play. The follow-ups record reverse plant-add order, an occupied-shore Lily Pad, a duplicate pad rejected, and a Cactus replacement rejected after its supporting pad appeared. Placement comparisons exclude cells whose terrain changed. Two follow-ups also recorded extra draws after selection, so the selection-end offset does not establish the next activation state. Captured creation requests in Dark Ages 4 passed level -1; resulting plant levels remain unresolved.0x1009a6d1c0x1009a90b00x1009a841c0x1009a9b8c
The traced bonus-level fold starts at 1 and takes a minimum, but this alone does not establish the final spawned plant level. Captured creation requests also passed -1. Resulting levels, timed passive spawns, and terrain changes during the effects are outside the calculator's model.
The Evolution reference retains the declared formulas and plant lists.
Restoring unpredictable choices
The game should use randomness supplied by the operating system for Evolution's choices.
Notes
The evidence behind each claim: the code path, and the native addresses where it was traced.
- 1
The separate libc++ shuffle stream
The imported __rs_get and __rs_default symbols identify two-argument std::random_shuffle. Its forward permutation uses uniform_int_distribution with rejection. Live PlayCover captures record raw outputs matching mt19937 seed 5489, complete permutations and selections; the host-library probe is separate evidence. Recorded iPad outcomes corroborate specified routes without identifying the loaded iPad library. Evolution and Modern portals share this library stream.
0x1009a92800x1001210440x10001bf38 - 2
Level entry shuffles the gravestone bags
In the 4.2.4 executable, loading a level builds each gravestone-spawning wave action its wave list references, in wave order, and runs the library shuffle on a vector holding every pool entry Count times, on the same engine as the artifact. Three fresh-launch captures matched exactly: Dark Ages 21 (bags of 10, 10, 10) consumed 42 outputs from offset 0; Dark Ages 19 (bags of 3, 6, 3) consumed 10 outputs from offset 0 and 9 after two previews; an earlier Dark Ages 4 capture (bags of 3, 3, 4) consumed 8. An alias declared twice resolves to its first declaration, and an action no wave references builds nothing. Every selection after those entries, including a Draftodil row shuffle over 4 objects, matched the model. Whether restarting such a level repeats the shuffles was not measured.
0x101bc92fc0x1004009d0 - 3
Captured preview structures and consumption
The original 4.2.2 cost-50 rank-1 capture records nine 226-entry shuffles and 2,874 outputs from offset 0. Two later 4.2.2 display-board captures at cost 47 retain 153 selections and 36,152 outputs, including two Draftodil row shuffles and the add order. One records a fresh-launch mixed route; the other begins at previews 10–11 after nine reported previews, whose starting offset is reconstructed. Played checks distinguish bare pads from plant objects and confirm rejected values in a row shuffle. Level entry and restart consumed no library outputs on the measured routes in levels without gravestone-spawning wave actions; note 25 covers the levels that have them.
0x1009a73800x1009a92800x1009a7138 - 4
Registry order and live registration order
The registry rebuild appends configured PlantTypeOrder names, then remaining weak handles in unsigned handle order. In the captured 4.2.2 fresh loads that tail matches declaration order; all 360 enabled entries match. The live-slot allocator inserts at the head and the snapshot walks forward. Reversing freshly planted sources changed target traversal prospectively. Movement, deletion and restoration need their own registration history.
0x1000feec00x100100cd40x1036733f80x1036730300x1009a6b5c - 5
Seven catalog filters
The Enabled default is true. Enabled, four literal aliases, four overriding plant classes, HeroProperties, the parallel_ prefix, IsConsumable, and plantBlackList reduce the 385 definitions to 259. The exported projection retains the input fields. Cost, stage eligibility, and per-tile planting checks further restrict the result. The stage virtual has a Lily Pad override.
0x1009a66400x1009a8b48 - 6
Effective source cost versus declared candidate cost
The source calls PlantType virtual +0x70 with arguments -2 and 0. Its base path applies mode prices, level deltas, discounts, multipliers, and a zero clamp. Candidates read the raw Cost field and require Cost > source cost. The filtered catalog maximum is 500; its three entries are wintermelon, banana, and cobcannon. An empty result returns a null handle and the driver creates no removal effect.
0x1009a88380x10183629c0x1009a8d840x1009a8f18 - 7
Measured cell pools and the flooded-cell rule
Candidate lists were captured before the shuffle. Ground, shore, pad and plank rules are measured effects under the recorded setups, not complete reconstructions of every planting predicate. Separate Beach checks over dry shore and water produced identical pad pools at cost 0. Cactus appeared in the ground pools and was absent on pads; the earlier Memory Lane level had already banned Cactus, so it could not establish pad eligibility. The flooded rule admits CanLiveOnWaves, accessory boost 17 or 40, or supported cell objects. The captured unboosted pool follows the declared flag. Cob Cannon requires adjacent Kernel-pults; Intensive Carrot requires a valid revival record.
0x1015976180x1013cd58c0x101afc2380x1020c1170 - 8
What the prospective checks confirm
The reversed Egypt 13 planting trial was predicted before play and instrumented. Saved forecasts for Egypt 8, Memory Lane and Penny’s Pursuit were subsequently reported matched; the retained claims concern the requested cells. The mixed rank-1/rank-4 preview forecast was also reported matched. These are distinct from retrospective replay, and do not establish arbitrary routes, Android, or higher-rank in-level activations.
0x1009a8b480x1009a9280 - 9
Deferred replacement and unequal checks
The effect stores a cell, replacement type, animation name, original level, and old-plant weak pointer. The loop event tags and kills the old plant before checking replacement placement. Selection excuses blocked-reason 79; the final check excuses no reason. Failure skips AddPlant, with no rollback in this path. This ordering is traced in native instructions; the picker captures did not instrument later insertion callbacks. Other source-plant state is not copied through this effect; AddPlant may obtain new state from the board or profile.
0x1009a841c0x1009a981c0x1009a9b4c0x1009a9b8c - 10
Three separate passive paths
The two rank-2 rate getters consult the 26-entry TargetablePlantTypes whitelist. The rank-3 timer advances one interval per due update and draws rows 0–4. Rank 4 scans empty cells before the deferred removals, selecting plants with Cost <= 100. Its level fold starts at 1 and takes a minimum, so ordinary positive packet levels cannot raise it. The report traces the rate getters; their callers into final plant statistics need separate attribution.
0x1009a77280x1009a78c00x1009a75d00x1009a6d1c0x1009a90b0 - 11
Rank-4 selections and placement conflicts
Thirteen 4.2.2 normal-level captures retain 100 selections and 10,437 selection draws. They cover empty and mixed areas, board edges, gravestones, Pirate planks, water and pads. Most offsets were reconstructed for replay; two Beach follow-ups used routes forecast before play. The follow-ups record reverse plant-add order, an occupied-shore Lily Pad, a duplicate pad rejected, and a Cactus replacement rejected after its supporting pad appeared. Placement comparisons exclude cells whose terrain changed. Two follow-ups also recorded extra draws after selection, so the selection-end offset does not establish the next activation state. Captured creation requests in Dark Ages 4 passed level -1; resulting plant levels remain unresolved.
0x1009a6d1c0x1009a90b00x1009a841c0x1009a9b8c