Arrays - How Many is too Many?

Discussion and feedback on Construct 2

Post » Sat Mar 12, 2016 4:10 pm

Hi all,
Bit of a strange one, but I'm wondering if anyone has experience of using a lot of arrays in a C2 project? By a lot I'm talking around 1,000 - 1,500.
I'm working on an RPG style game and this number of arrays is due to the number of items in the game that will need an inventory and/or outcome text (to clarify this is for desktop, not mobile).
I have everything working with a few objects and 100 arrays, so just wondering if I'm going to push things too far having thousands? I'm thinking that as it's only text data then it shouldn't really be an issue on performance, but my main concern is around saving, as all of this array data will need to be saved to a local storage fairly often (via json strings in a dictionary that is then saved to local storage).
Any wisdom or experience would be appreciated, thanks
B
15
S
5
Posts: 141
Reputation: 1,657

Post » Sat Mar 12, 2016 6:02 pm

I wouldn't worry about it unless it becomes slow to save/load.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756

Post » Sat Mar 12, 2016 6:41 pm

Construct 2 was designed to handle complex projects as well, so I'd say you don't have to worry about this.
B
128
S
33
G
17
Posts: 1,551
Reputation: 20,488

Post » Sat Mar 12, 2016 6:57 pm

Mostly like other development tools, when your application runs out of RAM memory.
B
20
S
6
Posts: 118
Reputation: 1,711

Post » Sun Mar 13, 2016 8:14 am

SecondDimension wrote:Hi all,
Bit of a strange one, but I'm wondering if anyone has experience of using a lot of arrays in a C2 project? By a lot I'm talking around 1,000 - 1,500.
I'm working on an RPG style game and this number of arrays is due to the number of items in the game that will need an inventory and/or outcome text (to clarify this is for desktop, not mobile).
I have everything working with a few objects and 100 arrays, so just wondering if I'm going to push things too far having thousands? I'm thinking that as it's only text data then it shouldn't really be an issue on performance, but my main concern is around saving, as all of this array data will need to be saved to a local storage fairly often (via json strings in a dictionary that is then saved to local storage).
Any wisdom or experience would be appreciated, thanks


I use arrays quite a lot since my game is SRPG and it's vastly faster to parse through bytes of data than parsing through megabytes of sprites and I don't have issue yet with anything connected with saving/loading nor arrays.
B
36
S
18
G
11
Posts: 248
Reputation: 8,694

Post » Sun Mar 13, 2016 2:14 pm

Thanks guys, seems like not it's not going to be a deal-breaker then. I'll keep ploughing on!
B
15
S
5
Posts: 141
Reputation: 1,657

Post » Fri Apr 15, 2016 6:47 pm

I'm having constant crashes when i try to save the state of at tilemap wich has 2300x2800 tiles. Could it be related to this?
B
7
S
2
G
1
Posts: 17
Reputation: 534

Post » Fri Apr 15, 2016 6:59 pm

If some javascript takes too long to run the browser will give you an option to stop it. As long as it wasn't an infinite loop in your code causing it you can let it continue an it will complete. AKA it wasn't a crash.

That said, saving a tilemap of that size may be the reason it takes so long.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756

Post » Fri Apr 15, 2016 9:50 pm

R0J0hound wrote:If some javascript takes too long to run the browser will give you an option to stop it. As long as it wasn't an infinite loop in your code causing it you can let it continue an it will complete. AKA it wasn't a crash.

That said, saving a tilemap of that size may be the reason it takes so long.


Well, on nw.js it just closes, and in chrome it says the page has an error. I have to try on firefox yet. It doesn't even try or take too much to display that error or close, it seems that it doesn't even tries.

BTW, i have looked a lot of your examples on this site, and they have been really helpful. I really appreciate your work here.

EDIT: well, it seems that the crash does not ocurrs when it saves, but when it tries to load it. Instant crash.
B
7
S
2
G
1
Posts: 17
Reputation: 534

Post » Fri Apr 15, 2016 10:37 pm

Sounds like a bug to report. It shouldn't crash.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756


Return to Construct 2 General

Who is online

Users browsing this forum: jefftrier, vikuserro and 4 guests