Frogatto & Friends

Frogatto sprite

Frogatto & Friends is an action-adventure platformer game, starring a certain quixotic frog.
We're an open-source community project, and welcome contributions!
We also have a very flexible editor and engine you can use to make your own creations.

Particle System “Pre-Pumping”

February 12th, 2011 by Jetrel

“Particle systems” are a common feature in modern videogames; they’re used to simulate a lot of natural effects, such as dust clouds, splashing water, and other effects where little chunks of solid, or puffs of gas are emitted. Wikipedia probably can save me a great deal of typing. Frogatto uses particle systems, albeit with hard-edge pixel-art sprites as the particles, for many effects in game, such as the sparks that fly off of torches, to the water spouting from a fountain, to the fireplaces inside houses.

A common problem with particle systems is that they only begin their “simulation” when the player-camera actually is pointing at them, in order to save on processing time (and likewise, they pause it after the camera shifts away). If you consider a fire that’s constantly burning, with a column of smoke coming off of it, you’d expect this column of smoke to be complete. But smoke takes several seconds to drift upwards, and if you only start “simulating” it the moment the player walks onto the screen, it will look odd- the sky above the fire will be empty, and the fire will start letting off smoke as if it was only lit the moment you walked onto the screen (since in the simulation, it was). The pausing is not a problem, since the column has fully formed, just the initial delay whilst the empty air fills with smoke.

For quick-moving particles (such as sparks flying off of a fire), this works fine, since it only takes the sparks a “blink of an eye” to fill their full range. However, we’ve kinda dragged our heels on putting smoke into the game because of how awkward it looks for smoke to only start flying the moment you walk onto the screen. This is kind of a shame, because I’ve had this smoke-emitter effect done for months now (part of it was just good old-fashioned getting forgotten amidst all the other stuff to be done, another part was speed concerns). Here’s a picture of what the smoke looks like:

So, I’ve come up with a fairly simple solution for particle systems. Since the mere simulation part of them is very gentle on performance (it’s only the actual drawing that’s expensive, unless I’m using a ridiculous number of particles), what we do is (for only the slow particle types that need it) we automatically simulate the first couple of seconds in advance. It seems to work like a charm – probably the biggest beneficiary will be the falling leaves in the forest, since they can take as long as 10-20 seconds to fall, and the player can easily leave the whole screen before they have a chance to distribute themselves across more than a tiny fraction of it. This may take a little while, since those are still being done as objects; I haven’t had time to re-implement them as a particle-system, in part because I’ll need to add the option of sinusoidal paths for the particles.

As a bizarre curiousity; neither warcraft 3, nor (quite surprisingly) even starcraft 2, seem to do this. If you pan over a burning building, the fires will begin as though it just started burning the moment you moved the camera there. I’m guessing something in the whole structure of their game makes it considerably harder to do; in frogatto this took a whopping 4 lines of code. Age of Empires 3, by comparison, does not have this problem.

FacebooktwitterredditmailFacebooktwitterredditmail

84 responses to “Particle System “Pre-Pumping””

  1. Nate says:

    Hi! just got here after wandering around internet (specifically TA)
    There’s a thread that discuss best platformer and your game was mentioned several times so I thought it might be a good idea to check your website.

    I haven’t buy your game yet, but as far as I see I’m really impressed with the graphic of your game. I’m pretty sure this is the best graphic I’ve ever seen for platformer games in iOS. It might be just my preference though.

    Anyway, great job! I will probably buy it next week for my sister (and me too C:).

  2. Jetrel says:

    Oh, hey – thanks man!

    Speaking of which, there’s going to be an update out in a couple months that ought to make the controls even better on iOS; we’re switching to doing like sooziz did, with having just two L/R buttons, instead of a 4-way DPad. We realized we didn’t use up/down for much, and could just do contextual buttons for those when necessary; it’s amazing how much better it makes the controls, since “false taps” on up/down were a big problem.

    Plus arcade mode will be in the release, so – look forward to it. c:

  3. cash for homes arvada

    Particle System “Pre-Pumping” « Frogatto & Friends

  4. we buy houses centennial

    Particle System “Pre-Pumping” « Frogatto & Friends

  5. Zjhls.Love says:

    Zjhls.Love

    Particle System “Pre-Pumping” « Frogatto & Friends

  6. we buy houses highlands ranch

    Particle System “Pre-Pumping” « Frogatto & Friends

  7. math tuition serangoon

    Particle System “Pre-Pumping” « Frogatto & Friends

  8. https://artstic.com

    Particle System “Pre-Pumping” « Frogatto & Friends

  9. maths group tuition primary school

    Particle System “Pre-Pumping” « Frogatto & Friends

  10. mouse click the up coming internet site

    Particle System “Pre-Pumping” « Frogatto & Friends

  11. https://page.khadamatonline.com

    Particle System “Pre-Pumping” « Frogatto & Friends

  12. ip math tuition

    Particle System “Pre-Pumping” « Frogatto & Friends

  13. click here says:

    click here

    Particle System “Pre-Pumping” « Frogatto & Friends

  14. lanecp5x8.dailyhitblog.com said

    Particle System “Pre-Pumping” « Frogatto & Friends

  15. wow mythic guide

    Particle System “Pre-Pumping” « Frogatto & Friends

  16. Smbc-wiki.com

    Particle System “Pre-Pumping” « Frogatto & Friends

  17. volcano vaporizer alternative reddit

    Particle System “Pre-Pumping” « Frogatto & Friends

  18. pragmatic play noida

    Particle System “Pre-Pumping” « Frogatto & Friends

  19. Business Management and Strategy Training

    Particle System “Pre-Pumping” « Frogatto & Friends

  20. careers jobs in india

    Particle System “Pre-Pumping” « Frogatto & Friends

  21. 먹튀카카오

    Particle System “Pre-Pumping” « Frogatto & Friends

  22. 보증업체

    Particle System “Pre-Pumping” « Frogatto & Friends

  23. like it says:

    like it

    Particle System “Pre-Pumping” « Frogatto & Friends

  24. http://yinyue7.Com/

    Particle System “Pre-Pumping” « Frogatto & Friends

  25. florida vacation rentals

    Particle System “Pre-Pumping” « Frogatto & Friends

  26. http://175.126.38.79

    Particle System “Pre-Pumping” « Frogatto & Friends

  27. Proline.by says:

    Proline.by

    Particle System “Pre-Pumping” « Frogatto & Friends

  28. van tent says:

    van tent

    Particle System “Pre-Pumping” « Frogatto & Friends

  29. chatgpt programming website

    Particle System “Pre-Pumping” « Frogatto & Friends

  30. blockchain software

    Particle System “Pre-Pumping” « Frogatto & Friends

  31. work from home

    Particle System “Pre-Pumping” « Frogatto & Friends

  32. Going In this article

    Particle System “Pre-Pumping” « Frogatto & Friends

  33. http://hcps.barunweb.Co.kr

    Particle System “Pre-Pumping” « Frogatto & Friends

  34. chat gpt crypto

    Particle System “Pre-Pumping” « Frogatto & Friends

  35. a.langton says:

    a.langton

    Particle System “Pre-Pumping” « Frogatto & Friends

  36. haedongacademy.org

    Particle System “Pre-Pumping” « Frogatto & Friends

  37. renta consultorios polanco

    Particle System “Pre-Pumping” « Frogatto & Friends

  38. singapore jobs

    Particle System “Pre-Pumping” « Frogatto & Friends

  39. how chat gpt works

    Particle System “Pre-Pumping” « Frogatto & Friends

  40. wow.urbannet.co.kr

    Particle System “Pre-Pumping” « Frogatto & Friends

  41. Consultorio En Renta Por Hora

    Particle System “Pre-Pumping” « Frogatto & Friends

  42. use 200.196.212.160

    Particle System “Pre-Pumping” « Frogatto & Friends

  43. Uneed 3d Co officially announced

    Particle System “Pre-Pumping” « Frogatto & Friends

  44. changi airport part time jobs

    Particle System “Pre-Pumping” « Frogatto & Friends

  45. jobs in australia

    Particle System “Pre-Pumping” « Frogatto & Friends

  46. More about the author

    Particle System “Pre-Pumping” « Frogatto & Friends

  47. site link says:

    site link

    Particle System “Pre-Pumping” « Frogatto & Friends