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 system changing the original aspect ratio

Author
Message
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 17th Dec 2013 12:22
Hello!

Here's my problem. I tried to make a particle emitter with a png which size is 4x32. unfortunately (and oddly), it was barely visible. So I increased its size with the setparticlessize command and the aspect ratio of the particles was modified. It looked more like a square than a rectangle. Is it a normal behaviour? Is there any limitation I missed? Or not documented?

I searched the question and read the command help but I couldn't find an answer to it. Thanks for your time.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Dec 2013 13:28 Edited at: 17th Dec 2013 13:29
the particle size is for x&y as yet.
just save your particle as square.
you can easy resize with the gimp paint tool..

AGK 108 B19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 17th Dec 2013 13:43 Edited at: 17th Dec 2013 16:02
Oh, silly me. I had not thought it would work that way. Thanks a lot.

It's a shame though. That makes 3 transparent pixels for one full. My fill rate won't like it. Back to the drawing board.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Dec 2013 14:48 Edited at: 17th Dec 2013 14:53
maybe try
SetImageMagFilter
SetImageMinFilter

here is some selfmade particel system,
you can replace the size with sizex and sizey.
maybe you can use it.



AGK 108 B19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 17th Dec 2013 18:47 Edited at: 17th Dec 2013 18:48
Thanks Markus, that's very nice of you. This function is well written, I couldn't have done better. However, for my particular project I'll stick with the built in particles. The documentation states that they are drawn faster than regular sprites. Since I'm struggling with frame rate, I can't take the chance to build my game around something that may be less efficient. Even though we don't know to which extent they are faster.

"//hatte Probleme mit mehr als 9 Parameter^^"

I had a good laugh when I read this. I encountered this very problem with my animation function. It literally drove me crazy!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Dec 2013 20:01 Edited at: 17th Dec 2013 20:03
i wrote often remarks of that was had kidding me
a better frame rate is not easy done, but check first what part
takes much time with a code stop watch and take a look at the benchmarking commands.
maybe you create to much particels or they die to slow.
if u use non transparent sprites in your project you can use SetSpriteTransparency(spr,0)

AGK 108 B19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 18th Dec 2013 10:22
Thanks for the tip, I already opened a topic about my framerate and this awesome community was, as it always is, most helpful (well, apart for the usual guy who used a typo to make fun of me .

I'm currently giving the finishing touches on special effects. The maximum frame rate I get on my 800mhz device is 33 fps. I target 24 fps on low end device so every bit of performance counts.

I tried to make squares out of my 4*32 png and I still get a decent frame rate (probably because they have a 0.2s lifespan). Let's hope I won't regret it when I add the user interface.

Login to post a reply

Server time is: 2024-05-02 09:48:29
Your offset time is: 2024-05-02 09:48:29