Jump to content
  • entries
    943
  • comments
    5,899
  • views
    923,749

Game Analytics API Plugin


Josh

2,532 views

 Share

Analytics is a feature I have long thought was a good candidate to be moved into a plugin.

  • It is an optional features that only some users care about.
  • It imports some pretty big third-party libraries into the engine.
  • It requires an extra DLL be distributed with your game.
  • It's a totally self-contained features that is easy to separate out from the rest of the engine.

I have uploaded my code for Analytics in Leadwerks here as a new empty Visual Studio project:
https://github.com/Leadwerks/PluginSDK/tree/master/Game Analytics

This will be a good test case to see how we can implement API plugins. An API plugin is an optional module that adds new commands to the engine. It should work with C++, Lua, and C#.

How do we do this? I'm not sure what the best way is. Do we want to try to make an object-oriented API like the rest of the engine, or should we just stick to a simpler procedural API? I putting this out now so we can discuss and determine the best way to handle this.

Here is some info on using sol to expose an API from a DLL:
https://github.com/ThePhD/sol2/tree/develop/examples/require_dll_example

If we can make this plugin work then it will serve as an example for how all API plugins should be integrated. Please take a look at tell me how you would like this to work.

  • Like 3
 Share

10 Comments


Recommended Comments

These are two very important parts of the engine for me, for what that's worth.  Everything I do now is in pursuit of coop multiplayer and I think it's important for developers to get free feedback in their game about what is too simple/boring or too difficult to aid with developer blindness.

Link to comment

Yeah, I am just wondering how this should be exposed to the programmer. I can think of three different ways to interface with C++:

  • Procedural DLL commands.
  • Procedural DLL commands with OO wrapper classes.
  • OO Static library.
Link to comment

I admittedly don't know how that would differ from what seems to work for me now.  I would love to continue to just be able to call:

bool SendP2PPacket( CSteamID steamIDRemote, const void *pubData, uint32 cubData, EP2PSend eP2PSendType, int nChannel = 0 );

 

Link to comment

Well in this case you can just include the lib in your project and you don’t really need a middle layer for any reason.

Link to comment

Right, for Steam it's easier.  I'd love to continue doing the same for Game Analytics as well.  I think that one is more complicated to set up.

Link to comment

The whole concept of “plugins” in C++ is probably erroneous. There’s just libraries you can import. In the case of GA you would prefer to use my nice commands over the ugly raw CURL calls.so a couple of C++ files or a lib you import is probably the right approach there.

  • Like 1
Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...