Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by plungeint

Hi,

I'd like to know if there is any list of suggestions somewhere in the documentation, or maybe you could help me.

I have a game made with Impact, similar to "sims". The game runs smoothly, but sometimes it gets frozen for several seconds, and/or the character goes much slower.

Looking at the documentation I've seen that I might use BackgroundMap instead of an Image for the background, and set the preRender property to true. Are there other performance improvements that I might use?

Thanks

1 decade ago by gxxaxx

For me the big performance hit comes from the garbage collection. Game runs great, then every little bit there is a delay spike while something (I assume is garbage collection) goes on.

If you have not used the debugger check it out. Is easy to implement.

http://impactjs.com/documentation/debug

1 decade ago by plungeint

is there any way to manually execute the garbage collector in controlled situations? (for example pause screens)

1 decade ago by quidmonkey

You might find this helpful.

1 decade ago by Graphikos

Does the problem occur on all browsers/platforms? Pausing for 'several seconds' would have to be a pretty major GC event.

There is no way to manually execute grabage collection. Like the article quidmonkey suggests you can do many things to try to minimize the amount of garbage you create which in turn minimizes how often the browser runs GC or at least the pausing is minimized some.

What does debug show when the pause happens? If it's not GC it should be possible to track down what is causing the excessive processing. Assuming you aren't doing crazy expensive loops every update or something then drawing is typically the most expensive process. This is why pre-rendering is helpful.
Page 1 of 1
« first « previous next › last »