C# MMO Backend and Unity

Hi!

I've created a MMO backend in C# that I'm currently connecting to using Flash for the client side. Since Flash doesn't have any hardware support for rendering and my game is in 3D I'm leaning towards using Unity3D for the client instead. The protocol I'm using consists of three parts. A command, data length and the actual data. All stored in a byte array and sent back and forth between the server and client. Is it possible for me to use unity3d and communicate with my server as it is, or do I have to set up some other RPC system?

Yes, if your server uses normal socket connections for communication, you can use .net's socket library for sending and receiving information to and form your server.

You would use the same socket progamming code in C# in unity that you would use if you were writing a windows form c# client to talk to your server, with the only caveat that the current version of Unity uses .Net 2.0 rather than the latest version of .Net (I'm guessing this makes sense to you if you've already written a c# server app!)

I posted some sample TCP Client Socket code in another Question that might be helpful. It's String-based, but it wouldn't be hard to develop whatever protocol format you needed for your data.

If you’re looking for Socket connection inside Unity, you can use Photon Socket server. If you’re planning to retrieve/store the data, you could use CloudyRec for Unity which provides the backend solution.

Hi,

Great discussion on using Unity to talk to the backend. File I/O and server communication in Unity is a challenge. For beginners, I launched a free, complete “Unity3D & Server Communication” article. Check it out!

-Samuel Asher Rivello
RivelloMultimediaConsulting.com

LINK