Fabio Anderegg

Kythera AI

Fabio Anderegg photo

Fabio has been with Kythera AI for two years, building up our continuous integration system for 3 engines on 9 platforms, adding multiple gameplay features to Wolcen: Lords of Mayhem and is now leading our C# and Unity Engine efforts. Fabio was a web developer for more than 10 years, working on backend, frontend and infrastructure. After moving to Edinburgh, he wanted to upgrade his personal interest in low-level and high performance programming with C++ and Rust into a professional career and found Kythera AI as the perfect place for that.

Fabio Anderegg is speaking at the following session/s

How we Brought a Large C++ AI Codebase to C# and Unity

Thursday 14th July: 16.00 - 16.45 Room 4

Integrating a big C++ project with the .NET framework and the C# programming language is a daunting task. The open-source project CppSharp provides some automated assistance with generating bindings and wrappers between the two languages, but differing semantics around memory management, templates, generics, and many other details make this far from simple when working with large codebases. In this talk, we explain in detail how CppSharp and its underlying .NET technology P/Invoke work, how the wrapper generation process can be customised for a specific project, and how we set up our projects for rapid iteration on our integration layer between C++ and C#. We will explore the challenges we encountered in building the C# and Unity integration for our C++-based game AI middleware Kythera AI, including getting the two languages’ memory management philosophies to work with each other, exposing C++ templates to C#, and mapping C++ value and reference semantics to their .NET equivalents. We will also discuss performance considerations such as the relative expense of different techniques for mapping C++ constructs into C#.

Takeaway:

  • How programmers can use P/Invoke and CppSharp to make their C++ libraries available to C#/.Net - Caveats, problems and solutions around memory management when calling native code from the .NET runtime, which is garbage collected
  • How to make common C++ features like templates, bitfields and value and reference semantics available in C# that do not have a direct equivalent
  • Performance considerations and optimizations when using these technologies

Keep up-to-date

Sign up to our e-newsletter for all the latest news!

Sign up now

Get involved today!

There are many ways you can be part of Develop:Brighton - including taking a booth in the Expo or choosing one of the many sponsorship opporunities during the event or at the Star Awards.

Contact us now!

Keep up to date with Develop:Brighton

Newsletter Sign Up