#HIGH PING ON ONLINE 2D STICKMAN GAME

42 messages · Page 1 of 1 (latest)

near dew
#

I NEED HELP! Hi guys, I created and published a game called Stick Of Duty, with an online multiple room system that communicates with a mirror. However, for some reason there is excessive ping in the game and this generally makes the game unplayable. There is no event that overloads the server or client. In addition, I use distance interest management. What might be causing this high ping? If you want to see it for yourself in the game, you can find it in the play store under the name Stick Of Duty: Zombies. Please help, I am using your system and I have been getting very high ping for a long time. I would be very glad if you could help me. Thanks.CryInside

zenith raven
#

hihi, if you add in network ping display component, what kind of ping is it showing?

#

High ping can be caused by a few problems, main one being in my exerpienced, is poor server performance, it cannot handle the amount of data (cpu and network), so it gets slowed down, resulting in what is seen as increased ping.

#

So you need to optimise server build, increase its framerate (if its 30, try 60)

#

Lower network data being sent (such as NetworkTransform send amounts), and making sure client-code, features, effects etc isnt running on server.

  • This should get you started, otherwise we need more info/access.
near dew
#

1-high(140-180)
2-server has 6 CORE Platinum, 12 GB RAM DDR 4, 80 GB SSD
3-build already have 60 framerate on code. I already did that.
4-I cleared all unnecesarry datas and lowered send rate of some datas.
5-But some graphical events occur on the server, for example, when a bullet prefab is spawned, it is of course spawned on the server and it becomes an object with a view, but I do not think this will cause a graphical problem because I know that graphical operations are not performed in serverbuilds.

fast wren
#

High ping could also be due to the location of your server. Is it close to the user's location?

The server might be near you, but it may be far from someone who installed your app from 10,000 km away.

Could that be a reason?

near dew
#

It's near, but on the pc theres no ping problem its just on mobile build

#

Im building for android and using IL2CPP, and .NET Standart 2.1

near dew
#

@fast wren

#

@zenith raven

#

Please

fast wren
#

How are you calculating ping?
Are you using mirror inbuilt one or have you implemented a custom solution?

#

Okay, problem is game is also not playable.

#

As you have mentioned that it is working fine on PC but has issues on android devices.

  1. Does both the devices are connected via the same network?
  2. If yes, then have you tried on any other android devices too?
near dew
#

YES i tried many many diffrent devices but sometimes it makes ping on pc too

#

Also i tried diffrent ping calculator but result is same

#

Let me paste the game link here can you also test on yourself? Maybe its not about ping

#

You can use "32764" code on promo code section to remove ads

#

its annoying i will fix that

#

@fast wren sorry if i bothering you

fast wren
#

@near dew
Hey,

I’m getting a ping of around 200-300 ms on both servers, which is expected if the servers are hosted in the US or a nearby country, as I’m connecting from India.

Even on our games, when we host servers in the US and connect from India, the ping (round trip time) is typically around 200-300 ms, which is expected.

near dew
#

But that's a problem on my game cause of bullets

fast wren
#

Didn't get you.

Do you mean that the 200-300ms ping that I'm seeing is due to bullet?

#

or you mean this 200-300ms ping will cause issue for bullets?

near dew
#

second one

#

But other games doesen't have that issue

#

Why am i getting this

#

Theres some warnings on game log on server

#

It becasuse audio listeners

#

I am loading scenes as additive thats why there's warning on server cause of audio listeners

#

@fast wren

fast wren
#

@near dew
High RTT due to the server being far away is unavoidable; this is where distributed systems come into play. You need multiple servers close to your target user base.

You can't host a server in one location and expect people worldwide to join and play smoothly. They can join, but RTT will be high. If your game is turn-based and uses TCP, it might work. However, if you're developing an FPS game with UDP, you will likely encounter glitches.

As for the warning, you can fix it by ensuring there's only one audio listener. Keep one in a 'DontDestroyOnLoad' object and remove any other references.

However, I don’t think fixing this warning will reduce RTT since RTT is inherent to the server’s location. We see the same RTT in our games, which is why we host a server in the US for US users and a separate server for Indian users.

zenith raven
#

Remember large ping is also a result of server struggling to process properly everything, both game logic and network data.

short turret
# near dew 1-high(140-180) 2-server has 6 CORE Platinum, 12 GB RAM DDR 4, 80 GB SSD 3-build...

Not networking the bullets would help a lot...that puts a lot of load on server and network message processing and bandwidth, and if clients are far distant from server it will make the game feel sluggish and unresponsive. See TankTurretBase script in our examples, specifically the Shooting section at the bottom. Instead of networked projectiles, it predictively fires them on the shooting client and uses Cmd > Rpc to fire them on server and other clients independently. Server decides damage, clients just do VFX.

near dew
#

It turns out that I need to change the game almost radically. I will try to do what you said tomorrow and will update if I solve the problem. Thank you very much for your help.

near dew
#

Major problem!: I thought about making the bullets the way you said before, but it wouldn't change anything and would even be less efficient. The reason is that there is not a single player in the game, we need to see the shots of the other players and I am already using raycast, there is no bullet moving on the server. The server only deals the damage anyway. How can I solve this another way? @fast wren @short turret @zenith raven

#

I synchronize the bullets because if I don't I'll have to manually synchronize their position, angle, and damage anyway.

short turret
# near dew I synchronize the bullets because if I don't I'll have to manually synchronize t...

You only need the firing point position and direction. clients are VFX only. You can have the shooter send direction as part of the CmdShoot or have server determine direction for itself. Server already knows where players are, and can do the raycast from that, and can tell other clients the direction of the shot (and maybe the firing point) via RpcShoot so they can do the VFX on their side.

near dew
#

That wasn't the problem. I found what was causing the ping. When I tested, I noticed that there was no ping at first and there were no problems. The ping problem was a later problem. Even though it took a long time, I found out what the source was. The zombies I spawn are stored in the pool, and I take them from the pool and transfer them to the world during the game. However, when the player uses the nuclear bomb feature to kill all zombies in the game and the zombie is transferred at that time, some zombies are not killed and are removed from the list. The problem is that those zombies are stored there even when the player leaves the room. They stay on forever which causes the ping.

#

I assigned a simple reference and made it check that reference when the timer expired. If there is no reference, they delete themselves and this solves the problem.