# What architecture should I use to support extensions in my game?

What is the proper architecture for the game, that support extension modules, written in other languages?

I mean I have a simple game - written in Groovy (basically Java), heavily relying on Game object pattern (resources, configurations, part of game logic), which have a couple classes with certain logic.

I want to provide an ability to override that logic, using external modules written in another language (ideally I want to support any language). Also I want to have an ability to add additional logic.

What is the proper architecture for that?

• I'd think language-agnostic RPC protocol or C API (pretty much every language can deal with a C API). – Quentin Aug 4 '16 at 15:07

You will need to define a expected interface, one you expect extensions to your game to expose (such a PluginLoaded entry point).
You'll then want to load your game's extensions from dynamically linked libraries (.dlls on Windows, .sos on non-Windows platforms). Once loaded into memory you locate and call your expected entry point (PluginLoaded, et cetera) at the appropriate time.