How to create a game plugin

In this example we are going to see how to create a game plugin using c++ and Maratis SDK. Creating game plugin and custom behavior can be seen as complicated in the beginning and require some programming experience, but once the concept is understood and with the help of some starting code like the following one, it will be very soon a powerful ally and a time saving production tool.

1 : Project creation

Start by creating a new project : File > New Project

Lets name it « SimpleGamePlugin » (SimpleGamePlugin.mproj)

Export or copy your game data (meshes, maps, sounds…) to the project sub-directories. For this example I will just copy a previously created box mesh (box.mesh) in SimpleGamePlugin/meshs/

Add the box in the current scene (« add Entity » button), a light and a camera.

Save your project : File > Save
- The first time it will ask you to create a level file, lets name it « main » (main.level)

Close Maratis.

2 : Game plugin creation

We are now going to create a game plugin containing a custom game class and a custom behavior.
- For this example, the game class will not do anything special, and the behavior will just rotate the object using it.

Lets create a new folder in the project directory, named for example « _GamePlugin ». In this example the folder will contain the source code, a visual cpp project and a xcode project (visual cpp mac equivalent). The goal is to create a dynamic library using Maratis SDK.

This is really good! Now I can make a game.dll with Code::Blocks and MinGW C++, and the artists and level designers can use the actual game code in realtime in MaratisEditor, and it’s the same code as in the final game exe, because I use MaratisPlayer for the final game.