Sign in to follow this  
gabenix

Emitter vs Groups - Performance Benefits?

Recommended Posts

Hi All,

 

I've just started using Phaser over the last couple of days and am liking it very much. I've never attempted any serious programming with Javascript, but seem to be catching on quickly thanks to all the available Phaser documentation.

 

My question concerns the performance hit of using "emitters" in place of "groups". I understand that the emitter functions are basically an extension to the groups functions.

 

What I'm doing is creating an endless scroller/runner game format. As the screen scrolls, pre-composed "scene" sections are chosen randomly, then generated off screen and scroll by from right to left. These scenes are composed of platforms, coins, enemies, and various objects.

 

I've been using an emitter for each type of scene object (i.e coin emitter, enemy emitter, platform emitter, etc). Each emitter will generate a scene that will then scroll by, after a certain time has elapsed, another scene will be chosen at random, then generated and allowed to scroll by.

 

I've been using emitters instead of simple groups because it requires less coding on my part to generate each scene.

 

This has been working just fine with no lag or noticable hit in performance so far.

 

My concern is that as the game gets more complicated with more scene objects, will I eventually start to see a hit in performance? The reason I feel this way is that it seems that emitter particles get several physics properties automatically applied to them, some of which i'm not using.

 

Will using emitters instead of groups for this eventually create a performance disadvantage?

 

What would you use to continually generate scrolling scene content?

 

 

Share this post


Link to post
Share on other sites

I think if you build in a kill for the objects crossing the world bound you should be fine to make sure you have some nice garbage collection. If you run into performance issues consider using inheritance to optimize what objects have what physics applied to them.

Looking forward to seeing your game!  :D

Share this post


Link to post
Share on other sites

Thanks for the reply Ben! I suppose converting to and from emitters and groups isn't that difficult and I can test it both ways.

 

The issue I'm trying to overcome now is access to individual particle parameters. I've started a new thread on that subject...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.