@adatechnology/game-vegetation-three
v0.2.5
Published
The vegetation test module for the shared test room: the 18 plants of the Viveiro as destructible items (separable pieces, joints, real wood thickness, sway clips), its 13 scenarios and the nursery lot with the walker that bends the plants.
Maintainers
Readme
@adatechnology/game-vegetation-three
The vegetation test module for the shared test room: the 18 plants of the Viveiro as destructible items, their 13 scenarios and the nursery lot. A literal port of the team's vegetation-module.js.
import { loadVegetationTestModule } from '@adatechnology/game-vegetation-three'
loadVegetationTestModule(room, { locale: 'en' }) // or room.loadModule(createVegetationTestModule(options))
room.openArea('vegetation')Without options the module uses @adatechnology/game-vegetation (with its three.js adapter) and @adatechnology/game-vegetation-species; a game that brings its own build passes GameVegetation and GameVegetationSpecies.
Items
mango_tree, mango_young_15, mango_young_30, yellow_ipe, coconut_palm, banana_with_bunch, araucaria, dead_tree, hibiscus_shrub, boxwood_hedge, rose_bush_red, sunflower, mandacaru, prickly_pear, crown_cactus, potted_fern, potted_cactus, lawn_tuft. Each piece of a plant (trunk, branch, crown, fruit, arm, pad, spines, pot, soil) is one mesh named after the piece, with its destruction spec: the shape from the real thickness of the wood (radius, length and axis that generate gives each wood piece), the joints (stem between a branch and the trunk, tie for leaves, flowers and spines, resting for the soil in a pot), the fixed root piece, tags, mass and fill, and a sway clip for the wind. The young mango trees are the 15 and 30 cm trunks on which the SDK documents the number of axe swings; the terracotta pot has 25 hp, so 1 to 3 shots of 9 mm break it.
Scenarios
The 13 of the page, with its ids: veg_axe_fells_crown, veg_axe_fells_30cm, veg_axe_cuts_branch_joint, veg_shot_cannot_fell, veg_saw_cuts_branch, veg_lighter_ignites_foliage, veg_shot_strips_leaves, veg_shot_breaks_pot, veg_machete_arm, veg_pad_pulled, veg_dead_burns_faster, veg_hedge_cut_pieces, veg_walk_on_grass. The room gives every tool a draw time that the team's page did not know, so each scenario waits for the tool to be ready.
Bench
- Controls: the seed, quality (high or game), detail (LOD 0 to 2), condition and season of the nursery lot, the wind and the gusts. Actions: plant the lot, remove it, start or stop the walker. Changing a lot control plants the lot again.
- The nursery is the 12 x 20 m plot of the Viveiro's lot demo (house, walls, street, sidewalk, path), planted by
scatterRulesForof@adatechnology/game-vegetation-speciesover the front yard, the backyard, the side strips and the sidewalk tree, and built bybuildLot. The walker crosses it alongWAY, stays out of the house and the trunks, and bends the plants through the wind shader's actors. - Layers:
colliders(the trunks and cactus bodies as wire cylinders),piece_boxes(the box of every piece) andwood_axes(a line along the centreline of each wood piece). - Metrics: plants, pieces, triangles and draw calls of the items, and the triangles, plants, colliders, plants by LOD and build time of the lot.
The module draws no particles and asks for no effects: leaves, sap and fire come from the events of the default destruction world, which the room shows.
Tests
tests/team-golden-module.test.ts runs the module of the Viveiro artifact against the kit's room and compares it with this one: the 18 items (names in both languages, meshes, specs, clips) and the 13 scenarios (the same checks and the same count of every log line). tests/team-golden-nursery.test.ts cuts buildLotVeg from the page and compares the placements, triangles, plants, colliders and species for 8 seeds. examples/vegetation-test-area loads the module, and so does examples/interactables-test-area.
Geometry
The nursery's scenery (ground, street, walls, house and roof), its colliders and walker, and the colliders layer are made through
shapeGeometries(THREE) of @adatechnology/game-shapes-three: the same bytes as three's constructors
(tests/exact-golden.test.ts), cached by parameters. The plants themselves are @adatechnology/game-vegetation's own buffers (PlantMesh,
with the per-vertex sway of the wind), drawn by its adapter.
