Particle with Create block [will do in 3.x]

Aasimar

  • *
  • Posts: 605
Hi guys,

I've made some test with the create block to make particle (like blood, smoke, etc) and it's really slow on iOS.

There is a way to do for better performances ?
Someone else have tried massive using of "create" ?

« Last Edit: January 21, 2014, 06:18:32 pm by Jon »

Jon

  • *
  • Posts: 17533
We'll add a proper particle engine in 2012. The engine already supports particles, but we don't have any GUI for building them.

You should definitely use the recycled actor option for this kind of thing, if you're going to attempt it.

Aasimar

  • *
  • Posts: 605
Yeah, I'll search some exemples of use for this stuff, I don't understand the logic behind this.
Good to hear for the particle engine, I can't wait!

For now I use a "repeat 15 times" on a create, it's really heavy.


Aasimar

  • *
  • Posts: 605
Hum.. I see, I'll made some test with this.
Basically, I need to create a recycled actor 1 time and make the "recycle actor" in a repeat, true ?
But if I have some random for direction, speed, etc in a behavior on this actor, all the recycled actors will have the same ?

coleislazy

  • *
  • Posts: 2607
If I understand it correctly, if you use recycled actors, its still going to create 15 of them, but the next time it will simply move those 15 back on screen, which is "lighter" than creating them again. So, there really isn't a performance gain the first, time, but there should be on subsequent calls.

Rob

  • *
  • Posts: 1268
@Cole, as a first alternative, could you enhance your explosion pack to mimic particle effect to some extent?

I see this pack being used around a lot including one of my games.

One that I liked a lot is (though with violence and other graphics):

http://www.stencyl.com/game/play/7389
GOLDEN RULE #1 : SAVE YOUR GAMES FREQUENTLY
IOS/XCODE DEBUGGING
http://www.stencyl.com/help/view/xcode-ios-troubleshoot/
WATCH STENCYLWORKS VIDEO TUTORIAL BY SUNRISEKINGDOM
http://www.youtube.com/watch?v=KDfRfjzr9j4&feature=channel_video_title

coleislazy

  • *
  • Posts: 2607
@Cole, as a first alternative, could you enhance your explosion pack to mimic particle effect to some extent?

Not really. The explosions rely on actors as the base. The drawing is done with the Flash API, anyway, so it won't work on iOS.

You may be able to create your own particles with the draw blocks, but that might not be any faster than using actors, and it certainly would have to be very basic (single colors, for example).

Rob

  • *
  • Posts: 1268
Got it. Thanks for the reply.
GOLDEN RULE #1 : SAVE YOUR GAMES FREQUENTLY
IOS/XCODE DEBUGGING
http://www.stencyl.com/help/view/xcode-ios-troubleshoot/
WATCH STENCYLWORKS VIDEO TUTORIAL BY SUNRISEKINGDOM
http://www.youtube.com/watch?v=KDfRfjzr9j4&feature=channel_video_title

Aasimar

  • *
  • Posts: 605
Ok, here is my stuff.

I use the "KillActor" behavior to create particles and the "Particle" behavior is attached to them.
I search a method to optimise this.

Here is the Flash result :

http://sebastienwozny.com/game.html

In flash, this is pretty cool, the fps is good, but on iOS, it's not so cool.
I need to make more particle to have a very good blood effect, so... the recycled actor can help ?

coleislazy

  • *
  • Posts: 2607
I would try recycled actors and see if it helps. The effect is pretty cool on Flash! I hope you get it sorted out on iOS.

Jon

  • *
  • Posts: 17533
I'm pretty confident that recycled actors will solve your issue.

Aasimar

  • *
  • Posts: 605
I tried but this is not working. I don't understand the logic in the article of Stencylpedia, applied to this case.

I'll retry this week-end with more time and with brain use at 100% ..!

coleislazy

  • *
  • Posts: 2607
There really isn't anything special you need to do for recycled actors, aside from creating and killing them with different blocks. Under Scene->Actors, use the "create recycled Actor Type" block to create the actor, then the "recycle Actor" block to kill it, instead of the regular create/kill blocks.