← All projects

Games & simulation · 2 min read

Geometry Predators

Geometry Predators makes a boundary into a game mechanic. The player expands a polygon to enclose prey while autonomous organisms move, hunt, and escape around obstacles.

My role
Personal project
Project scope
Offline Godot / GDScript prototype · private source
Geometry Predators paused with polygon organisms, territory boundaries, obstacles and the selected predator diagnostics.Open full image in a new tab
Paused gameplay with territory overlays and organism diagnostics. The panel exposes polygon area, vertices, territory share, and route length.

Containment is the capture rule

Touching a prey polygon is insufficient. The full shape must remain enclosed for a continuous interval, with an unobstructed center-to-center segment. This makes the distinction between overlap and containment visible during play.

Expansion slows movement and consumes energy. A fitted convex hull can enclose sampled nearby prey points, but it is frozen rather than continuously tracking moving prey. That gives the player a meaningful tradeoff between planning a useful boundary and adapting to a changing scene.

Several geometric ideas serve different jobs

Voronoi cells show nearest-center territory. Delaunay triangulation provides an overlay of center relationships. Shoelace area measures bodies and territory, while a convex hull provides a minimum convex cover of the sampled padded points.

Movement uses Dijkstra on a visibility graph of expanded obstacle corners. Dynamic obstacles trigger replanning, and movement segments are checked again. These are specific geometric constructions, not a claim that the whole ecosystem is globally optimized.

Explain the approximation

The territory calculation is geometric rather than obstacle-geodesic. Local escape choices evaluate sampled candidates and path information; they are not a complete topological solver. Calling out those limits makes the model easier to understand and extend.

The source includes geometry checks and autonomous simulation checks covering containment, blocked paths, safe segments, bounded energy and positions, and reset behavior. Inspection overlays let a player examine those concepts inside the running application.

Project notes

Educational prototype with simplified escape heuristics and geometric territory. Historical checks were not rerun for this writing update.

Related work