Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

398 Neutral

About zgintasz

  • Rank
  1. The ping is measured in-game. Client sends a ping packet to the server, server sends it back and then client measures how long did it take. Hmm, I don't know the traceroute, I don't live in there. How would it help? How much ping can that jitter add up? The CPU is staying up to ~15% all the time now.   Do you mean I should somehow optimise my game to let players play with a bigger ping? It's a 2D platformer shooter, you can take a look at it by clicking the link in my signature.   I'm really not sure how should I be solving this ping problem...
  2. I fixed the CPU rise, turns out I wasn't removing one bullet type from physics world.   However, ping problems are still there. How can I debug what is wrong? I'm using Google Compute Engine, maybe they limit network performance? E.g. asia server is located in Taiwan and player in South Korea has ping ~140 on WiFi, so he cannot play. What should I do?
  3. Hmm, I noticed there is still some lag and high ping. I noticed it sometimes lags even with low ping. Here are some stats:       Why is the CPU always rising? How can I debug what is wrong?
  4. But that it not the latency I am measuring, because Kryonet's networking runs on a separate thread, so main thread's sleep time does not affect it.. And sending update packet only 20x a second and interpolating everything looks and feels nice in reality, I don't think there is anything wrong with it.
  5. I have just pushed the update for my game, so I will take a look at how it will go. I actually am allocating quite a fewobjects every loop. But I'm making thread sleep, so that it runs only 20x a second, so I adjust the sleep time with consideration on how long it took to finish the last iteration. For measuring latency, I use Kryonet's updateReturnTripTime(). I just looked into it, and it turns out it is using TCP... But I'm calling it only 2x a second. I need to check ping repeatedly so that I can extrapolate positions from update packets. I found these parameters on this ServerFault question. Do they actually do anything useful? net.core.rmem_default = 10000000 net.core.wmem_default = 10000000 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216
  6. Okay, thank you, I have implemented it. So now instead of sending lots of TCP events, I include them into a periodical UDP update packet for 5 times in a row. If a player fails to receive any of these 5, then screw him, I do not resend it, he probably has ping too high anyway. And some critical but quite more rare events are still being sent through TCP. I do not have time to implement acknowledging and resending, so will leave that for the future.   This TCP problem is now solved, so back to the topic. I have also ordered a dedicated server from Google Cloud. What can I do for my Linux server to minimize latency as much as possible? Are there any config params?
  7.   Not really. There is just an update packet from both sides being spammed by UDP and some very important packets come through TCP, that do not really happen so often(except shot event, but I'm going to fix it). I did not have time to implement packet loss detection and could not afford to lose them, so I chose this way.   Okay, I get the reason now, thank you. But another option could be to send it 3 times in a row, but with e.g. 5-10ms pause in between. What do you think about it?I 'm thinking which solution would produce the least nasty code without too much time spent implementing it.
  8.     I understand it, but it does not help. I know accumulating data and resending until ack would be the best option, but we are talking about some less time consuming options: 1. include shot event data in periodical update packet for 5 times in a row(if he will not receive any of these packets, then screw him, he probably has ping way > 100 or unstable connection). 2. instead of using sendTCP for each shot event, use sendUDP but 2 or 3 times, to reduce the chance of packet loss.
  9. No, I would not expect that to be particularly helpful.   Could you please talk a little bit more about it? At this moment, I am quite afraid, that UDP update packet will bloat up enormously if I include all the shots for 5 times. Some weapons can shoot 10 times a second and there could be ~12 players. Or should I not be?   And could you tell me why would my method of just sending everyone shot event UDP packet for 2-3 times instead of 1 TCP packet not work?
  10.   So as I see, if there is no difference in performance, it's not really worth to change it, since server is not running on ARM.     Hmm, this kinda breaks a little bit. Could I just send 2-3 repetitive UDP packets instead of your solution? This method would actually be the simplest to implement without breaking too much stuff.
  11. This part was worrying me too. I was using TCP, so that I don't lose packets, because shot events are important. Are you suggesting to send 5 same UDP packets after each shot event? That sounds quite a nice and cheap hack, I really like it. If some of them gets lost, others should arrive. And I save massive amounts of time implementing packet-loss detection and retransmission. What could be potential cons of using this method? I understand this will increase network consumption(player could play on 4G/LTE), but that does not really matter much at this moment. Also, was 5 just a random number? Packet loss rate should be < 10%, so 2 should work fine, right?     EDIT: Damn, I was a little bit wrong. Player does not send TCP event on each shot, I forgot...... I have made isShooting flag in UDP packet, that player spams 30 times a second. However, server still sends to all players TCP event after each shot and each kill, so same should still apply, right?
  12.   Server sends UDP update packets 20 times a second. Player sends UDP update packets 30 times a second. Client sends TCP event on every shot, then server sends TCP shot event to every client.       By OS choice I meant Ubuntu. Would CentOS or any other be better?       Not sure how Kryonet works in back-end, but I thought this would help avoid TCP congestion. If it is using two socket connections, then that might be true.       I am considering this option.     This option seems to be enabled on Kryonet by default.     Which version is it? I cannot seem to find anything useful.
  13. Hey, I'm running a game server for my mobile game. It runs as a Java 8 application and uses Kryonet. It uses both UDP and TCP quite oftenly - UDP for spamming update packets and TCP for shooting and a few other events. TCP and UDP uses different ports, not the same one.   I'm currently running 3 game server application instances, every on different ports of course.   Linux server runs on VPS, stock Ubuntu 14 with a few packages installed. Some players are crying, that they have high ping(> 100), even though they can play other games online well. I am aware, that location plays a big role, this question is not really about it.   What could I do? Is my OS choice bad?
  14. Well, consider some kid purchases tons of items for 50$ and then later realises he is going to lose everything. How about e.g. Clash of Clans game? It seems that it lets you transfer account by Google Plus login or something, not quite sure yet.
  15.   But I don't want to do what is considered general, I want to do what is better for customers. Making them purchase everything on each platform will most likely be a straight path to negative reviews.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!