Joshua Waring
|
 |
«
Posted
2012-10-01 11:29:27 » |
|
I've been developing a Particle System as my first project, I do want to create a few games in the future, but I've always wanted to create a Particle System. so here it is, Right click to place gravity, 0 to remove gravity completely and left click to spawn particles. I would like to add in collision, but I haven't had the time to implement it into the system.  Download - https://rapidshare.com/files/3293633547/java.jar
|
The world is big, so learn it in small bytes.
|
|
|
RobinB
|
 |
«
Reply #1 - Posted
2012-10-01 19:03:26 » |
|
Looks good, but maybe a fps / entity counter can be handy.
|
|
|
|
Joshua Waring
|
 |
«
Reply #2 - Posted
2012-10-02 01:40:27 » |
|
If you run it through CMD java -jar "path" It will give a time in MS per frame and active particles
|
The world is big, so learn it in small bytes.
|
|
|
Games published by our own members! Check 'em out!
|
|
Jimmt
|
 |
«
Reply #3 - Posted
2012-10-02 05:15:52 » |
|
Post screenshot please! (your current image isn't showing up)
|
|
|
|
ra4king
|
 |
«
Reply #4 - Posted
2012-10-03 22:45:21 » |
|
This was one of the most awesome thing I've ever played with. Source please!!
|
|
|
|
Joshua Waring
|
 |
«
Reply #5 - Posted
2012-10-04 10:21:01 » |
|
I will upload the source code once I get back to the computer which it's located :3 Taking a nice week off to celebrate almost finishing school.
I do have a few things I want to add such as - Dynamic Core Allocation. I'm sure it has a different name, but I like the sound of Dynamic Core Allocation - Collision, I got bored one day in math so I decided to start thinking about a method for collision, I should implement and test it. - A cool looking bar on the side which represents the render time. - Resizable
|
The world is big, so learn it in small bytes.
|
|
|
StumpyStrust
|
 |
«
Reply #6 - Posted
2012-10-05 04:01:31 » |
|
If this is done in java2d resizing is cake.
If in opengl resizing is a little harder but still easy. (i know it is lwjgl)
Would like to know how many particle there are. Should be simple to add. (hint: just set the title to the number of particles) Display.setTitle(blah blah blah)
Cap the fps by calling Display.sync(60) every update.
Like the physics in this but it seems slow. How are you rendering?
Also, want to know how you choose the color for the particles.
PS: is this 2d? or 3D can't really tell.
|
|
|
|
Joshua Waring
|
 |
«
Reply #7 - Posted
2012-10-05 08:47:55 » |
|
This was done is LWJGL and every frame in which the button is clicked down 100 particles will be spawned, It does print to the console the number of active particles and render time per frame in MS, so using CMD will show that, but making it the title name does seem better.
It is only 2D but I should add in that other 1D.
Gravity does slow things down quite a bit, but it is faster then before... I'l upload my first version aswell which which was before I went to ArrayList's and objects as particles, I used simple Arrays, but that became a problem when removing particles.
The colour is just a random equation involving the speed....
|
The world is big, so learn it in small bytes.
|
|
|
ra4king
|
 |
«
Reply #8 - Posted
2012-10-05 12:20:45 » |
|
It seems 3D because when each particle changes direction, the color flips, giving the illusion of tiny boxes as particles.
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Joshua Waring
|
 |
«
Reply #10 - Posted
2012-10-05 13:46:16 » |
|
I actually use a linked list iterator, which makes things nice and quick.
|
The world is big, so learn it in small bytes.
|
|
|
theagentd
|
 |
«
Reply #11 - Posted
2012-10-05 15:06:59 » |
|
I actually use a linked list iterator, which makes things nice and quick.
"Nice and quick" as in "slow and stuttering due to the garbage collector"?  I wouldn't use a LinkedList for anything.
|
Myomyomyo.
|
|
|
matheus23
|
 |
«
Reply #12 - Posted
2012-10-05 15:23:29 » |
|
I actually use a linked list iterator, which makes things nice and quick.
"Nice and quick" as in "slow and stuttering due to the garbage collector"?  I wouldn't use a LinkedList for anything. Huhuhuu... never-lisper theeere.... 
|
|
|
|
Joshua Waring
|
 |
«
Reply #13 - Posted
2012-10-05 15:56:15 » |
|
My first system was a array which stored the particle positions and I created a nice system for flagging particles to be removed. Got 1 million at about 100ms, though it had some problems, it did make use of the Stride on CPU's (pre fetch for the next array value once its detected a patten.)
PS I have 4 different versions. V2 and v3 are under developed versions of v4 and v1 is completely different.
|
The world is big, so learn it in small bytes.
|
|
|
|
|