Protfolio-Emanuel-Polsky
README.md

Code Showcase - Emanuel Polsky

This is a Unity DOTS/ECS code showcase focused on custom gameplay systems. The main systems in this repository are a grid-based pathfinding setup and a Verlet integration cloth/flag simulation.

Project

  • Unity version: 6000.4.3f1
  • Core packages: Unity Entities, Unity Physics, Entities Graphics, URP
  • Main code path: Assets/_Project/Code
  • Example scene: Assets/_Project/Scene/Example.unity

Pathfinding System

The pathfinding code lives in Assets/_Project/Code/PathFinding.

The system builds a grid from authored data, stores it as a blob asset, then uses Unity Physics checks to classify each point as air, ground, near-ground, movable, blocked, or static-blocked. It can also update only a small region of the grid when something changes, instead of rebuilding the full map.

The path algorithm is an A*-style search:

  • Uses G, H, and F costs to choose the next best node.
  • Supports 8-direction movement across the grid.
  • Adds extra cost for tricky movement, like moving through air or changing direction mid-air.
  • Rejects jumps that are too high or stay in the air for too long.
  • Compresses the final path so movement follows only the important turns, height changes, and surface changes.

After a path is found, the movement system drives the entity with PhysicsVelocity, removes points as they are reached, and asks for a recalculation if the entity seems stuck.

hippo

Verlet Integration System

The Verlet code lives in Assets/_Project/Code/VerletIntegration.

This system simulates cloth-like objects from points and sticks. The baker converts authored points, locked points, triangle data, and stick links into ECS buffers. During simulation, each unlocked point moves using its current position, previous position, damping, and gravity. Then the stick constraints are solved several times to keep the cloth shape stable.

Highlights:

  • Uses ECS buffers, Jobs, and Burst-friendly data.
  • Locked points can follow the owning entity, which makes the cloth attach naturally.
  • Bounds keep the simulated points inside a configured area.
  • Interaction support pushes cloth points away from sphere, capsule, and box colliders.
  • Optional tearing disables over-stretched sticks and removes the connected triangles from the mesh.
  • Rendering builds a dynamic mesh and updates visible vertices from the simulated points.

hippo hippo hippo

Overall, the project shows practical DOTS systems with a focus on data-oriented movement, physics queries, custom simulation, and runtime mesh updates.