Design Principles

What are the high level design principles of Total AI?


  • Simple
  • Easy To Prototype
  • Flexible
  • Customizable
  • Performant

Simple


Assuming the requirements are met simple is always better. This is true in all areas. Whether it is in code, UI, game design, or even this documentation. Simple is not easy. Usually initial "easy" solutions are overly complex. Only after multiple refactors does a solution begin to be simple. This is because the problem can't possible be understood until multiple passes of implementation are made along with feedback at each stage. This can be seen in TAI as almost all areas of TAI are at three or more revisions from their initial code/design. Over time even more revisions will be made to simplify it. The overall gains of simplicity for code is particularly great since simple means less bugs, easier bug fixes, easier for new developers to learn the code, more stable code, and code that is easier to extend.

Performance is probably the most obvious counter to this argument. Certain areas might need to be overly complex in order to reduce a performance bottleneck. The key is be be 100% sure that its worth the complexity, so measure performance gains when deciding to introduce complexity.

Easy To Prototype


Video games are complex creations especially ones that attempt complex AI. NPC behavior is a very hard problem and must be carefully balanced with the gameplay. Prototyping different systems quickly before major costs have gone into them is critical. AI in particular can be difficult to prototype with switching between various AIs time consuming. TAI attempts to remove this barrier by providing one framework that allows many diverse styles of AI to be tried and also mix and matched between Agents.

Flexible


Creating a usable AI Framework for Unity is a challenging task due to the incredible variety of games. TAI tries to provide a fully featured framework for a large chunk of these games by creating a general AI framework that a user can easily plug in different logic. TAI also makes it easy to use some features and not others.

Customizable


Customization is at the heart of TAI. TAI attempts to put all key logic inside types that inherit from ScriptableObjects. These types can then be easily extended to either expand on the current logic or create new logic. These new types can then be easily set into other ScriptablObject Types or into Components.

Performant


TAI uses two main pathways for performance.

One is in the core code using the latest in Unity performance technology such as the Jobs System and is received for free. TAI currently does NOT use the Jobs System. This is currently an area in need of improvement for Total AI.

The second one is design options for reducing and redirecting available computation to the areas of your game that need it. This one is more powerful but takes careful design by the game designer. TAI provides many options here and the documentation tries to aid game designers with how to get the most out of their available AI compute.