Having separated client-server code is possible?

I want to avoid having my server code alltogheter with my clients’ code. Is this possible? I come from UDK where this is not possible, and all builds are client-server.

My game’s architecture would be dedicated servers, and clients. And players not being able to create servers on their own.

Is this possible with current Engine build?

Thanks.

It’s possible, but a little experimental. We have a define called WITH_SERVER that will disable all code we deem “server/hosting”.

If you setup your build target to build as a client

public class MyClientTarget : TargetRules
{
           Type = TargetType.Client;
...

}

Then during compilation UEBuildConfiguration.bWithServerCode will be true and WITH_SERVER will be set to 0.

Conversely your “non-client” code will have WITH_SERVER set to 1, so be mindful of what kinds of classes/actors/gamemodes you put inside that define. Anything that is WITH_SERVER or in a module that is compiled WITH_SERVER won’t be replicateable/visible to the client. AIControllers for example might be something you want to keep on the server only.

Thanks. Will give this a try! Thanks.

mmm, ok it’s not very stylish… but in this way can I have only a small binary or my server will be 3GB? (Meshes, Textures, etc…).
If i immagine a gameserver i could immagine a situation like this:

62591-atavism.png

If UE4 doesn’t support the server side programming it’s really really a problem for professional use… for example an MMO like Eve Online or GW2 could be impossible.

Nobody has a better solution of this?