Intoli Plugin API

Intoli Plugin API


Welcome to the API documentation!

These pages are designed to serve as a reference once you already have some basic familiarity with the SDK. If you're just getting started then you might want to take a look at the Quick Start Guide first. That said, having a good understanding of the structure and the semantics of the library will make integrating it in your game an easier process.

For this reason, we recommend reading the documentation for at least a few of the most important classes.

Library Semantics

Before diving into the actual documentation pages, we should make a quick note about the semantics of the library. The SDK is designed to be used in a way where the meaning of the code closely mirrors how you would express the same thing in English. This involves function chaining, function names that are sometimes only meaningful in context, and the overloading of some common operators. If you're not familiar with this style then it might be a bit jarring at first, but it allows for a high level of flexibility while maintaining code readibility.

You'll get a feel for the overall style as you go through the various code examples in the documentation, but here's a quick illustrative example.

// report an achievement
    new Achievement("Get 10 Diamonds and 10 Gold")
        .For(new TrackedVariable("Game Currencies:Gold") > 10)
            .And(new TrackedVariable("Game Currencies:Diamonds") > 10)

This code can be read as, "Report an achievement, identfied by 'Get 10 Diamonds and 10 Gold', for a tracked variable, identfied by 'Game Currencies:Gold', being greater than 10 and another tracked variable, identfied by 'Game Currencies:Diamonds', also being greater than 10." That's a bit of a mouthful but it's easily understandable. You can also see how a more comlex composition could be constructed in a similar manner by chaining additional calls.

How to Dive In

In order to do anything substantial with the library you'll have to create objects that are identified by keys. Reading the KeyIdentifiedObject page will help you understand some of the subtler aspects of object uniqueness as well as how to use keys effectively. It's a bit abstract but it's very helpful in understanding what happens when you re-initialize objects with pre-existing keys.

Intoli is a good place to start exploring after you have a solid grasp for the singleton-esque behavior of KeyIdentifiedObjects. All of the actions that you take with the library are initiated by settings properties or calling methods inside of Intoli. You can set your apiKey and various configuration options in Intoli.Settings, report events with Intoli.Report, or register variables with Intoli.Register.

Registering variables is a central action within the Intoli library and it's something that's uncommon among analytics libraries in general. Unlike other companies, Intoli goes a step beyond typical analytics by actually modifying components of gameplay to maximize your chosen metrics automatically. In order for this to happen, you need to register these variables as AdjustableVariables.

Similarly, you can also register variables as TrackedVariables. These are very similar to AdjustableVariables, but they will never be adjusted by the library. They're used to better understand the dynamics of your game as well as to add contextual meaning to events. Reading the RegisteredVariable, RegisteredVariable.Affecting, RegisteredVariable.Representing, GameConcepts, and Intoli.Register pages will give you a much better idea of how to use both TrackedVariables and AdjustableVariables.

The other core action of the library is reporting events using Intoli.Report. There are a variety of built in event types that can be reported: Achievement, Error, Event, Exchange, and Progression. The documentation pages for each of these will include examples as well as details of the type specific ways to add additional context and information about RegisteredVariables.

There are various other components in the library but they should be clearly referenced anywhere that you need to worry about them.

If you have any questions then don't hesitate to shoot us an email, we're happy to help!