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. chat Gpt Chatbot

    Particle System “Pre-Pumping” « Frogatto & Friends

  2. fanvoz.com says:

    fanvoz.com

    Particle System “Pre-Pumping” « Frogatto & Friends

  3. invest in chat gpt

    Particle System “Pre-Pumping” « Frogatto & Friends

  4. entry level jobs singapore

    Particle System “Pre-Pumping” « Frogatto & Friends

  5. http://www.hg3b50g00b6u5A.com

    Particle System “Pre-Pumping” « Frogatto & Friends

  6. data scientist jobs

    Particle System “Pre-Pumping” « Frogatto & Friends

  7. Full Content

    Particle System “Pre-Pumping” « Frogatto & Friends

  8. check my site

    Particle System “Pre-Pumping” « Frogatto & Friends

  9. important site

    Particle System “Pre-Pumping” « Frogatto & Friends

  10. click reference

    Particle System “Pre-Pumping” « Frogatto & Friends

  11. Full Article

    Particle System “Pre-Pumping” « Frogatto & Friends

  12. Read More says:

    Read More

    Particle System “Pre-Pumping” « Frogatto & Friends

  13. clique neste link

    Particle System “Pre-Pumping” « Frogatto & Friends

  14. next page says:

    next page

    Particle System “Pre-Pumping” « Frogatto & Friends

  15. renta de clinicas

    Particle System “Pre-Pumping” « Frogatto & Friends

  16. se renta consultorio en clinica

    Particle System “Pre-Pumping” « Frogatto & Friends

  17. para que sirve el tamiz neonatal ampliado

    Particle System “Pre-Pumping” « Frogatto & Friends

  18. salud digna prueba covid

    Particle System “Pre-Pumping” « Frogatto & Friends

  19. consultorio medico renta

    Particle System “Pre-Pumping” « Frogatto & Friends

  20. wholesale chanel clothing

    Particle System “Pre-Pumping” « Frogatto & Friends

  21. alineadores para adultos

    Particle System “Pre-Pumping” « Frogatto & Friends

  22. consultorios renta por hora

    Particle System “Pre-Pumping” « Frogatto & Friends

  23. university math tuition singapore

    Particle System “Pre-Pumping” « Frogatto & Friends

  24. psle maths tuition centre

    Particle System “Pre-Pumping” « Frogatto & Friends

  25. best maths tuition in trivandrum

    Particle System “Pre-Pumping” « Frogatto & Friends

  26. further math tuition

    Particle System “Pre-Pumping” « Frogatto & Friends

  27. how To Watch free online movies

    Particle System “Pre-Pumping” « Frogatto & Friends

  28. Dpmall.kr says:

    Dpmall.kr

    Particle System “Pre-Pumping” « Frogatto & Friends

  29. ortodoncia transparente invisalign

    Particle System “Pre-Pumping” « Frogatto & Friends

  30. altcoins vs bitcoin chart

    Particle System “Pre-Pumping” « Frogatto & Friends

  31. how to make a payment in bitcoin

    Particle System “Pre-Pumping” « Frogatto & Friends

  32. hypeava.ru says:

    hypeava.ru

    Particle System “Pre-Pumping” « Frogatto & Friends

  33. diferencia de precio entre brackets y invisalign

    Particle System “Pre-Pumping” « Frogatto & Friends