Particle System Too Slow

JoyfulDreamer

  • Posts: 56
I created the "Extended Particle System" (it's on forge), and it's not bad...for a very small number of particles (actors), but once I enable rotation and/or scaling, it's useless. For my game, Martian Worlds, with a simple scene, I can only get 25-35 fps, unless I disable particle effects. Perhaps there's a more efficient way? (perhaps someone can take a look at the particle system and give some input) I published the game as an example of the slow FPS.
Free music at JoyfulDreamer.com and GameMusicWorld.com.

Alexin

  • *
  • Posts: 3132
Using actors for particles is inefficient - they're too "heavy" to handle in large numbers. Use bitmaps or render on the fly. The downside is that you have to replicate some basic operations available for actors (scale, rotation, etc).
"Find the fun"
alexin@stencyl.com

mrcrumb

  • Posts: 7
So is it feasible to write some sort of "fast Actor" class - with some of the flexibility of actors, but less overhead? Is that an option that could be included in a future update of Stencyl? I haven't got into particles like JoyfulDreamer yet, but I do use basic actors to compliment scene design (with no movement / collision / just render only). I'm worried that even that might start to bog things down after a while. I'd be using tiles more often, but based on my grid / tile size, it doesn't give me enough flexibility in their placement.

JoyfulDreamer

  • Posts: 56
Use bitmaps? :/ How? I don't see anything regarding bitmaps, other than drawing an actor, and even then, you can only draw it "as is". I need to use particle system (basic feature in most engines) to give different effects I think should be easy to do by this time in age, so this is my only road block at the moment. I can't optimize any better than I have, and I'm a little apprehensive to being able to add much more game-related content (like enemy ships) without my 25-35fps dropping more. It's already lagging, and there's only one ship and one planet. :(

« Last Edit: June 19, 2011, 02:39:54 pm by JoyfulDreamer »
Free music at JoyfulDreamer.com and GameMusicWorld.com.

odomatic

  • Posts: 16
I believe Alexin is talking about Flash Bitmaps. In order to develop a robust and efficient particle system, you may have to do some AS3 coding...

JoyfulDreamer

  • Posts: 56
I figured also, so I guess what I'm asking is what is the best approach to do that using the Stencyl API...? (or how to work with it)

Thanks.

« Last Edit: June 19, 2011, 11:12:20 pm by JoyfulDreamer »
Free music at JoyfulDreamer.com and GameMusicWorld.com.

Jon

  • *
  • Posts: 17524
So is it feasible to write some sort of "fast Actor" class - with some of the flexibility of actors, but less overhead? Is that an option that could be included in a future update of Stencyl? I haven't got into particles like JoyfulDreamer yet, but I do use basic actors to compliment scene design (with no movement / collision / just render only). I'm worried that even that might start to bog things down after a while. I'd be using tiles more often, but based on my grid / tile size, it doesn't give me enough flexibility in their placement.

This is the approach we're going to allow in the future. It's a matter of deciding how to do this in the simplest way possible for the end user, and this is tricky.

Ideally, as simple as setting a flag, but then you get into slippery issues of "expecting" it to act as a fully fledged actor and having it respond to all the normal blocks when that's going to be really hard or impossible to do in reality.

Or we could make a restricted kind of actor, but then, how do you expose a block level API that doesn't start replicating part of what we already have for regular actors? What would you like such an actor to do?

JoyfulDreamer

  • Posts: 56
Quote
What would you like such an actor to do?

Simply put, particles need basic abilities to move in a direction, tint, fade, and change size; other than that, I don't care right now. :) As it is, takes only a dozen or so with fade and size change on to kill the FPS.

« Last Edit: June 20, 2011, 07:12:34 am by JoyfulDreamer »
Free music at JoyfulDreamer.com and GameMusicWorld.com.

tabletop

  • Posts: 343
What if there was a particle engine extension which after you created a particle system in it, you could save it as a .GIF or such and upload it directly into stencyl?

JoyfulDreamer

  • Posts: 56
That thought already crossed my mined. It would be fine for static particles, but not dynamic ones that follow a ship, and any other situation where the object is moving.
Free music at JoyfulDreamer.com and GameMusicWorld.com.

Alexin

  • *
  • Posts: 3132
What if there was a particle engine extension which after you created a particle system in it, you could save it as a .GIF or such and upload it directly into stencyl?
You can already do that with an external editor. I'm sure if one exists it outputs some kind of image.
"Find the fun"
alexin@stencyl.com

odomatic

  • Posts: 16
I personally like TimelineFX here: http://www.rigzsoft.co.uk/ (not free!)

It outputs animations of particle effects, even seamless looping ones...

There are certain to be others, maybe better or free. I started using that one because I also write games in BlitzMax and TimelineFX has a module for loading and playing the effects in-engine. However, it is not necessarily for BlitzMax and is a quite full featured particle effect editor/generator in its own right.

This method is definitely secondary to having a robust in-engine particle system, of course, since prerendering wouldn't be appropriate for all kinds of effects.

JoyfulDreamer

  • Posts: 56
Thanks, but as stated, I need the dynamic effect. It doesn't look nor feel right with static effects stuck to the ship. I have no issue with going the bitmap route, but I need to know the best way to do so in line with the Stencyl API...? For instance, can I create an actor, THEN access its "internal" bitmap? Once I have the bitmap, is there an API call to draw it? What about if I wanted to rotate/scale/tint the bitmap?

Thanks.

(FYI: Seems IE handles the flash plugin better than Chrome. In Chrome I get major lag [30-40 FPS]. In IE I get 55-62. :/ )

« Last Edit: June 22, 2011, 12:03:01 am by JoyfulDreamer »
Free music at JoyfulDreamer.com and GameMusicWorld.com.