THIS IS A BETA FEATURE
The CRYENGINE plug-in system exposes support for creating plug-ins in C++ or C#, allowing users to simply drop-in a plug-in into their project and instantaneously see the benefits.
- Buy/Sell Plugins on the marketplace
In the future, we want to be able to offer a variety of plugins, developed by Crytek as well as 3rd parties, on the marketplace that will give you all the functionality you need to create your project.
- Simplify game code creation
Size down the scope of code you have to touch to implement elemental features for your project. You can use C++ as well as C# to achieve this.
- Create a custom project without even touching code once
The days of having to modify legacy game projects are past, with the new system you can create a project by just adding pre-written plug-ins too it.
- Making more parts of the engine optional
Gain performance by getting rid of systems that are not required by your project. No need to maintain dead code.
- More control/info about features used by your project
Get proper information about the plugins loaded at runtime, increase iteration time by being able to hot-reload any plugin while the engine is running.
- Easier engine customization for your project
Make your project changes more accessible to your team members by using a completely dynamic working environment for the plugins.
Changes to ExtensionSystem:
There are no compatibility issues with existing extensions.
Changes to CryMonoBridge & MonoRuntime:
CryMonoBridge is now part of every Windows project. This will increase compile times because of the swig-process but it also ensures that C# support can be easily enabled without any further changes or special configurations. The MonoRuntime has changed a lot. The MonoLauncher is not loaded anymore but all the C# plugins are managed directly from the plugin manager. This allows users to keep control over every single binary loaded.
Changes to C# projects/plugins:
To make your C# binary compatible with the new plugin system, just write a wrapper class around it that inherits from ICryEnginePlugin. ICryEnginePlugin offers you all the necessary interfaces to CRYENGINE. The plugin system takes care of calling the methods mentioned below:
- void Initialize()
Gets called whenever the plugin manager initializes your plugin for the first time.
- void OnGameStart()
Gets called whenever the engine starts your game (either after initialization in the Launcher or when switching in-game mode in the sandbox)
- void OnGameStop()
The equivalent for OnGameStart()
- void Shutdown()
Gets called whenever the plugin system is trying to shutdown your plugin. Every engine-related allocation should be removed here. After shutdown the class will await clean up by the framework garbage collector.
On top of this, the plugin manager takes care of setting up a link to the global DomainHandler as well as setting the specified Binary- and Asset directories for this plugin. Can be accessed within the plugin through the following methods:
- const char* GetBinaryDirectory()
Retrieves the binary directory for this plugin on your local machine.
- const char* GetAssetDirectory()
Retrieves the asset directory for this plugin on your local machine.
As this is a Beta Feature, it is still in development and we would love to hear what you think about it. Please provide us with any feedback you have through the CRYENGINE Community forum!