Unity + xAPI

415 views
Skip to first unread message

jhaag75

unread,
Apr 11, 2018, 10:28:20 AM4/11/18
to xAPI-Specification

Hi All,

Looking to implement xAPI in Unity. Came across the .NET library from Rustici Software. Is this the library most are using to implement xAPI in Unity? Below are some of the resources I've found:




Appreciate you sharing any challenges or successes you've had with xAPI + Unity. Thank you!

Regards,

J Haag

brian....@scorm.com

unread,
Apr 13, 2018, 9:49:21 AM4/13/18
to xAPI-Specification
I've been in contact with several people that have used TinCan.NET and had varying amounts of success with integrating it into Unity. I can't say I've done so myself, but not through a problem, only that I've not really worked with Unity. There are various hang ups around what Unity supports that can cause troubles.

* There was a mono related https issue that I think has been fixed (cause I've not heard more about it for a while).
* There is an issue with JSON.NET (a dependency) and what versions of Unity it will work with. There is a package that can work around those issues, but I'm not 100% clear on whether it is a drop in replacement or requires changes to TinCan.NET to get it to work.
* There is an issue with various versions (potentially all) of Unity that only support older versions of the .NET framework requiring a DLL that is built for 3.5, which we provide but I couldn't tell whether it can be provided (by default?) by nuget.
* And most recently, apparently there is an issue with Unity with WebGL that causes the HTTP request handling provided by system.net to not be compatible essentially making it impossible to communicate with the LRS. There is a community member working on something to get around this issue, and there may eventually be work in the library itself to expose an interface that would allow overloading that to allow providing an HTTP request handler.

There are a number of open pull requests against the library, and we are aware of them. Unfortunately as a non-direct revenue source it is hard for us to allocate time when other priorities warrant attention. I'm recently back from vacation and getting caught up, I'm hoping to have some time to devote to getting the next release out with all PRs reviewed and included where possible. If someone has something they want done, and are willing to put up a bounty for it, then that has a tendency to turn management's head.

Brian

--
Brian J. Miller
Rustici Software
brian.miller@rusticisoftware.com

jhaag75

unread,
Apr 13, 2018, 11:25:36 AM4/13/18
to xAPI-Specification

Thanks so much Brian for the info! 

I also had Balta (Rage project) respond via linked. Going to share his response and resources with everyone below in case anyone is interested. He also touches on that mono issue you brought up.

------------------
From Balta:

We have implemented several platform specific (Unity, .NET, JS) trackers to send data to our platform. These trackers simplify the communication with our platform from the game developer point of view. Although our server side API is not strictly a LRS compliant API, we send almost complete statements through the trackers, so you may be interested in these repositories: https://github.com/e-ucm/unity-tracker https://github.com/e-ucm/csharp-tracker https://github.com/e-ucm/dotnet-tracker https://github.com/e-ucm/js-tracker 

In the particular for Unity you should check https://github.com/e-ucm/unity-tracker/blob/master/UnityBridge.cs that is the Class that has the functionality related to send data to our REST API. The pinpoints / pains regarding the implementation of the Unity tracker were that the stable version of C# is compatible with .NET 3.5 and this imposes a lot limitations, in particular it is not possible to use the Task or other high level threading/concurrency features (async, etc.). 

The other main problem that we find out was TLS / SSL support (https://answers.unity.com/questions/1381396/unity-ssl-tlsexception.html) so we had to implement a workaround. Note that seems that this issue is related to the use classes included in Unity’s Mono runtime and we had to use them to simplify the compatibility between platforms. e-ucm/unity-tracker unity-tracker - Unity gleaner tracker that uses csharp-tracker https://github.com/e-ucm/unity-tracker 

Let me know if that helps you and keep in touch about it.
Balta
--
Reply all
Reply to author
Forward
0 new messages