This tutorial assumes you have some basic game development experience with the Unreal Engine and have an understanding of game development.
We also assume you have already installed the ctalyst® Unreal Engine UE4 plugin. If you have not, you can watch the tutorial here:
We will be working with an empty blank template, but you can implement the ctalyst plugin at any time during your development cycle.
Begin by creating an empty C++ Unreal Project, using the Basic Code Template. Select “No Starter Content” as the extra content options are not needed.
Select the folder location, give your project a name, and click Create Project.
If visual studio opens, you can safely close it unless you need it.
Save this new Level. A good practice is to save all levels and assets in one common location. Select File > Save Current, and provide a name.
Installing the Plugin
If you have already installed the ctalyst plugin you can skip this step. You only need to install the plugin once.
Because our plugin is not available in the Unreal Asset Store, you will first have to exit the editor.
From Windows Explorer, navigate to your project’s root directory.
If you do not already have a ‘Plugins” folder, create one now. It’s important to use a capitalized ‘P’.
Download the plugin from your ctalyst developer account, unzip and copy the correct Unreal version into your project’s Plugins folder.
Refresh your Visual Studio Project by navigating to your project’s root folder and Right clicking your Unreal project file. Select “Generate Visual Studio project files”.
Setting Up Unreal Engine UE4
Open your Unreal Project.
Unreal will display a new plugin notification message in the bottom right hand corner of the screen. To confirm the installation has succeeded, click the “Manage New Plugins” button. You should see that ctalyst has been installed and is enabled.
In this tutorial, we are going to create a ctalyst folder where we will keep our ctalyst assets.
Begin by creating a new square (1:1 aspect ratio) Plane and name it DynamicPlane.
ctalyst supports 31 different iAB image sizes and aspect ratios. You can find more information about this from your developer dashboard.
Next, create a material for the plane and name it DynamicPlaneMaterial. Open the material in the material editor, right-click and select “TextureSample”.
Now, right-click the Texture Sample module and select Convert to Parameter. Always name the Texture Sample module to ctalystTexture or the ad serving will not work. Be aware the name is case sensitive.
Connect the first connection node of the ctalystTexture module to the “Base Color” Connection node of the “DynamicPlaneMaterial” module.
If you have not already done so, import a square texture file and apply it as your default texture. This is the texture your players will see by default if an ad cannot be served or if there is a network connectivity issue. This also ensures that you will never have a blank space in your game and that all ads have a genuine and natural look and feel within your game.
From the Details Window navigate to the Material Expression Texture Base tab and select your texture.
Save your changes and exit the material editor.
Attach the material to the plane and place and position the plane into the level.
We now have an object, in this case a plane, that is ready to accept ads.
Adding the ctalyst® SDK
Add the ctalyst SDK Actor into your Level and rename it to ctalystSDK.
Creating Dynamic Ads
In the ctalystSDK Details window copy and paste your unique Developer Token and Game ID.
Click the Plus (+) sign to the right of the “Ad Objects List” Option to open the ctalyst editor.
Change the Actor to DynamicPlane. This tells ctalyst that the DynamicPlane object is the desired surface on which to display ads.
Change the AdType to Dynamic
Select the correct Ad Code. Ad Codes are based on Aspect Ratio (first) and Size (second). Once again, ctalyst® supports 31 different iAB aspect ratios and image sizes.
Since our DynamicPlace object is square, we have selected an Ad Code with a 1:1 aspect ratio.
It is critically important to match the Ad Code aspect ratio to the aspect ratio of your plane to avoid unpleasant stretching and distortion. Not matching the aspect ratios can result in your game being rejected from the ctalyst network.
Change the Coupon Type to either “Portrait” or “Landscape” depending on how you have formatted your Rewards Menu. Our rewards menu tutorial provides good information about this feature. Watch the Rewards Menu Tutorial
Priority is a grouping that determines order that ads are served in. A lower number represents a higher priority. You can assign multiple ads to the same priority. This is a handy feature that allows you to prioritize the display of the ads based on the order the player is most likely to see them.
For example, you can prioritize a group of ads as highest priority where a player will spawn.
The Level setting is a future feature and you can safely ignore it.
To test the Ad serving and to ensure you’ve selected the correct ad types and sizes, click the play button. All ads served during development are in Sandbox Mode and you are free to test as often as you wish.
It’s really that easy.
Creating A Static Ad
To create a static ad, simply select Static as the preferred Ad Type.
Again, click the play button and you will see a single ad displayed on your plane.
That’s it, this is how easy it is to create dynamic and static ads using the ctalyst plugin.