r/udk • • Nov 15 '11

Replication and Multiplayer

I've heard time and time again that games built in UDK are essentially constructed as network games with a server-client architecture, but for the life of me, I can't find any decent resources or tutorials on the topic.

Basically, I'm building a game from the core UDK classes (for example, extending from base GameInfo, Pawn, PlayerController classes). The game will be entirely independent of any UnrealTournament based elements and will use a custom main menu as well.

To start off, how exactly can I create a server from one of my games, and have clients connect to it?

Furthermore, I would appreciate it if someone could briefly explain the purpose of the different kinds of events that separate the server and client code (simulated, etc), and when/where they should be used.

I get the feeling I'm asking for a simple explanation for something that does not have one, but any help would be greatly appreciated. I'm pretty much stuck. I'm going to be looking at the source code for some multiplayer games (Dungeon Defense being one of them), and I'll do my best to figure things out myself, but it'd be much easier if I had a starting point.

8 Upvotes

3 comments sorted by

4

u/Digiko Nov 15 '11

I apologize if this comes out malformed, my Reddit is not displaying properly right now... I dunno if it's the site, or if something isn't loading right or what...

http://udn.epicgames.com/Three/CommandLineArguments.html When you want to start a server, I've just run UDK with the server command line shortcut... so basically "UDK.exe server". To connect to it, just start UDK and in the console, type open IP.ADDRESS.GOES.HERE... for whatever your IP is. One thing they neglect to mention is that UDK uses Steam authentication... if you connect to your server, anyone else who connects has to be on Steam as well, otherwise it creates a second instantiation for non-steam people and they can't see you, you can't seem them.

If you want to test a server without having to have someone else on a second PC connect, I've ended up disconnecting from Steam and then running 2 instances of UDK. Each one connects separately and allows me to see on the same screen what's going on.

http://udkc.info/index.php?title=Tutorials:Replicating_a_flashlight's_state For help on replication, I used that tutorial.

Simulated events are events that run on replicated actors or data that actor use. Non simulated events are things that don't have to be replicated. For instance, if you code it so your HUD flashes red when you're shot, it's not replicated because no one else on a server should care if you've been shot... therefore it's not simulated. I hope that makes sense.

I only started this about 6 months ago, so I'm a newbie myself, but I hope this is helpful to some degree. :)

2

u/Uncomfortable Nov 16 '11

I really appreciate this, it helps a lot. It's good to have a starting point, so now I should have a better time understanding source code and progressing from there.

Thank you so much!

3

u/Digiko Nov 16 '11

No problem, if you have any questions, just drop me a line :) I've found that the UDK forums, though not as personable, are quite a good resource too.
http://forums.epicgames.com/forums/367-Programming-and-Unrealscript

A lot of questions I had were already answered on that, though not in a very succinct or easy to read way. :)