Jump to content
  • Advertisement
Sign in to follow this  
lobotomi

storing particle-history on the harddrive?

This topic is 4969 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I've been developing this particle-system in OpenGL (1 month). and yesterday was the day all classes and functions was strung together and the compile-key was hit. Everything worked fine, the particles behaved the way I've intended - i thought, until I realized that i can't really tell until I get the history of each particle. Now, how do i get the history of each particle? The most natural thing to do for me, as an "progressive" newbie is to store each calculated position of each particle in pointer arrays. But with 200 particles making around 300 calculations per second, this I guess wouldn't be to kind to the users memory. So i started to think in another direction, what if i stored the information in a file on the hard-disc. This would give me the opportunity to save different scenarios and open them in run-time and play them back and forth trough a timeline. The problem is: I ain't got a clue how to do this. And the questions is: How do i create and read data-files in my c++ program? is there any tutorials out there for this? How does 3D-animation packages do this?Am I in over my head? Please help this lost, self-pronounced "c++ - programmer". Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Well you can use ifstream and ofstream to handle files, here you can find a nice tutorial.

And why do you want to save the history of each particle? If you just want to be able to save your particle system configuration, why not just save the system settings? I guess that if you explain what do you intend to achieve we can help you out in a better way.

Share this post


Link to post
Share on other sites
I hope you're not intending to use the hard drive as virtual memory ("swap"). Swapping this stuff in and out would be a huge drain on program speed.

If you want to know how to read and write files, check ifstream and ofstream on CProgramming.

Share this post


Link to post
Share on other sites
My intensions is to give the user the opportunity to create his/her own animations with different settings, and play back and forth trough that animation with a visual timeline. And perhaps saving the animation on the harddrive and open it on another occasion.

Share this post


Link to post
Share on other sites
I would like to propose a vastly superrior option:

Simply record all of the details of the particle generator (including the random seed) and then you can replay the exact same particle effect using the same code, later. Every single particle should go through the exact same places it went the first time.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!