bridge library
The visible half: ground as a mesh, a crowd as one batch, buildings as themselves.
The only file in this package that draws, which is what the structure
rule a genre package draws only where it says is about — reaching a
renderer, rather than importing Flutter. Everything under src/ is
arithmetic and stays reachable from a test with no device; this is where the
arithmetic meets a GPU, and the seam is one class wide on purpose.
The crowd is one node, not one node each. That is the whole reason a
strategy is the genre that exercises InstancedMeshNode: a thousand nodes
is a thousand draws, and the measurement that started this work put fifty
thousand instanced units at the refresh rate of the display with the
processor encoding the frame — not the device drawing it — as what gives way
first. So the batch is written every frame, in full, because that is the
case a game actually has: units that stand still would let the engine skip
an upload a moving crowd cannot skip.
One batch per look, not one batch. A game that dresses its workers, soldiers and tanks as three different models, in each side's colours, has six meshes to draw, and an instanced batch is one mesh and one material. So the crowd is split by UnitLook into a handful of batches — still a handful of draws for a thousand units, which is the property the paragraph above is about — and a kind nobody dressed falls back to the plain batch StrategyVisuals.crowd has always been.
Classes
- MeshLook
- A mesh and the material it is drawn in: one way a unit, a deposit or a prop looks.
- PropBatch
- Copies of one look the map wears where the simulation has nothing: trees, say, or boulders.
- StrategyVisuals
- Draws a StrategySimulation.
- UnitLook
- How one kind of unit looks, side by side.
- UnitSize
- How big a unit is drawn, in metres.