Hey LÖVErs!
I'm toying around with prototyping a sort of real time, tactical game, played on a grid. It's nothing special right now, as I've just been getting basic movement and networking set up. Everything is working right now, but the networking just seems too slow for real use, even with two players on a local connection.
Anyone interested in looking over my code (it's not too much, less than 500 lines still), and seeing if there's something I should be handling differently to speed things up? The "game.lua" library has no networking stuff in it, so it can probably be ignored. The server won't run on windows right now, as I'm using "uuidgen" to give things ids, but the client should.
Should I be sending less packets but larger? More but smaller? Trying to parse more packets at a time during "love.update()"? Do I need to thread things or something? Bah, I've reached the point where I just don't know!
Preemptive thanks to anyone who looks!
Networking too slow for live multiplayer?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- notyetawizard
- Prole
- Posts: 3
- Joined: Wed Jul 01, 2015 8:24 pm
- Contact:
Re: Networking too slow for live multiplayer?
As far as I could see, you're sending data over the network every frame; instead, try to send data only x times a second.
I'd suggest x being 30.
I'd suggest x being 30.
Re: Networking too slow for live multiplayer?
What is the actual slowdown you're experiencing? Networking logic taking a while? High latency on local connections?
- notyetawizard
- Prole
- Posts: 3
- Joined: Wed Jul 01, 2015 8:24 pm
- Contact:
Re: Networking too slow for live multiplayer?
I am checking for updates to send every frame, but nothing sends unless there's an update. This ends up being about twice per player movement speed, times the number of players—only about 8 times a second, with what I've currently been testing.
While the latency of our local connection isn't great, it's been sufficient for other online gaming, and I'd be hesitant to blame it for anything. The slowness is very probably coming from my code somewhere, but I'm new to networking and don't have a clue where.
While the latency of our local connection isn't great, it's been sufficient for other online gaming, and I'd be hesitant to blame it for anything. The slowness is very probably coming from my code somewhere, but I'm new to networking and don't have a clue where.
Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot] and 17 guests