A physics system good enough to support this is probably ~200loc. Probably less if you cut out everything extraneous. All it is is AABB collision detection+resolution, and then some update code.<p>I think the graph + graph algos would be trickier most of the time, but that could just be since I&#x27;ve written the above code many, many times.