UE4 External Server Networking Language

Hello peers,

As a group me and friends are making a very small MMO prototype.

We are using UE4 as the engine.

My question is, should the master server be programmed in C++ or C#?
I’ve tried using the Winsock2 library and I’ve managed to get a multithreaded server to work, but when it comes to the login server, match making server, etc it will get complicated.
To be honest, i’m not that competent/ confident programming in C++, and we have about 15 weeks left…

Can the master server be programmed in C#? I know C# can make an easy connection to the DB and it’s so easy!

I know that c++ will be needed when the game server is running, since UE4 only supports C++/ Blue print.

To sum up, if it were to be done in C# would there be issues? Since the game server will be a separate application from the master server (it will be the UE4 game that other clients connect to).

Or does it need to be written in C++?

How many people are you talking when you say MMO? Unreal can handle up to 64 players in a session at once I believe (thought it was more but this is what I’ve been hearing lately) with it’s own networking system, anything else and you may want to look at another architecture. UE’s is very easy to use and well integrated.

If it’s not suitable, I’d possibly look into another library like RakNet or Photon and integrating those. It’ll save you a lot of time.

You can build Dedicated Server executable’s out of Unreal, so my guess is write it in unreal C++.

Hi. thanks for the reply.

I’m talking instances. So eight people are in match making, and the master Server starts an instance of the game.

My plan is to only build the game server on Ue4,

Would it still be okay to build the server side that deals login, database, etc in c#?

I guess it should be OK.

I wrote an MMO server while ago (using boost asio) and used it together with Unity.
The main disadvantage is that u are not able to use RPC’s, so u need to create network “packets” and process those manually.

I put the MMO project on hold cause it’s just impossible as a single person to create an MMO and the amount of content required is to huge (specially if u are not a modeller)

My friend is testing boost asio and he’s got functionality out of it, but if it was written in C# would it be a problem?

Ofcourse not, no matter if u use boost/asio or async sockets in C#, u are using plain TCP or UDP protocol.
Think i once seen an example of using a TCP socket in UE4, so setting up the communication should not be a problem.

But the game “instance” will have 8 players max?
If UE4 servers handle up to 64 servers, u could launch multiple servers and sync them.

for example
U run 2x your dedicated server and create an uplink between them.
Player1 send chat message.
Dedicated server 1 send the message trough the uplink to Dedicated server 2
Dedicated server 1 broadcast the message to all players
Dedicated server 2 broadcast the message to all players

If u want to make a real MMO capable of few hundered players u will need to work with node servers and keep them in sync anyway.

aah great, that’s reassuring to know, cause my C++ sucks. ironic eh.

Well, each game instance will be it’s own game. So lets say you have 16 people in the lobby, they all press play and then two game instances are made and populated with those players. Game instance 1 will have nothing to do with game instance 2. It’s like a MOBA, sorry.

Maybe u should check UT source code, they have some system with lobby and instance servers.

Sorry, what is “UT” ?

UnrealTournament (on github)

You could also go crazy and try node.js/socket.io.

Single instance can easily handle 1000+ chat clients.

You can easily get the same performance out of an C# server.

server language isnt “important” as long as the protocols match any should be fine.

That’s what I like to hear :slight_smile:

Be smart, use a middleware like RabbitMQ, ZeroMQ, this way you have a plug and play library, easy to interop.

Why not just use TCP / UDP sockets and write your own network protocol?

Either way you’re stuck writing a protocol for your networked data. I don’t really see any advantage of using a message bus like Rabbit / ZeroMQ.

Pub / sub is just a pattern there’s no reason you can’t implement it on your own or find a library that implements it over the transport type you’re using.

Why invent the wheel again ? RabbitMQ is used in production in many companies, it will be more efficient than your home made library. How will you design load balancing on your TCP/UDP home made system ? How will you handle a crash ? RabbitMQ will not fail to deliver the messages even if it crashes.
There is no reason you can’t implement it, if you have a year to spare why not. Now once you are done with this are you going to rewrite UE4 ?

Having myself implemented the networking in a AAA MMORPG in production I can tell you it’s not something you put together in a couple of days.

I use Rabbit at work for messaging - I wouldn’t use it to write a server for a multiplayer game.

He said he would use UE4’s networking, he is just looking for a way to get a master server running that can start game servers.

On a web game I am working on, I launch a controller per machine that consume messages from a rabbitmq server. The client requests a game connection via a HTTP request, the frontend php script then forwards the request to rabbitmq.
It’s very simple to implement, it’s stable, efficient, and took a day to get working.

Am I the only one trying to do server in Java? :slight_smile: