UDK Multiplayer Now Possible!

After an insanely long time with no progress made on the multiplayer front, I am excited to announce that a breakthrough has finally been made. Before I continue I must thank XstreamTech (visit his YouTube channel!), without whom this would not be possible.

So, where were we? If you remember from this post, we could get a server browser working using Gemini but were completely unable to connect. The key is to use the ConsoleCommand(“open xx.xxx.xx.xx”); line instead of “open [IP]:[Port]”, where the x’s are the IP address. The reason is that this frees UDK from using a specific port.

Secondly, your host must have already forwarded the correct ports (6500, 7777, 7778, 7787, 13000, 27900, with 7777 being default and 7778 primary backup) in order to connect. XstreamTech recommends using Port Forward to set up your router if you plan on being the host. I am still looking for a script solution to do it automatically so it’s not so much trouble for the end-user.

In order to get a match going you must:

  • have the host use ConsoleCommand(“open [map name]?listen”);
  • have the client(s) use ConsoleCommand(“open xx.xxx.xx.xx”);

It also helps to disable Steamworks. Although not necessary, I find that Steamworks is generally annoying and useless at its current state anyway.

To reiterate, we have the host open a map and listen for clients to join. Gemini will then add its IP and map information as a server onto the Gemini Server Browser. Clients using Gemini will be able to see the host, then when they select the server UDK grabs the IP from Gemini, executes an open command, and connects flawlessly.

It’s a wonder I never thought of it for two months.


21 thoughts on “UDK Multiplayer Now Possible!

  1. Hi Willy, 1st i want to say Thanks alot for your tutorials.
    but here i have some problems with my LANmultiplayer. Okay let me explain 1st

    in my game i have player and the player need to pickup coins and when the player take the flash (Scaleform) will announce the score, The score and flash already work. But when i cook the second player(join) the scaleform or flash doesn’t appear. but the host/server player appear.
    Do you know how to explain what i need to do? thanks willy and sorry for my language bad. πŸ˜€

  2. Thanks a lot for your suggestion.
    Before i posted here actually i already thinking its about, i need to “replication” my script.
    so yeah, maybe its number 2 what i am missing,but because i dont know how to write a script.
    maybe i need to leave this problems :(. Thanks Willy

    • yea replication can be really hard at first. but take it one step at a time, i would suggest finishing the rest of your game before trying it again. once you get the idea it takes a really short time to get multiplayer in

      • you are really good man. sure thanks alot for your advice Willy.
        Actually it’s because i don’t want to do till finish. But it’s because i dont have any basic in scripting. Sure i already trying but its still cant to do it, maybe i need to learn from basic to understand type of classes script on UDK πŸ˜€

  3. Hi Willy,
    i am trying to add new effects to my weapons, when weapon fir’s empty bullets must get ejected out of the weapon, i saw that on your videos (crucible weapons) , i am trying to implement that on my weapons.
    could you make a tutorial on that please .

  4. Hi Willy, I just stumbled on this page as I am looking for answers to multiplayer in UDK. I tried to lan 2 computers together with UDK to only fail. Does the above work for this situation?

      • Not quite. is called a Loopack IP Address. It’s an address that points to the computer that you are currently using.

        If you’re connecting in a LAN game enter the IP Address of the computer you want to connect to. On the server computer click Start, type cmd and open the cmd program. Type ipconfig and press Enter. Then look for your IPv4 Address on the connection you are using: Ethernet or Wireless. it’s usually 192.168.x.x or 10.x.x.x.

  5. I cant understand what is the main strategy for creating a multiplayer online game with Gemini/UDK, can you explain me?
    I worked in a multiplayer Unity project using smartfox server and the game logic is behind the server service in this case, the clients just send the information to the server, the server process everything and send back the back to the clients.
    In UDK the server is one of the clients? and Gemini only manage the resolve address problems?

    • Yes UDK handles both the server and the client code. It is also possible to create a dedicated server using UDK (sort of like your Unity experience), in that case the server just hosts the map and does not play.

      With respect to multiplayer, yes Gemini pretty much just stores the IPs of any active servers, which UDK then asks for and uses to connect.

      • Thanks a lot,.. this clarify a lot of things to me.
        you think is possible to create a multiplayer iOS game that the iPhone will run the server and use Gemini to connect players together to play a online realtime game?

        • Sure, I don’t see why not. But for iOS isn’t there multiplayer support through Game Center? I would try that route first because then you also get all the score handling/displaying and friend features, etc.

  6. Hello. I have found this site while browsing for a solution for my LAN game project at the University. How can I use Gemini? Where should I put the files to connect with others? I’m sorry, but I’m kind of new to this and my professor insisted on using UDK… I have replicated my functions and my game works flawlessly when I use a server and two or three clients on the same PC but fails to connect two PC together. Please help….

    • Connecting two PCs together is outside of Gemini, and is a router/network issue. You have to make sure that the appropriate ports are forwarded on each PC. UDK uses 7777 and 7778 mostly, but also some others (see article).

      Gemini just acts as a place to store IPs of servers that are currently running your game. The idea is, once you start a server on Computer A you send its IP to Gemini. Computer B then grabs a list of IPs from Gemini, and now knows Computer A’s IP and can connect to it through console commands.

      Let me know if you’re still having problems.

      • Ports forwarding is an issue when 2 computers are on different LANs seperated by the internet. There’s not way to forward a port inside a computer, because it’s just one computer. However firewall or anti-virus software on the computer could block the connections, and you may have to open the ports in your firewall, or disable it to test and see if that’s the issue.

  7. Pingback: Some Gemini Tutorials | WillyG Productions

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s