Networking Without LAN [solved]

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
harrison
Prole
Posts: 17
Joined: Tue Feb 03, 2015 5:24 am

Networking Without LAN [solved]

Post by harrison »

I was wondering how I could network a game that could connect with say (for example).. a friend who lives on the other side of the US. How can I make my love hosting game connect to their joining game? I feel like the answer involves port forwarding but I am unsure. Also, it this safe to do for a homebrew game? Do i need to check for anything in particular in my source before I open my program up to the insecurity of the internet? Thanks all.
Last edited by harrison on Mon Feb 09, 2015 11:15 pm, edited 1 time in total.
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

Re: Networking Without LAN

Post by veethree »

Löve comes with lua-enet and LuaSocket which can both be used for networking. There's also a user made library called LUBE which uses LuaSocket but simplifies things for you a bit.

If you want to host a server non locally you first need to figure out on what port the server is running, Then forward that port. Then you and your friend from the other side of the US can both connect to it.
User avatar
harrison
Prole
Posts: 17
Joined: Tue Feb 03, 2015 5:24 am

Re: Networking Without LAN

Post by harrison »

@veethree
Thank you for the information! I will look into port forwarding further. Do you know if port forwarding home-made games is (relatively) safe compared to professional games?
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Networking Without LAN

Post by Karai17 »

I'd like to note that LUBE also supports lua-enet.

If you want to play a small game with your friend, port-forwarding and hosting your own server should be fine. If you want to set up a dedicated server for your game, you may need to purchase a virtual private server (and scale up as needed).
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
harrison
Prole
Posts: 17
Joined: Tue Feb 03, 2015 5:24 am

Re: Networking Without LAN

Post by harrison »

I feel that my main question has been answered so I will try to add a [solved] tag if I can. I may actually be able to make some fun coop games now with a little research :D
Thanks veethree and Karai17.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Networking Without LAN

Post by Karai17 »

On a final note, I highly recommend using ENet for any multiplayer games. Using TCP to send statistical data would be fine if it was relevant to your game, but ultimately ENet is a fantastic protocol designed specifically for real time games in mind.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests