Creating load of objects makes a lag - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Creating load of objects makes a lag (
/showthread.php?tid=650206)
Creating load of objects makes a lag -
ranme15 - 23.02.2018
Aye
When I load a map, I create a pretty much huge amount of objects, and when I spawn the player the objects get streamed all at once, and it usually creates a little lag. How could I prevent it?
any ideas are welcomed!
cheers
Re: Creating load of objects makes a lag -
PepsiCola23 - 23.02.2018
Most efficient way is to create a timer that freezes the player when he enters an area where there are a lot of objects for 5 seconds until the objects appear and then unfreeze the player.
You can also make it look better by making something like a loading screen ( black screen + some images with a loading progress bar )
Re: Creating load of objects makes a lag -
ranme15 - 23.02.2018
Quote:
Originally Posted by PepsiCola23
Most efficient way is to create a timer that freezes the player when he enters an area where there are a lot of objects for 5 seconds until the objects appear and then unfreeze the player.
You can also make it look better by making something like a loading screen ( black screen + some images with a loading progress bar )
|
This is not what I asked for. I asked for an idea to avoid the lag that occurs when a load of objects being streamed for a player at once. (When he gets teleported to the spawn point)
Re: Creating load of objects makes a lag -
PepsiCola23 - 23.02.2018
you said
its a good idea btw . but good luck
Re: Creating load of objects makes a lag -
ranme15 - 23.02.2018
Quote:
Originally Posted by PepsiCola23
you said
its a good idea btw . but good luck
|
Yes, I said any ideas RELATED to my request is welcomed. Please avoid from posting just for increasing your comments and rep.
Re: Creating load of objects makes a lag -
NaS - 23.02.2018
You can play around with the relatively new Chunk Streaming feature of Incognito's Streamer (requires newest version, I think):
Код:
native Streamer_ToggleChunkStream(toggle);
native Streamer_IsToggleChunkStream();
native Streamer_GetChunkTickRate(type, playerid = -1);
native Streamer_SetChunkTickRate(type, rate, playerid = -1);
native Streamer_GetChunkSize(type);
native Streamer_SetChunkSize(type, size);
Enable chunk streaming and set a chunk rate and size for STREAMER_TYPE_OBJECT. The rate should be similar to the Streamer TickRate and the size is afaik the number of objects to stream in one chunk. Play around with the values to find the right settings.