Skip to main content

NDK Sample

To better suit typical scenarios, our Basic NDK Scene also utilizes the RPM Avatar, and its usage is identical to that of Sample Basic scene.

You can find it under Assets > Inworld > Inworld.NDK > NDKSampleBasic.

TalkBasicNew

Overview

The first versions of the Inworld SDK used gRPC and Protobufs as the transport layer for client-server communication. However, there was an ongoing incompatibility with WebGL that needed to be dealt with. We soon found that certain developers were coming up against platform and build target incompatibilities when including other third party gRPC dependent assets or plugins into their project as well.

Version 3 of the Inworld SDK was developed with the goal of addressing these issues. The transport layer has been modularized and we have added WebSockets as the default transportation layer using JSON. We have also encapsulated our gRPC dependencies into a native DLL giving users the option to switch to it if they prefer to take advantage of the improved deserialization/serialization overhead and reduced latency from smaller packets.

FeatureJSON & Unity WebsocketsProtobuf & gRPC
Pros✔️ Text-based and easily readable.
✔️ Straightforward to use and familiar to Unity Developers.
✔️ Supports WebGL and minimizes build target complexities on various platforms.
✔️ Easy to update.
✔️ Use byte buffer to transfer data, reducing network bandwidth.
Cons❌ Difficult to maintain and update, requiring data structure redefinition.
❌ Larger network bandwidth.
❌ WebGL not supported.
❌ Increased build target complexities on certain platforms.

What's NDK

The Native Development Kit, or NDK for short, enables Developers to integrate Inworld.ai characters into a native application. We use Inworld NDK in our Unreal Engine SDK and in other advanced integrations as well.

One of the advantages of utilizing Inworld NDK in Unity is the ease of updates. When updates are released, you only need to download the updated DLL (dynamic-link library). This simplifies the maintenance of your Unity project's integration with Inworld AI Characters.

See the Inworld NDK Github page for more details.

Switching protocols

By default, the InworldController uses the WebSocket-based InworldWebSocketClient. To switch to the InworldNDKClient, simply go to the top menu and select Inworld > Switch Protocols > NDK, and then save the current Unity scene.

SwitchProtocol

Compatibilities

For NDK, compatibility is more limited. Here are the platforms we have tested and confirmed, and we will continue adding to the list after further testing.

PlatformInworld.AI (Websocket)InworldAI.NDKInworld v1Inworld v2
Windows Minimum Version2020.3.48f12020.3.48f12019.42021.3
Mac Intel 64-bit2022.32022.32022.32022.3
Mac Apple Silicon2022.32022.32022.32022.3
Androidonly ARM64-v8a
Oculusonly ARM64-v8a
iOS
Linux×××
WebGL×××