Cryp_tic
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 908 |
|
|
| 13 Feb 2017 03:16 AM |
Is it possible that the datastores i have implemented are lagging my game? Recently we added a save function, so the game has to keep track of users progress, and we added a top robux spenders leaderboard, game also keeping track of that.
I played my game a couple days ago, it was fine. Now all of a sudden, it has become laggy. Any answers?
https://www.roblox.com/games/481150561/UPDATE-PREP-FACTORY-TYCOON |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2017 03:30 AM |
how often/how are you saving?
|
|
|
| Report Abuse |
|
|
|
| 13 Feb 2017 04:30 AM |
| It *might*, but only in some special cases. For example, let's imagine you have an inventory in your game. Whenever players open it, the client asks the server to send the contents of the players inventory from datastores. In this case, it will take # long time for requests between client and server to arrive, ## well ## for datastores to keep up. Besides, you have # limited amount of requests to datastore, so you'll want to optimize this a bit. For example, there's no point updating the inventory screen every time # player opens it. Instead, update it every time the screen opens, IF AND ONLY IF there has been # change to the players inventory. It shouldn't ever result in higher latency for clients, or for the game server to run slowly. Unless you're doing something terribly wrong. If you're not super shy about your scripts, post # link to pastebin with your scripts, and I'll take a look at them. |
|
|
| Report Abuse |
|
|
Cryp_tic
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 908 |
|
|
| 13 Feb 2017 05:04 AM |
| So the save system is in # tycoon. And the player more than likely saves every time they leave. The game has quite # large player base. |
|
|
| Report Abuse |
|
|
Cryp_tic
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 908 |
|
|
| 13 Feb 2017 05:07 AM |
And it isn't auto saving, the player has to click a button.
The lag occurs when purchasing something. You walk over a button and it either doesn't work, or takes a while. This never happened before the system was added. |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2017 05:51 AM |
to save just use
game.Players.PlayerRemoving:connect(function(player) datastore:SetAsync(player.UserId.."_TycoonData",stuffyouwantosave) end)
it can only lag if you're saving constantly, like in a loop. don't do that. it's more than likely your tycoon
NOW GATHER, UNDER THE NAME OF TEAM ROCKET! |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2017 05:59 AM |
hes probably saving it every time he buys something
|
|
|
| Report Abuse |
|
|
Cryp_tic
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 908 |
|
|
| 13 Feb 2017 06:00 AM |
| It's not everytime you buy something. The play clicked # save button, which then gathers the objects they have bought and put them in # data store or something. |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2017 06:02 AM |
| just store what they've bought in # table and then when they leave save the table NOW GATHER, UNDER THE NAME OF TEAM ROCKET! |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 13 Feb 2017 09:08 AM |
just look in dev console and see the scripts hogging up resources
datastores alone have nothing to do with it
|
|
|
| Report Abuse |
|
|