This is a very open ended topic. I’ve gotten through C# to where I’m comfortable reading the advanced options it offers and used it to build my own quaint scripted framework for a game.
Unity has an inherent disadvantage for many parallel AI’s because it is single threaded. Still due to my lack of experience and the great documentation and community it’s my best choice. So it’s sort of a squeezing the fruit type question. “Simple” FSM AI’s have always fascinated me. I have a couple formal resources on the topic here I’m about to dive into now that I can handle C#, but I’d like to start an open discussion.
I’d like to support hundreds of concurrent, but simple AI’s capable of reacting to each other while they’re on the move. Initial thoughts I have before studying, your general thoughts on any of these ideas are welcome:
(thinking top down RTS-like perspective though I don’t think it’s relevant)
-
They will “think” in two dimensions. I position them visually in a third.
-
I know how to raycast them to a ground position on a static world mesh.
-
If I could do this task in a vertex shader on the GPU somehow that would be huge. Unfortunately none of the great Cg / ShaderLab references I have do anything like this, and it’s beyond me.
-
Batch process many AI’s. Each entity is a data object referencing some Unity prefab, time-sharing a single brain.
-
Perhaps they have some minimal contingency processing they all get every n frames, handled in subsets each frame. Here a proactive check such as an overlap may prioritize or flag them for special treatment.
-
Inside-out thinking. Static structures collect all nearby entities and inform them of behavior.
-
Actual multi-threading. Reduce some aspect of the AI’s processing to purely operations I can do myself in C# without the help of Unity API functions and write my first mutual exclusion locks. This will require significant formal study.
In no sense am I trying to build Factorio, but this is my general topic of interest. I seek any known resources free or not.