Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Particle Rotation

Author
Message
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 21st Aug 2011 19:08
Would be a nice feature to be able to have a SetParticleRotation command so particles can rotate over time at a given angle.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 21st Aug 2011 22:25
Another important feature would be that ParticleImage gets its info from a sprite instead on an image.

in this way we can manipulate the image before it is transformed into a particle. Right now we cannot do that with Images. I have to load multiple image variants if I want to build complex particles, which makes little sense.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd Aug 2011 11:52
Another nice feature would be to have a command for ParticleSize, at the start of its life, and at the end, so particles can grow and shrink accordingly.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 22nd Aug 2011 18:47
For maximum performance particles are drawn with point sprites which can't rotate or change size. There is a fallback method of drawing them with quads (just like all the other sprites) if point sprites aren't supported, which would support rotating and resizing, but then you may as well be drawing sprites.

So unless there is a large demand, I'm reluctant to introduce particle features that will destroy any performance benefit of using the particle system.
DMXtra
21
Years of Service
User Offline
Joined: 28th Aug 2002
Location: United States
Posted: 23rd Aug 2011 09:54 Edited at: 23rd Aug 2011 09:55
Paul, can you give us a quick example (Tier 1) of how you could rotate/changing sizes of sprites to do the same thing as particles?

App Game Kit (A.G.K.) - Want to be creative on many platforms at once? This is the tool you need.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd Aug 2011 13:21
Well I guess that we should have the option to set if particles will be point sprites or quads. if we set them as quads then we will have some extra commands.

Why do we need this? The Particles commands are very powerful and it's very fast to populate a game level with moving stuff in the background with just 8 lines of code.

For example SetParticlesSize should have width & height options, as right now if the Image is not square, the result is stretched and looses proportion.

I have made some performance tests on iOS using particles larger than 64 pixels and I still got a nice 60fps!

If TGC don't have any plans to add more particle commands within the next year, just let us know, so I can see if I can adopt some other more flexible particle system.
Daniel TGC
Retired Moderator
17
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 24th Aug 2011 04:56
Remember that this kit is mainly aimed at mobile devices such as the iPhone, samsung wave 525 and the new Nokia N9 as well as netbooks and tablet class devices. AppGameKit needs to be as efficient on both battery power as possible. No one wants to play a game that kills that devices battery life and I doubt apple would even let it on their store.

If you want to create a psudo-particle system that supports rotation, scaling and alpha it's just a matter of creating an array, and recycling sprites with a timer or distance travelled check. The rest is just a matter of creating a loop for the sprites, that checks the time or distance travelled and fades their alpha until it hits zero, then hide the sprite or reset it's position. You can position and rotate the sperate sprites in any way you likes then creating any number of patterns. Create a function and you can reuse this process any time you like.

You could also create an animated sprite to simulate a paticle system, you can certainly rotate and scale that as much as you like, plus all the hard processing is handled by your art program rather than the devices CPU.

This way we have the more efficient particle system as standard, and you can repeat the process any time with your function.

Login to post a reply

Server time is: 2024-03-29 14:40:04
Your offset time is: 2024-03-29 14:40:04