Load a BIG array without LAG

Get help using Construct 2

Post » Tue Oct 13, 2015 3:58 pm

i have an array of 1000,20,1, i have in my project on start of layout -> Load from JSON string , i have lag using construct 2 after i paste the array information from the array tool creator, i am using local storage to save information in the array, how i can handle big arrays without lag? i need to load the information from a CSV file? i can use local storage to save information in the CSV file? i cant use Load from JSON string with big arrays?

I don't want to complicate my head with this, i am not programmer, i can handle this construct 2 lag to edit events, my only concern is if this construct 2 lag have any impact in the performance of the game? in the debugger when i tried to see the array i get lag and the FPS down a lot like 9 FPS, after some seconds the debugger return to 58-60 FPS without lag.
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Tue Oct 13, 2015 4:15 pm

Can you post a Capx? I have a feeling the lag is from the local storage.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Tue Oct 13, 2015 4:17 pm

jojoe wrote:Can you post a Capx? I have a feeling the lag is from the local storage.

i am not using local storage in my test project, i just paste the big array and nothing more, i tried with 500,30,1 and this size reduce a lot the lag using construct 2 to edit events , with 200,30,1 i don't have any lag, my concern is if big size array have some impact in the game, the debugger give me lag only when i tried to see the array and this lag is for some seconds, and if i use local storage i need to know if the big array will have some impact in performance.
Last edited by Majinboo on Tue Oct 13, 2015 4:39 pm, edited 1 time in total.
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Tue Oct 13, 2015 4:39 pm

Majinboo wrote:
jojoe wrote:Can you post a Capx? I have a feeling the lag is from the local storage.

i am not using local storage in my test project, i just paste the big array and nothing more.


OK sorry, I am done guessing.

Loading a 1024x1024x1 array from a text object full of Perlin noise values and it is instant. So I am thinking it is not a C2 bug.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Tue Oct 13, 2015 4:42 pm

jojoe wrote:
Majinboo wrote:
jojoe wrote:Can you post a Capx? I have a feeling the lag is from the local storage.

i am not using local storage in my test project, i just paste the big array and nothing more.


OK sorry, I am done guessing.

Loading a 1024x1024x1 array from a text object full of Perlin noise values and it is instant. So I am thinking it is not a C2 bug.


then is normal this lag in construct 2 and in the debugger? i don't need to worry about the performance of the game using big arrays with Load from JSON string?
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Tue Oct 13, 2015 4:48 pm

If you're loading the array once, you'd at most get a pause depending how big the array is. If it's impacting the fps then that sounds like you're loading the array every tick.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Tue Oct 13, 2015 5:07 pm

R0J0hound wrote:If you're loading the array once, you'd at most get a pause depending how big the array is. If it's impacting the fps then that sounds like you're loading the array every tick.


On start of layout -> load from JSON string..... i need to add trigger once in this event? i only have lag when i am using construct 2 to edit events and in the debugger only when i check the array and for some seconds, but i don't have lag when i open the game normally in the browser.
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Tue Oct 13, 2015 5:41 pm

Ah, I misunderstood. So if it only happens in the debugger I'd say that can be expected since the debugger does more stuff such as displaying all the values in the array.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Wed Dec 02, 2015 2:11 am

i think its best to use a text file instead of json string i am try to know how to load array from file myself
B
9
S
2
Posts: 66
Reputation: 717

Post » Wed Dec 02, 2015 9:16 pm

Yes load the array from a project file instead of pasting a huge array into the event sheet.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,680


Return to How do I....?

Who is online

Users browsing this forum: draiza and 7 guests