Hello!
I want to add multiplayer to my games, using TCP and a peer to peer system to avoid servers. I'm using a database to store the IP of the players. Works fine... until I try to connect one client to another one. No incoming connections allowed... So the only way to do this is using a server, right? Where can I get a ultra cheap (or free) server which only sends and receive data to/from the clients? Or is there another way?
Thanks!
TCP peer to peer
- Luke100000
- Party member
- Posts: 232
- Joined: Mon Jul 22, 2013 9:17 am
- Location: Austria
- Contact:
Re: TCP peer to peer
A lot of action pvp games use UDP since it's lighter/faster.
Sure you should be able to make direct connections between players without the need of a server.
Having a server script is useful for enforcing the game logic (preventing client-side cheating/errors) and for lobbies.
You can use free hosting with php for testing this but when you have a lot of players it's a non trivial issue.
Sure you should be able to make direct connections between players without the need of a server.
Having a server script is useful for enforcing the game logic (preventing client-side cheating/errors) and for lobbies.
You can use free hosting with php for testing this but when you have a lot of players it's a non trivial issue.
- Luke100000
- Party member
- Posts: 232
- Joined: Mon Jul 22, 2013 9:17 am
- Location: Austria
- Contact:
Re: TCP peer to peer
If the game runs local it works, but not online.ivan wrote:A lot of action pvp games use UDP since it's lighter/faster.
Sure you should be able to make direct connections between players without the need of a server.
Having a server script is useful for enforcing the game logic (preventing client-side cheating/errors) and for lobbies.
You can use free hosting with php for testing this but when you have a lot of players it's a non trivial issue.
- Luke100000
- Party member
- Posts: 232
- Joined: Mon Jul 22, 2013 9:17 am
- Location: Austria
- Contact:
Re: TCP peer to peer
Does anyone know a free hosting for a small (php) server?
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: TCP peer to peer
It depends on a lot of things, like router and firewall settings, but i know that UDP/Direct Connections also work online as well. Many times, it's not the code that's the problem, but the network configuration.Luke100000 wrote:If the game runs local it works, but not online.ivan wrote:A lot of action pvp games use UDP since it's lighter/faster.
Sure you should be able to make direct connections between players without the need of a server.
Having a server script is useful for enforcing the game logic (preventing client-side cheating/errors) and for lobbies.
You can use free hosting with php for testing this but when you have a lot of players it's a non trivial issue.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- TheOdyssey
- Citizen
- Posts: 52
- Joined: Mon Jul 13, 2015 4:29 pm
- Location: Turn Around...
Re: TCP peer to peer
Most you need to pay for. And if you don't need to pay I would be a bit sketchy about it. However, you can just host your own and then proceed to Port Foward your router. This has always worked for me but I haven't tried it with Love2D yet. Good luckLuke100000 wrote:Does anyone know a free hosting for a small (php) server?
Re: TCP peer to peer
I've used Altervista in the past, before using a friend's VPS and then buying my own (and, incidentally, switching to a Lua webserver I wrote because I can't make heads or tails of PHP)
You can host a website there as well; you get 1GB of space, 30 GB of bandwidth, PHP5, a MySQL5 database with no more than 20'000 queries per hour, PHPMyAdmin, FTP access, and even an ad system just in case you'd like to try and earn something; you can get more space, more bandwidth and unlimited queries by buying them or using "AlterCents" (ads generate both money and that currency).
You can host a website there as well; you get 1GB of space, 30 GB of bandwidth, PHP5, a MySQL5 database with no more than 20'000 queries per hour, PHPMyAdmin, FTP access, and even an ad system just in case you'd like to try and earn something; you can get more space, more bandwidth and unlimited queries by buying them or using "AlterCents" (ads generate both money and that currency).
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: TCP peer to peer
The thing is, most people's firewalls prevent random incoming packets. This is regardless of UDP or TCP. If you don't have any budget to speak of, I'd suggest doing a Minecraft: Just distribute the server software and let people set up their own servers. For playing over LAN, it'll be easy, and it gives people a chance to test the game. If it's good, some people will bother to set up servers that can be reached online.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
- TheOdyssey
- Citizen
- Posts: 52
- Joined: Mon Jul 13, 2015 4:29 pm
- Location: Turn Around...
Re: TCP peer to peer
Probably the best choice. But people could just take down their firewalls for testing, or, better yet Windows does allow you to chose which programs can pass the firewall. I don't know for sure but OSX and some Linux Distros should allow it as well.T-Bone wrote:The thing is, most people's firewalls prevent random incoming packets. This is regardless of UDP or TCP. If you don't have any budget to speak of, I'd suggest doing a Minecraft: Just distribute the server software and let people set up their own servers. For playing over LAN, it'll be easy, and it gives people a chance to test the game. If it's good, some people will bother to set up servers that can be reached online.
Re: TCP peer to peer
OS Firewalls aren't the problem, router firewalls/port forwarding are. Those are configurable too, but it's harder and if you're unlucky your ISP still doesn't let you have incoming traffic.TheOdyssey wrote:Probably the best choice. But people could just take down their firewalls for testing, or, better yet Windows does allow you to chose which programs can pass the firewall. I don't know for sure but OSX and some Linux Distros should allow it as well.T-Bone wrote:The thing is, most people's firewalls prevent random incoming packets. This is regardless of UDP or TCP. If you don't have any budget to speak of, I'd suggest doing a Minecraft: Just distribute the server software and let people set up their own servers. For playing over LAN, it'll be easy, and it gives people a chance to test the game. If it's good, some people will bother to set up servers that can be reached online.
Who is online
Users browsing this forum: No registered users and 8 guests