I've been working on a particle system for the TI-84+CE for a little while, and I have some demos to show my effort!
Basic Particles (1000 particles: 4 Emitters handling 250 particles each)
For the New Year, Fireworks!
Right now, the code is kinds a mess. Once I get it cleaned up, I'll post the source to GitHub and the Cemetech Archives for everyone to try out. The main goal of this project is to have a modular, performant particle system for the TI-84+CE. I plan to have the system to be flexible enough to customize parameters to create both of these demos without adding new code.
If anyone has any experience with Particle Systems, let me know if you have any tips!
Wow, this looks really neat (and has a lot of pretty obvious applications for games)! Any insights you're willing to share on how you got it to run so smoothly?
Looking forward to more updates!
Fireworks for the new year!
Looking good, looking forward to taking a looksee.
Ooh I've always loved effects like that! Looking forward to seeing this progress!
PowderGame when?
I could watch this forever. Can't wait for a beta release.
Perfect timing for some fireworks! Looks awesome and is running nicely!
Can the particle itself be changed from a pixel to other primitives or even sprites?
Quote:
Any insights you're willing to share on how you got it to run so smoothly?
I think that the main reason it's so fast is because I kept it simple. If you want to get technical, most of my functions are O(n) Time Complexity.
Quote:
Can the particle itself be changed from a pixel to other primitives or even sprites?
Sure, since I'm simulating points, and the draw function just draws something at each point, I can draw sprites. Do note that it will be slower due to more pixels being drawn to and LOTS of overdraw if there are many particles
Sprite Particles (15 particles, rotating and transparent backgrounds)
Right now, I'm working on collisions for the particle system. I need some help on deciding how to implement it.
Here is the example I am thinking about:
Which option should I choose?:
Give a full-on check between the rectangle and line created from the position and next position, using math.
Approximate a line by calculating some amount of points on the dashed-line and check if any of them are inside the rectangle
Just ignore it all and just see if the next position is inside the rectangle
The main things to consider is that this will be calculated for each particle,so this should be fast. But how fast?
Also, the same decision will be applied to checking collisions for circles and custom polygons.
This is kind of a classic problem.
Sorry if I missed but what format is your coordinate system in? (Integer, fixed-point, float etc).
It really depends on accuracy, some engines have 'physics frames' which run more often then 'rendering frames' for this exact reason, but that could get expensive.
Have you thought about offering different options that people can choose from depending on their needs?
tr1p1ea wrote:
Sorry if I missed but what format is your coordinate system in? (Integer, fixed-point, float etc).
Right now I have each position as two int16_ts, but as long as the TI-84 Plus CE can handle it, I could change the type, since I'm using my own Vector2d C++ Template class.
tr1p1ea wrote:
Have you thought about offering different options that people can choose from depending on their needs?
I was thinking that in the back of my mind, but I have a hard figuring out how to implement the API for that without requiring the library user to not have to change the library code.
What do you think would be the best API to specify the accuracy?
int16_t is the slowest type to use in C.
MateoConLechuga wrote:
int16_t is the slowest type to use in C.
What recommended signed integer type should I use?
int8_t if that's large enough for your use case, int24_t otherwise.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
»
Go to Registration page
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum