Skip to content

Releases: tomicz/unity-procedurally-generated-grid

Release list

v1.1.0

Choose a tag to compare

@tomicz tomicz released this 06 Sep 08:56

Turns the grid from something that renders into something you can build a game on: coordinates, pathfinding, layouts, and tooling.

Install

https://github.com/tomicz/unity-procedurally-generated-grid.git#v1.1.0

New

  • Coordinate conversion. NodeToWorld / WorldToNode on the component, GetNodeCenter / TryGetNode on the plain grid. A position in a spacing gap maps to the node before the gap.
  • Batched color uploads. Colors set in play mode are uploaded once at the end of the frame. ApplyColors flushes early, SetAllNodeColors resets the grid, and ColorsDirty exposes the state for plain-grid users.
  • Neighbour queries. GetNeighbors fills a caller-supplied buffer without allocating and never offers a diagonal that would cut a corner past an obstacle.
  • A* pathfinding. GridPathfinder with a binary-heap open set and reusable buffers. WasVisited and LastVisitedCount describe the explored area.
  • Saveable layouts. GridLayoutAsset (Assets > Create > Procedural Grid > Layout) with SaveLayout / LoadLayout on the component.
  • Custom inspector. Node and vertex counts, memory footprint, a large-grid warning, and buttons for Regenerate, Clear Occupancy, Reset Colors, and layout save/load. Occupied nodes draw as red gizmos.
  • Example scripts. GridPainter (left-drag paints obstacles) and GridPathDemo (right-click sets start and goal, path redraws as you paint), both in the example scene.

Fixed

  • Node colors are serialized as a packed byte array. A Color32[] cost three YAML lines per node and could dwarf the scene file on large grids.

Tests

62 edit-mode tests, up from 26.

v1.0.0

Choose a tag to compare

@tomicz tomicz released this 06 Sep 08:55

First versioned release. The grid is now a proper Unity package: installable from the git URL, MIT licensed, and covered by edit-mode tests.

Install

https://github.com/tomicz/unity-procedurally-generated-grid.git#v1.0.0

Requires Unity 2021.3 or newer.

Highlights

  • One mesh, any size. The grid uses 32-bit mesh indices automatically past 65,535 vertices, which replaces the old multi-section system and its child GameObjects.
  • Works in builds. Generation now runs on enable, not only in the editor's OnValidate, so the grid object exists at runtime.
  • Persistent node state. Occupancy and per-node colors survive regeneration and scene saves. Resizing keeps the overlapping region.
  • Faster generation. No per-node allocations, Color32 vertex colors, and color-only uploads when a node changes color.
  • Material fix. The component uses its assigned material via sharedMaterial instead of instantiating one per Awake.
  • Bounds check on SetNodeColor, which previously wrote into the wrong row for a bad column index.
  • Package manifest, license, README rewrite, and 26 edit-mode tests.

Breaking changes

  • GridGenerator moved into the TOMICZ.Grid namespace.
  • OptimizedGrid.MeshSections is gone. Use the Vertices, Triangles and Colors arrays, and LoadMeshData(mesh) for a full upload.
  • Colors are Color32. Color converts implicitly, so most callers compile unchanged.
  • The generated mesh is no longer saved into the scene.