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

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Fast, Declarative, Character Simulation Using Bottom-Up Logic Programming

Ian Horswill, Samuel Hill
Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment
Logic, programming, and type systems
article

Fast, Declarative, Character Simulation Using Bottom-Up Logic Programming

Ian Horswill, Samuel Hill
article en

Abstract

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.

Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital EntertainmentVol. 20(1)
Openalex Percentile: Top 82%
Logic, programming, and type systems
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.