Jump to content

game hosting on external servers


Recommended Posts

Hey, was just thinking about reducing lag so much.

And basically lag is created by 3 factors.
1. distance (IRL) between host and players, greater distance and or more dns lookups is more latency.
2. the processing power of the host's pc, because the game is hosted on his pc, it has to do double the processing work, and double the network usage.
3. i am not entirely sure how the game works to send, receive and process data from the host, but it seems that, whenever data is send from the host to the players, it waits for the players to send the host a confirmation that it received the data. (I believe this is what causes they game and or units to stutter (lag).

Solution
1. allow the use of external server. how? a small program that will act as a server, and modify the game to be able to connect to it using an ip address. This will mostly solve the processing problems, I believe some people are willing to host servers for the game, I know I am willing to use 1 of my servers as a game server for 0AD. Besides the processing problem it will also solve a lot of network issues, as servers in datacenters usually have faster internet and are more reliable, and known to other ISP's dns servers.
don't get me wrong, do not remove the self hosting feature, this suggestion is merely an extension to the existing system.
2. if i am right about number 3 i mentioned before, eliminating the need for player confirmation to the host will greatly improve performance. The host doesn't need to know if the player received the data. It should be just push and go, send something like a hash every request, and if the player sends new data to the host verify that hash to check if the player is in sync, if it's not react fast and send the entire game data to the player with a high importance level, this will cause the player to update his game, therefore also eliminating any out of sync errors forever.

Also switching some of the game´s processing to the player's pc, instead the host, will greatly reduce network usage, thus removing more lag.
some small calculations is already an improvement.

Link to comment
Share on other sites

A remote server application is planned. @elexis wrote something that is for now a hack but could become what you want in the future.

Lag in general is due to a lot of factors notably :

Pathfinder Lag (There are a lot of optimization to be made on the pathfinder,  and some are on their way to be commited before A23)

The game only using a single core whether the processor is an I7 or a P4 doesn't help either as it doesn't use the full processing power.

Lag in MP is caused by:

Synchronization checks

Longer turn length than sp 500ms per turn instead of 200ms

Link to comment
Share on other sites

12 minutes ago, Pierree said:

Hey, was just thinking about reducing lag so much.

And basically lag is created by 3 factors.
1. distance (IRL) between host and players, greater distance and or more dns lookups is more latency.
2. the processing power of the host's pc, because the game is hosted on his pc, it has to do double the processing work, and double the network usage.
3. i am not entirely sure how the game works to send, receive and process data from the host, but it seems that, whenever data is send from the host to the players, it waits for the players to send the host a confirmation that it received the data. (I believe this is what causes they game and or units to stutter (lag).

1. network lag is basically solved since we have warnings if the round-trip-time exceeds the turnlength in both match setup and ingame. The player with the crappy network connection is informed, gets the chance to rearrange his WIFI, can become kicked by the host if he's a spectator, otherwise the players can rehost without that player.

2. CPU / simulation lag is the most prevalent lag issue currently. We have to work with the confinements of what the game can currently handle (1200 units at most and normal to large mapsize that is basically).

It's not only the host's PC, but every client has to compute the entire thing. So putting the hosting mechanism to an external server won't help with the "simulation lag" at all unfortunately.

3. Yep, the next turn is only started once all players finished the computation of the current turn. Could be changed to compute several short (constant duration) turns consecutively without waiting for players feedback, depending on the actual performance.

Basically it's going to be a bit of work, but we've got some plans that we can pull from the drawer.

We also plan to add a dedicated hosting, but that's mostly relevant for ensuring rated 1v1s scoring and providing a host for people who can't host with STUN nor port forwarding.

  • Like 1
Link to comment
Share on other sites

Guest kazutoo
1 hour ago, stanislas69 said:

The game only using a single core whether the processor is an I7 or a P4 doesn't help either as it doesn't use the full processing power.

Any working progress on adding support for multiple cores? to your knowledge.

Link to comment
Share on other sites

Creating a threading model for an app is complex period each thread must be self contained and not dependant on any other concurrently running thread which is why Stan's comment is important have look at our open bug list is kinda long ;) Threading complicates debugging by several orders of magnitude .

Enjoy the Choice :)

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...