UNet Network and TPC Character Controller Implemented

players can now interact over the network

After several weeks of tug-of-war-to-the-death with the code, we have finally won the battle and successfully implemented our character controller of choice (TPC), complete with network replication of transforms and animations. What all that means is that we can connect Arcanoria Revelations game clients from multiple different computers to our remote server, and everyone can see everyone else’s characters move around and animate propertly. This was a lot harder than it seemed it would be at first, but now that it’s done I can take a little time to write about it.

TPC Character Controller

First of all, I’d like to give a shout out to Justin, the lead developer over at Opsive. Opsive created the Third Person Controller (player character movement/animation controller) that we’re using (with modifications) in Arcanoria Revelations. We got fantastic support from Justin as we dove headlong into some parts of the controller code that had some issues when used in our particular configuration (i.e. using a point-click movement style with a dedicated headless server over the network). With Justin’s help, we were able to make things work. Thanks Justin!

This implementation is big news for Arcanoria Revelations. We’d previously done a “proof of concept” test with the TPC controller, which mostly worked well, but had some glitches with some of the point-click aspects of movement. We worked those issues out pretty quickly, but when we more recently added the network into the equation, there were additional challenges to overcome. Suffice it to say, we overcame them. 🙂 But it took a couple of week of hard work, and many hours of research, testing, trial and error, and trips to the support forums.

UNet Networking

For simplicity and speed of implementation, we decided to use Unity’s built-in networking engine, a.k.a. “UNet”. But this turned out to be much less simple than we anticipated. UNet’s documentation (and most of the user community’s implementations) assumes a single Unity project that contains all the client code as well as all the server code. This works well for peer-to-peer networked games. But Arcanoria Revelations is a MMORPG. This means we need to worry about code and data security. Which means we must use completely separate projects for our server and client applications.

This had far-reaching ramifications, and made it much harder to find relevant discussions and documentation for our use case. But it’s working now, and our server code is securely isolated from the client code, meaning our server security is not compromised by hackers attempting to decompile our executable files. The server files will simply not ever be sent to end users. They will reside only on our servers.

Be the first to comment