Announcement

Collapse
No announcement yet.

Network testing across multiple computers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Network testing across multiple computers

    Hello,

    I have been practicing/working on a Blueprint, networked game and currently want to test that it works across multiple computers and not just in the editor but am rather unsure as to how to go about doing that. Currently i have packaged the game and have created 2 shortcuts to the launcher, i have edited the target and added Eclipse?listen -game for the server and 127.0.0.1 -game for the client, however this doesnt seem to do anything. can anyone point me in the direction of some documentation that may help or let me know what I am completely missing?

    Thanks
    Rengee

    #2
    After a little more looking i have found someone else attempting to do something similar here https://forums.unrealengine.com/show...fter-Packaging and was facing the same problem

    Comment


      #3
      Hope this helps.

      Hello, i was in this exact position not long ago but with help from other users i manged to figure it out, and so i hope this helps.
      I am sorry if i use some of the wrong terms as i am still very new to UE4 as well.


      I also tried using the method of creating 2 targets from my .exe of the game, however i was having trouble with it for some reason and so i just did it in the console in-game so that i know i am doing it all correct.
      Also, when you talk about testing the game over multiple computers, do you mean having for example, a friend from a different network connect to your game? or do you just want two computers on the same network as you (eg two computers at home) to connect together? Either way i will try my best to give an explanation of both below.

      How to setup a server and connect locally (Two computers at your home/ on your home network)

      The Server Setup :
      1. Package your game using the 'Development' option in the 'Build Configuration' - This allows the use of the console so you can use it to connect and host the game.
      2. After game is packaged successfully, locate to the folder containing the .exe file. Open up the .exe once for the moment. (If windows asks for permission to run, or access over the network then allow them). Now, you should have one game open
        currently.
      3. Open the console (using ` Key), and type...

        Note : When i have done this in the past, i noticed sometimes it was not working when i would use the shortcuts (typing the first letter and pressing the arrow up key to the shortcut and pressing space to auto type), for what ever reason (probably fixed or just was me typing it in wrong), and so to be sure, i would type every letter out of the command. I hope that makes sense

        Open MapName?listen


        (Replace MapName with your levels name, and i leave out the '-game' usually and it still always works for me, but maybe someone more in the know than i can confirm when to use the -game and if its necessary?)
      4. This should open your level as a listen server.

        The Connecting :
      5. Now, you want to open the 2nd version of your game, whether it be on a different computer in the house or on the same PC.
      6. Allow and grant access again (if windows asks for it) (If not its ok)
      7. Open up the console on this 2nd game, and type...

        Open 127.0.0.1


        You could also open a local connection the the server (what the above does) by using your local Ipv4 address, which you can find by opening your command prompt, and typing.... ipconfig . This should show lots of information but what you want is the Ipv4 address. Now you can just replace the '127.0.0.1' in the console command with this Ipv4 address and it should still work. Again this is not necessary but can be done this way as well.Picture to help.



        You want to use the Ipaddress circled in red if you try using this way. Sorry but i covered up some of my stuff, i honestly don`t know if i need to but i just did it anyway.
      8. After pressing enter, with the command typed out properly, you should connect fine.




      Now if you want to host a game, and have a friend or someone on a different network connect to your server, the following is what you want. It is a little bit more complicated than the local host, however i will try my best to explain.

      How to setup a server and have Public Connections to it. :

      The Server Setup :
      1. Firstly you need to find out what port Unreal engine is using, By default it is 7777, however you can change it in the .ini files for the engine.

        For a explanation of ports, when i posted for help for networking, i had a helpful response from user 'birdfreeyahoo' on the answerhub.
        I am going to link to the post that i had posted on answerhub a while ago as it has some very helpful responses and might help you. The port explaination is by 'BirdFreeyahoo' on that page. Thanks to both of the users who replied!
        My Post that might help you if this reply does not

      2. Go to the folders for the enginge that read, 'Engine > Config > baseEngine.ini'. Open the baseEngine.ini file and look at the top there should show what port number the engine uses.


      3. Now, you are going to need to port forward. To do this i am sure there are some guides for what ever ISP you are with. ( I am with British Telecom (BT) so if you do happen to still have trouble and are on BT i might be able to help you further but i am sure there good help online for port forwarding you can use.) When port forwarding you want to open the port 7777(or what ever you may change in the .ini file), that is if you want to use port 7777 for the unreal engine. Some people have expressed difficulty getting port 7777 open and working, including myself, so i change the port number(in the .ini file) to a port that was already open, for me i did port 80 so i could see if it actually worked. I know this is probably a bad idea as it is already assained to something, so i will be changing that)

        To check what ports you have open, you can use this site - http://www.yougetsignal.com/tools/open-ports/ (However i cant be sure that they are always accurate from what i heard, so you should test whether your port forwarding worked by trying to host and getting a friend to connect.
      4. Now that you have got the port that is assainged to unreal engine OPEN, instead of sending a friend any of the Ip addresses i have mentioned earlier, you need to send them your public IP address.(I made this mistake).
        To find what your public Ip address is, go to this website
        This is the Ip you give to your friend or who ever on a serperate network so that they can connect.

        If you make any changes to the .ini files, you will have to repackage your project for PUBLIC multiplayer testing with the ports and public Ip

        Hosting :
      5. Now to actually host it, do all the same things as before, so launch the packaged packaged project .exe on your computer.
      6. open the console and type the same command. (replacing MapName with your level name)
        Open MapName?listen
        This should launch whatever level you typed in, as a listen server.

        Connecting to server - Public :
      7. For your friend/person on different network to join, you need to send them your PUBLIC ip address (the one you got from the 'whatsmyip' website).
      8. They need to launch their game .exe, (from the packaged game you sent them) and open the console.
      9. They need to type into the console.....

        Open IPADDRESSFROMWEBSITE:PORTNumber
        (Replacing IPADDRESSFROMWEBSITE with whatever Your public ip address is from the website. Replacing PORTNumber with what ever the port is that you opened. There must be a colon between them)
      10. Thats it! They should connect fine. (Make your you have some kind of mesh for the player so that you can actually see them in your level)



      Once you have it working, you can have the whole process of hosting and connecting much more simplified by instead of typing the console commands, having events that will 'execute a console command' with the neccesairy commands for example, a button press.


      I hope this has helped, i am sorry if i used wrong terms or made it a confusing read. You should also take a look at the post i made a while ago (linked above) as it has 2 really helpful responses that probably explain it better than i have tried to here.

      If it still does not work or have any questions, just reply to this and i can send you my skype name if i can be of any further help.
      Thanks!
      Last edited by Lawrie; 08-11-2014, 11:18 AM.

      Comment


        #4
        This is brilliant thanks! it seems i was definitely on the right track i just missed the port forwarding step which i had seen mentioned but not in detail and wasn't sure about. Sadly i cant access my router and do the port forwarding until at least Wednesday but i will update this thread when I gain access. Once again thank you for the help and great explanation!

        Comment


          #5
          Originally posted by Rengee View Post
          This is brilliant thanks! it seems i was definitely on the right track i just missed the port forwarding step which i had seen mentioned but not in detail and wasn't sure about. Sadly i cant access my router and do the port forwarding until at least Wednesday but i will update this thread when I gain access. Once again thank you for the help and great explanation!
          No problem.

          Comment

          Working...
          X