memory issue - 219 objects - 55 FPS - 15% CPU - 7.4mb images

Discuss game development design and post your game ideas

Post » Sat Apr 11, 2015 3:15 pm

I am facing text object update issue.

game start with 219 objects and while execution creates 30+ more objects and deletes as well.

I am using every 0.4 seconds as a loop as no option to work with native looping like while/for etc....

But when I start game again (not thru browser refresh or construct 2 play button), it doesn't release memory and stop updating static text objects (static instance of same object).

It is client game so can't disclose here.

Any help will be helpful.
Image
B
51
S
12
G
1
Posts: 255
Reputation: 4,483

Post » Sun Apr 12, 2015 3:25 pm

Use functions to only update your text objects whenever the text changes. If you can, and this would be better for mobile, replace your text objects with spritefont which don't carry the same overhead.
Last edited by Colludium on Sun Apr 12, 2015 4:18 pm, edited 1 time in total.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Sun Apr 12, 2015 4:04 pm

Thanks for the hint @Colludium .. I will try spritefont
Image
B
51
S
12
G
1
Posts: 255
Reputation: 4,483

Post » Sun Apr 12, 2015 4:20 pm

@socialpilgrim, I recommend using spritefont+. The modified plugin allows you to view the object in the editor as it would appear during run time (almost, I think spaces are not rendered correctly, but it's close). Just search the tutorials and there are some excellent examples of how to use arrays to import the json data into the spritefont object.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888


Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 0 guests