Games engines such as Unity are the perfect platform for agent based modelling, they allow a combination of 3D urban cityscapes and navmeshes/grid graphs/point graphs and local avoidance systems. The A* Pathfinding project features an array of techniques for rapid pathfinding or AI development using a low memory footprint.
Agents in Unity
We have only started exploring the possibilites but the results are intriguing, below features a clip of 15,000 agents using local avoidance, the number could be considerably increased using multiple machines:
A* Pathfinding is available in free and pro versions, it is well worth checking out, we have just upgraded to the pro….
Creating a sandbox style traffic system in Unity is a challenge. As our previous posts have shown agents can use NavMesh and calculate shortest paths but the hit is high on processing which in turn limits the number of agents in a scene. Sander van der Vegte is a multidisciplinary game developer who for the past 12 years has fortunate enough to make a living creating games, part of his current development process is a city traffic game and thus finding ways for natural behaviour while maintaining a low processing requirment.
Unity City Traffic
The clip below is a recording of an autonomous traffic system. Cars drive around while aware of crossings and other vehicles. When something is blocking their path, they will stop. If it takes too long, they will back up and look for another path, the basic ruleset allows for humorous situations:
CityEngine combined with Unity and a tablet – iOS requires a developers account, Android simple needs the 30 days Unity trial – allows city wide models to run with a touch based interface.
Urban Ball – CityEngine and Unity on iOS
We have used our recent work on Unity and Agent Based modelling to create a simple app called ‘Urban Ball’. Development time so far is around a couple of days so the route from city modelling through to iOS app is remarkably short. Via some tweaked physics and a touch interface linked to a to a ball (the target) we have a simple agent based model on the iPad.
The movie below shows the app so far:
We have been impressed with the rapid development path using Unity and the ability of the iPad to run city wide models complete with agents. Arguably we have completed a proof of concept here, in the next few weeks we will explore how much further we can go – perhaps to release our first free iPad/Android app….
The Vuforia AR Extension for Unity allows developers to build AR apps using the cross-platform game engine – Unity. Working with both the free and pro versions of Unity, Vuforia is not only free it is also one of the best out there in terms of tracking and image based tagging.
Table Top AR City
Running on either iOS/Android or direct via a webcam it allows the integration of other Unity assets into scenes. As such you can create a table top digital city complete with agents all linked to an image based marker and running as a native iOS app:
We will be exploring this further over coming weeks, it opens up a lot of possibilities for augmenting city models (and office desks) with urban data visualisations via custom made iOS/Android apps….