generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Can DataStores lag your game?

Previous Thread :: Next Thread 
Cryp_tic is not online. 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
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
13 Feb 2017 03:30 AM
how often/how are you saving?


Report Abuse
direMitten is not online. direMitten
Joined: 18 Jun 2015
Total Posts: 1294
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 is not online. 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 is not online. 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
Snowskateer is not online. Snowskateer
Joined: 06 Dec 2011
Total Posts: 4647
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
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
13 Feb 2017 05:59 AM
hes probably saving it every time he buys something


Report Abuse
Cryp_tic is not online. 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
Snowskateer is not online. Snowskateer
Joined: 06 Dec 2011
Total Posts: 4647
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image