Fast, Declarative, Character Simulation Using Bottom-Up Logic Programming
Logic programming and rule-based systems are often chosen for tasks such as social simulation because their use of declarative rules and predicates map well to rules of social engagement. Unfortunately, they are often quite slow, due in part to its heavy use of pointer chasing, dynamic allocation, garbage collection, and runtime type-checking, making it difficult to use for large numbers of characters or high-frequency updates. For appropriate tasks, bottom-up execution of logic programs can provide the declarativity of logic programming without its performance issues. We argue that large-scale character simulations are a “sweet spot” for bottom-up LP. We present a language, TED, that combines declarativity with excellent performance. TED can be used with any game engine supporting C#. In head-to-head comparisons TED code was 2-3 orders of magnitude faster than Prolog, 2-5 times more compact than C#, and only 25% slower than C#. It is used in both the research game Voix de la Ville and the upcoming commercial game Rise of Industry 2.
Authors
- Ian Horswill
- Samuel Hill
Publication Details
- Journal
- Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment
- Published
- 2024-11-15
- DOI
- https://doi.org/10.1609/aiide.v20i1.31866
- Primary Topic
- Logic, programming, and type systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00