Abstract
Problem: Troika Games is known for three shipped titles, but was there more to their output than the public record shows?
Approach: Tim Cain recounts a paid Department of Defense contract in 2004–2005 where Troika built an external API for Temple of Elemental Evil, enabling an AI to play the game autonomously.
Findings: The project was completed and delivered. A simple random AI, with no learning or memory, managed to create a party, recruit an NPC follower, acquire equipment, travel between maps, and engage in combat — all within one hour of unsupervised play.
Key insight: If a purely random AI can achieve meaningful game progress through a well-designed API, the potential for a learning AI with state memory is enormous — and this contract represents Troika's secret fourth delivered project.
1. Background
Tim Cain has a Master's degree in computer science from UC Irvine (1989), specializing in artificial intelligence with a subspecialty in integrated learning methods. He started a PhD but abandoned it a couple of years later, joining Interplay in 1991. This AI background becomes directly relevant to the story.
2. The DoD Contract
In September 2004, while Troika was finishing Vampire: The Masquerade – Bloodlines, Tim was approached by a friend — a UCI PhD graduate working for the U.S. Department of Defense. This friend had developed an AI system and wanted to know if Tim could take Temple of Elemental Evil and write an API (application programming interface) so that an external AI could play the game autonomously.
The contract paid enough for two people: Tim Cain as principal investigator (writing reports, verifying builds, liaising with the DoD) and Steve Murray handling the coding. The work spanned roughly six months.
3. Building the API
The API was developed in stages, progressively exposing more of ToEE's functionality to external control:
- Game lifecycle: Start, stop, load, and save games
- Character creation: Programmatic party generation
- World interaction: Move through the world, use objects (doors, map transitions, chests)
- Inventory management: Pick up items, equip/wield gear
- Dialogue: Engage NPCs in conversation (the AI could see available responses and pick one)
- Combat: Fight enemies using available actions
The Troika team never saw the DoD's actual AI. The contract was structured so they only built the interface layer — the "glass" through which an external program could operate the game.
4. Measuring AI Success
One of Tim's required reports addressed how the AI could measure its own success. His answer was elegant: the experience points bar. If XP is going up, you're doing well. Leveling up is good (though the AI just randomly selected feats and skills). Death is the ultimate negative reinforcement. These events were all detectable through the API.
5. The Lunch Test
The most memorable moment came when Steve had most of the API working. He spun up a brand new game with a simple random AI — no learning, no memory, just sending random valid commands through the API. Then the team went to lunch.
When they came back an hour later, the random AI had:
- Created a party
- Wandered around Hommlet, entering buildings
- Talked to NPCs
- Recruited Furnok (an NPC follower)
- Acquired equipment
- Left the Hommlet map entirely
- Traveled to another map
- Was actively fighting giant spiders with a full party
Tim's reaction: "If that's what a random AI can do in an hour, I can't imagine what an AI with state memory and learning algorithms could do."
6. Delivery and Aftermath
The project was delivered around June 2005. By that point, Troika had mostly shut down. Tim doesn't know what happened to the project after delivery — it's gone, as far as he knows.
7. Troika's True Output
This contract means Troika's complete portfolio is larger than commonly known:
- Three shipped games: Arcanum, Temple of Elemental Evil, Vampire: The Masquerade – Bloodlines
- Two demos: A Lord of the Rings demo and a post-apocalyptic demo (code-named "Epic")
- One secret project: A fully externally controllable Temple of Elemental Evil, delivered as a paid DoD contract
The "secret fourth project" is this API-driven, externally playable version of ToEE — a paid, completed, and delivered piece of work that rarely appears in any accounting of Troika's history.
8. References
- Tim Cain. YouTube video. https://www.youtube.com/watch?v=R5guVZA6eAU