Tipps for resource generation on server side ?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Tipps for resource generation on server side ?

Postby genar » 22 Feb 2018, 15:07

Good evening !

Im currently working on an little game. Everytime the player enters a new chunk, i send an request to the server to spawn some resources like wood or stone. The server side extension loops over a random amount between 10 and 50 entrys and generates a random position for each . Those will be added to an list, pushed into my database and sended right to the player as an ISFSArray. The ISFSArray contains somewhere about 150-300 entrys after the generation, each ISFSObject entry owns an unique id from the database, a position and a resourceType_ID. The client receives them, creates several threads to make the spawning process faster and with less lag. The client spawning process of the received entrys works great, but i noticed that when my player logs in, and new resources are generated, it takes sometime till my client receives them ( 1-2 seconds but still noticeable ).

Is there a way to make the server side resource generation faster or more performance ?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Tipps for resource generation on server side ?

Postby Lapo » 23 Feb 2018, 09:24

Hi,
you should investigate what is the source of the delay you've described.

1-2 seconds could be caused by multiple factors, such as intense work on the client side (rendering?), network lag or a heavy DB query or a mix of all these.

You can exclude network is you're testing locally. If not check what happens locally, is it faster?
Check the client CPU usage when it is logging in. Does it jump to high usage and stays day for a while?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 52 guests