<a href="https://news.ycombinator.com/item?id=22851109" rel="nofollow">https://news.ycombinator.com/item?id=22851109</a><p>DonHopkins on April 12, 2020 | on: Enemy AI: chasing a player without Navigation2D or...<p>One trick is to spread the computation out over time, if you don't need to do it all at at once every frame. Since the enemies don't move that fast, a bit of delay might be good enough, depending on what you're tracking.<p>SimCity has several layers like pollution, land value, etc, which slowly diffuse over time. But it only does that computation every so often, not every frame. It has a 16 phase simulation clock, and it scans the cells of the map in eight stripes over eight steps, then scans different layers like taxes, traffic and rate of growth decay, power, pollution and land value, police coverage and crime, population density, fire coverage and disasters, and the RCI valves. (That made it possible to run on a C64!)<p>Chaim Gingold's SimCity Reverse Diagrams show how the different phases of "Simulate()" perform different kinds of analysis over time, and how the different map layers interact with each other.<p><a href="https://lively-web.org/users/Dan/uploads/SimCityReverseDiagrams.pdf" rel="nofollow">https://lively-web.org/users/Dan/uploads/SimCityReverseDiagr...</a><p>>SimCity reverse diagrams, by Chaim Gingold (2016).<p>>These reverse diagrams map and translate the rules of a complex simulation program into a form that is more easily digested, embedded, disseminated, and and discussed (Latour 1986).<p>>If we merge the reverse diagram with an interactive approach—e.g. Bret Victor’s Nile Visualization (Victor 2013), such diagrams could be used generatively, to describe programs, and interactively, to allow rich introspection and manipulation of software.<p>>Latour, Bruno (1986). “Visualization and cognition”. In: Knowledge and Society 6 (1986), pp. 1– 40.<p>>Librande, Stone (2010). “One-Page Designs”. Game Developers Conference. 2010.<p>>Victor, Bret (2013). “Media for Thinking the Unthinkable”. MIT Media Lab, Apr. 4, 2013.