ACE
Adaptive Cardplay Engine
ACE is a modern, open-source C# library dedicated to the cardplay phase of the game of Bridge, which is a classic example of an imperfect information game - games in which players make decisions without full knowledge of the game state and where chance influences the outcome - such games remain a persistent challenge in the field of AI.
One of the core issues in this domain, especially in card games, is strategy fusion - a flaw where an engine evaluates many sampled deals separately and picks the move that scores best, instead of choosing a plan that works across all indistinguishable scenarios. This often leads to decisions that seem promising in simulation but fail in real-world play.
ACE mitigates this problem by incorporating concepts from the following paper: https://arxiv.org/abs/2408.02380. Rather than solving each sample with full information upfront, ACE delays the reasoning until it is actually justified. This mechanism prevents overconfident decisions, reduces bias, and leads to more realistic, human-like decisions.
ACE is still in an experimental stage, but already covers most practical use cases:
- Support for any deal – Analyzes games with any mix of known and unknown cards.
- High-performance core – Uses low-level bitwise operations for fast game processing.
- Fast deal generator – Quickly produces random deals for simulation and decision making.
- Hand constraint system – Filters deals by HCP and suit lengths (more constraints coming soon).
- Smart solving algorithm – Based on research that avoids early commitment and strategy fusion.
- Low memory consumption – Uses a compact, efficient tree structure with minimal allocations.
- Multithreading – Runs simulations in parallel to accelerate large-scale analysis and sampling.
- Backend-ready architecture – Easily integrates with tools, bots, UIs, or research pipelines.
- Runs on .NET Standard 2.0 – Cross-platform support for Windows and Linux (x64).
Before starting ACE, I developed a separate project called BGA (Bridge Gameplay Analysis) – a desktop application with a graphical interface focused on analyzing cardplay using a pure PIMC-style algorithm with several domain-specific improvements. BGA supported only declarer play and produced convincing results across many test cases.
The project was described in my BSc thesis titled "Desktop application for the analysis of gameplay in the card game of Bridge", defended in March 2023 at the university Politechnika Bydgoska im. Jana i Jędrzeja Śniadeckich in Poland.
In fact, as noted in the thesis paper, BGA was able to solve more Bridge puzzles than a human expert under the same conditions – demonstrating the practical strength of the approach. However, BGA relied on heuristics, which in some edge cases led to suboptimal decisions when evaluation failed to capture the true complexity of the position.
ACE is a completely new project, built from the ground up as a high-performance backend library with a different architecture and philosophy. While it draws on insights gained from developing BGA, it introduces new solving methods, supports both declarer and defender perspectives, and focuses on reducing strategy fusion using more principled reasoning inspired by recent research.
You can use ACE in two main ways:
- As a library (DLL), integrated into your own .NET projects
- As a standalone console application, for direct interactive use
You can use ACE's library by adding the source code directly to your project or by compiling it as a local DLL.
The project is built in a Visual Studio environment and can be run from source using the included launcher.
- Target framework: .NET Standard 2.0 or higher
- Windows or Linux operating system (x64 architecture)
- Native solver
libbcalcddsmust be available at runtime
Once installed or built, you can reference the compiled DLL in your .NET project like any standard library.
This is currently the only way to use it - a NuGet package is not available yet, but planned for future release.
Make sure to also include the native solver dependency, which is required at runtime to perform simulations.
You can find platform-specific versions in the runtimes folder:
runtimes/win-x64/native/libbcalcdds.dllfor Windows x64runtimes/linux-x64/native/libbcalcdds.sofor Linux x64
For detailed usage instructions, refer to the lib folder in the repository.
A standalone console application is included in the app folder, allowing you to use ACE without writing code.
Designed for ease of use, the application provides direct access to ACE core through a command-line interface.
To view available commands, simply compile and launch the app, then type help command at any prompt.
This project is open-source and licensed under the GPL-3.0 license.
See the LICENSE file for details.
