From the moment Unity ECS announce, I immediately took interest in it. I downloaded the beta and started playing around with the tools and sample codes in the Project GIT. After playing with samples and trying to integrate into my project, I quickly learned ECS was not ready for self-taught Indie Dev. A lot of the API was not standardized. Unity had not decided between “Pure” and “Hybrid” ECS. The Jobs system and Burst compiler were just in development only. Even with the release of the Job system in play, Physics API still had to be ran in the Main Thread. Even though, Unity DOTS, Data-Oriented Technology Stack, is still in beta, with the release of Unity Physics, now seems like a good time to start learning the new system.
Using DOTS requires a complete paradigm shift in coding logic. Simply put, using DOTS requires you to forget everything you know about Object Oriented Programming. Coupled with lack of complex tutorials and source to study, DOTS implementation can be a serious challenge. What I am looking to try to do is document my process of creating a DOTS based AI System for Project Rebirth.
The first system I am looking to create using DOTS is the Infinite Resolution Influence Mapping. If you are unfamiliar with Influence Maps, you can check out this GDC Talk “Building a Better Centaur: AI at Massive Scale” or read the white paper from Game AI Pro. In addition, here is video demo and explanation of 2D Influence Map system.
So now that a primer on Influence Maps has been given, what am I trying to achieve? I goal is to make a point based Influence. Rather than creating grid of influence, AI agent will set a query of a location and determine the influence based on AI agent and obstacles in the areas. This allow of influence to emit in three dimensions. On top of that, I want to us ray casts and NavMesh to determine if influence should effect a given area based on the AI agent able to get there. If an AI agent is unable to see or get to the query point, it will reflected in it influence.