Who can make the nicest looking fireworks? Deadline is 31st december, 23:59 GMT.
Any language, any library. Should be able to compile and run with minimal fuss, posting of pre-built binaries is encouraged. It should run for at about a minute, and be judged for that time.
After everyone has posted, we vote for which one we liked best (other than our own). Simple!
Anyone in? Suggestions for improvements?
Compile and run on Windows? Linux? OS X?
I'm not going to tell people what to use, but obviously it's more fun if as many people as possible can compile it. If you make it harder to compile, less people will view it. Then it might be good to post several screenshots or a video of the fireworks in action
Damn, if I only had time to compete I would.
I'm working on an allegro 4.4 opengl game framework type thing.
This would help / encourage me to work on the particle system aspect of it.
Can we pre-compile a binary and just include the source?
I'm working on an allegro 4.4 opengl game framework type thing.
This would help / encourage me to work on the particle system aspect of it.
Great!
Can we pre-compile a binary and just include the source?
Sure, I can't see why not.
Damn, if I only had time to compete I would.
A shame. But if you get the time, it should probably not take too long to whip something up
I'll hack something with XNA
XNA
Nice idea, I'll maybe code up something..
However, topic starter.. Would be nice if you encourage us by giving up an example
Check out what I made!
{"name":"dogs+and+fireworks.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/7\/d798566490103d72812529acaa259f1e.png","w":490,"h":490,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/7\/d798566490103d72812529acaa259f1e"}
I'm working on mine I've still to decide what library to use. I don't really feel like installing allegro 4.9, what with all the libraries needed... And I might need decent blending. Any suggestions?
Check out what I made!
Purdy! Keep it up
And I might need decent blending. Any suggestions?
No.. But my general direction of thoughts is recursion(fractals).
I'd be interested.
What is the current way to get additive blending with Allegro nowadays?
I used to use Fblend but i'm having a few problems making it work with 4.4.
Is allegroGl the only other way?
[edit]Same question as Jonatan, didn't see his last post.
I'm already doing something horribly wrong with my particles in XNA, it chokes my pretty decent PC with ~200 particles
How are you storing and creating them?
Just a generic List<T>, no fancy pools or anything, but I might need to look into that anyway
Dustin: please attach at least an executable to join the competition...
and here comes my entry... {"name":"600091","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/6\/36db28c50ea34922142402993d3d35d7.png","w":647,"h":513,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/6\/36db28c50ea34922142402993d3d35d7"}
as long as noone else posts an executable the winner seems to be .... me
[EDIT]
now the source is available (don't steel from it!!!)
in this improved version the rockets are fired automatically so you don't have to hit the space-key all the time...
Nice, that's generally what I planned to do, putpixel() is it.
However, there are many things can be improved.. E.g. perhaps colors shouldn't just go black, but lose color(move to grayscale), at the time with losing brightness overall. In addition to gravity, there could be wind and air-drag force.
This one without fractals though, probably
Append: Frank, source please?
I am in. It will give me something to do tonight when I am bored.
Could someone help me out with something?
I'm having problems getting a velocity vector for my particles in an explosion that results in a "ring" in the sky.
Doing something like below is fine and dandy for your avarage explosion:
foreach(Particle p in m_particles) { p.Velocity = new Vector2(-(rand.NextDouble()),rand.NextDouble()); }
The problem is how to create those velocities whilst not accepting a minimum range.
Like 0.1f for X and 0.1f Y not being acceptable, however it should be possible to have 0.1f X but Y being 0.9f ... Does that make any sense?
I've been scratching my head for some time now and soon I'll probably start ripping hair
Like 0.1f for X and 0.1f Y not being acceptable
That would be perfectly acceptable if the sprite/spark thingee was almost directly approaching/receding to your line of sight (in 3d viewpoint). It's pretty neat to see a meteor do that (seems almost motionless).
You could do something like...
#include <cmath> VECTOR::VECTOR(const POLAR &v) { _x = v.r * std::cos(v.t); _y = v.r * std::sin(v.t); }
Where v.r is the velocity (radial length) and v.t is the angle (theta).
That way they all have the same outwards speed, but each can have a different angles.
Timorg, thanks!
I've been too focused on vectors that I totally neglected sin/cos ... d'oh
If they all had the same outward speeds, you'd wind up with a ring again. Unless you're actually using a Z component of course.
Look closely:
{"name":"China_Kyling_Fireworks_Display_Shell.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/7\/c77bbc14d1cbe12137ac4c31de4dad04.gif","w":400,"h":400,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/7\/c77bbc14d1cbe12137ac4c31de4dad04"}
If they all had the same outward speeds, you'd wind up with a ring again.
It is the ring effect I'm trying to make
So use do_circle() and only draw every N'th pixel.
Not using Allegro I'm doing this with XNA framework
So use Timorgs idea, but I'd think it'd look pretty lame...
This is what mine looks like.
{"name":"600098","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/3\/23cccd0089db987103d62c6fd5565b54.png","w":650,"h":509,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/3\/23cccd0089db987103d62c6fd5565b54"}
This is about as much as I can do without it stopping being exciting.
But it has all those configurable parameters!
Source attached, includes a crappy makefile.
The code is terribly ugly.
If anyone is bored feel free to suggest a better general approach/design I should have taken in the first place to avoid having such an ugly POS.
(Allegro 4.9.16)
EDIT: uploaded improved Line.cpp (increased line thickness to make it stand out more)
Here's my piece of shit entry. The code is horribly ugly and there is a massive memory leak which I am far too lazy to fix. Hit the spacebar to launch a firework.
{"name":"600102","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/3\/23b295132dbb118c793379186ab5627a.png","w":816,"h":636,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/3\/23b295132dbb118c793379186ab5627a"}
blargmob: You are evil. Very. Crashed on launch.
You know what...I think I'll try this.
blargmob: You are evil. Very. Crashed on launch.
What exactly happened? Did it say anything? You'll need XNA GS 3.1 and .NET 3.5 in order to build it. And I think you just need .NET 3.5 to run it...
Here's mine:
{"name":"600105","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/c\/7c57afb05efd3f893e907a004c1e28cf.png","w":758,"h":626,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/c\/7c57afb05efd3f893e907a004c1e28cf"}
edit: Oops, forgot the source
^^ lulz
Here's mine:
Weak
Here is my current version...
{"name":"600107","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/2\/529e230857efa31da0d1c5649e24f22c.png","w":825,"h":643,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/2\/529e230857efa31da0d1c5649e24f22c"}
Wow, lots more participants than I expected! Keep it up everyone!
Except LennyLen. You killed my soul
Except LennyLen. You killed my soul
Perhaps you should look at the source before it is too late to resuscitate said soul.
I did.
That's what killed it.
Oh I thought you meant that your soul died, as there was no way you could compete with the entry.
If I can get all the C# programming tasks I assigned myself for the day finished before I have to leave for work this evening, I'll have a go at a real entry.
But hey, at least it was nice[1], tidy, code for two minutes worth of coding.
{"name":"600108","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/5\/65d1dbee6fb4379c961fabc16732ac4a.jpg","w":793,"h":612,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/5\/65d1dbee6fb4379c961fabc16732ac4a"}
You could've photoshopped it a bit, apart from resizing
You could've photoshopped it a bit, apart from resizing
Just figuring out how to re-tint the image in PhotoShop would have taken me longer than it took to code the entire thing.
CTRL+U - Hue, Colorize
CTRL+T - Transform
Now you don't have to figure it out
Perhaps I should also have mentioned that I don't have PhotoShop.
LennyLen: I give you points...that made me laugh.
Hey look someone already posted my image on google image search!
Here's my entry
{"name":"600113","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/4\/24c62b7bbcfa2df048e4c45db4fa069a.jpg","w":806,"h":625,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/4\/24c62b7bbcfa2df048e4c45db4fa069a"}
Can someone check some maths for me?
Consider the following diagram:
{"name":"600114","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/8\/b8e1af488d6542be9c84565ec0c63194.png","w":800,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/8\/b8e1af488d6542be9c84565ec0c63194"}
If V and A are known, and you want to calculate X and Y, they can be calculated as follows, yes?
X = V * cos(A)
Y = V * sin(A)
And if the angle is in degrees, then to pass it to the math.h functions, which are in radians (iirc), you should then do:
X = V * cos(A * PI / 180)
Y = V * sin(A * PI / 180)
So, have I got all that right?
If "A" is your theta, you are correct that
For the next part, you may find it easier to precalculate your values for either PI / 180 or 180 / PI:
static const double RAD2DEG = 180.0 / M_PI; static const double DEG2RAD = M_PI / 180.0;
Looks like you have it correct.
What exactly happened? Did it say anything? You'll need XNA GS 3.1 and .NET 3.5 in order to build it. And I think you just need .NET 3.5 to run it.
Can't, just crashed. What I have out of these platforms- no clue. Just Win7 x64..
P.S.
Come on people.. Make it move. Static images are boring
Append:
All those that move, are nice though
Still got a few days to go
Progress has been slow though, a friend is visiting = no coding
Hey look someone already posted my image on google image search!
Ahahaha!
Here's what I threw together:
The source code is attached. I didn't really attempt to regulate speed or optimize the code, so it may not run so well on slower computers.
EDIT: I forgot to mention, The reason I asked about the maths earlier was that there were certain areas that were never being drawn to, and I thought I had my equations wrong. It turned out is was just due to the crappiness of rand(). When I switched to using a Mersenne Twister algorithm instead, the particle distribution became even.
ixilom: Wow. Really awesome.
Here is my first version, I might update it a bit if I feel like it
I did some experimentation with function pointers, void*'s etc... There are plenty of hacks in the source, so don't go there unless you really want to.
It kinda started out with just plain C, but moved slightly over to C++ because I started to use OpenLayer and figured "meh, what the hell"... Fun exercise though!
{"name":"600129","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/7\/d77c039cd81df6ea716f4c7009b7a804.jpg","w":800,"h":603,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/7\/d77c039cd81df6ea716f4c7009b7a804"}
I updated my original entry (and the link to the app in my post). Here it is again: link.
Edit: Oops, seems I messed it up. Wasn't working right on my faster computer. Updated again.
Anyone know if it's possible/easy to add some motion blur in openlayer? I would guess through direct OpenGL access, which is fine.
Doubt it.
Yes, the easiest way to do motion blur is when you have a solid colored background. Fireworks are on black so it's easy. Render your frames to a buffer, never erase the buffer and after drawing a frame draw a translucent black rectangle over the whole scene. It'll gradually fade everything out like a motion blur.
Hm. You could also just draw the particle 10 times with varying alpha tint.
Neat effect.
Here is my first version, I might update it a bit if I feel like it
It was nice before it crashed, with no info on the crash(
It was nice before it crashed
Hmm. Strange. At what point did it crash? (ie, what happened on the screen)
See if this version works better (attached).
Also with motion blur!
EDIT:
Yes, the easiest way to do motion blur is when you have a solid colored background. Fireworks are on black so it's easy. Render your frames to a buffer, never erase the buffer and after drawing a frame draw a translucent black rectangle over the whole scene. It'll gradually fade everything out like a motion blur.
Oh yeah, of course! It was super easy to implement and looks really good! Thanks
nm
See if this version works better (attached).
Awesome, works fine.
In Allegro 5, which is faster, having a ALLEGRO_BITMAP represent the particle, or just drawing pixels? I am getting some slowdowns with over 1000 particles in the scene, so I'm just wondering.
If they're single pixels use an array of ALLEGRO_VERTEX (primitives addon) and al_draw_prim with the ALLEGRO_PRIM_POINT type.
This will be faster than using ALLEGRO_BITMAP's? Well, I'm going to try it, thanks for the tip.
Yes, it should be the fastest way to draw single pixels.
Well, while I brought this up, I noticed that the ALLEGRO_OPENGL driver is significantly slower at drawing many textures (1000) than the DIRECT3D driver... I updated my drivers to make sure they aren't to blame and the problem persists. Is this just how OpenGL works?
It's also a matter of which OS you're using along OpenGL.
OpenGL and Direct3D are typically about the same... but in some cases D3D can be slower (rarely) and so can OpenGL (more often) on Windows depending on the system.
I just noticed OpenGL is a bit faster at rendering using the primitivesa addon. Looks like OpenGL doesn't like a lot of textures but loves vertices, just a hunch. Anyway, works a lot better now even with 5000 particles, thank Trent.
Latest version uploaded! Should not crash, regardless of particle count... Added some statistics (fps and active particles), and of course the motion blur
I'm pretty pleased at how I ended up solving the particle handling... It should be very fast and still pretty flexible.
Do you guys get any slowdowns?
Jonatan, that was beautiful!
Here is my current version. The colors/speed/size are all customizable, currently it uses a white explosion. If something doesn't work (dll missing) please tell.
Also, how does it work with a lot of particles? (click very fast to produce them)
liballegro_image-4.9.15.dll is missing (at least).
Jonatan, that is pretty slick
I think I'll have to re-code my "blur" effect, I'm pumping out too much particles just to create that effect. Although I am doing 14160 of them without any noticeable slowdown ... hmm.
I even built a small editor for the launch sequence with all the needed parameters
{"name":"600139","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/6\/86f80cebcb48c490e74f81d60d257062.png","w":968,"h":413,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/6\/86f80cebcb48c490e74f81d60d257062"}
I don't even link with allegro_image, so don't know why it complains about that. How about now?
Works fine here Vanetto
I don't have anything Allegro related installed, so it is safe to assume all the needed DLL files are now included
Runs smoothly until I frantically press the mousebuttons to get 25K particles, it then drops down to ~30 FPS (~60 FPS with 14K)
I have for now "composed" about 30 seconds fireworks-frenzy-show with my editor (and cheating with notepad), another 30 to go
Could you upload some screenshots for each of your updates for those that don't want to download every release or if they don't have OpenLayer?
Some screenshots!
{"name":"600144","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/3\/f333ff3f5761cf8c14a318526d37a08a.jpg","w":795,"h":595,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/3\/f333ff3f5761cf8c14a318526d37a08a"}
{"name":"600145","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/9\/39f5b2cef77f9449ba79c7cdc5c22aa6.jpg","w":792,"h":595,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/9\/39f5b2cef77f9449ba79c7cdc5c22aa6"}
{"name":"600146","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/c\/bcd513012e90348d5bad15be5dda152a.jpg","w":798,"h":597,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/c\/bcd513012e90348d5bad15be5dda152a"}
I improved mine a little bit. It has regulated timing now, and continues on indefinitely until you press ESC. I'm quite happy with how it fast it runs, since it's my first attempt at particles, and it's not using any hardware acceleration.
The source and a Windows binary are attached. I've also made another video, though it's at a very low framerate, so doesn't look that great.
Lenny, i think it would look nicer if you slowed it down a bit, it's too fast right now (for my eyes at least!).
(i'll soon upload my entry)
Its also far too uniform and ring shaped.
[Edit]
Eh, wasn't funny... I quoted wrong person thinking it was someone else.
It is done!
Here it is: http://www.allegro.cc/files/attachment/600153 (source + binary + dll + data)
It's scripted and you WILL KNOW when it ends, please don't loose the GRAN FINALE
There are a few pauses during the act, but they are just that, pauses.
A few things:
-Nine different (more or less) fireworks in display for a minute or so with much randomness and scripted launching sequence.
-The source is a huge hack, avoid it if possible!
-The program will use your desktop resolution, scaling itself, but best results will appear at 1680x1050.
-If the program isn't smooth i reccomend lowering these two:
#define MINE_PARTS 350 #define ROCKET_PARTS 400
-Screenshot of near-Finale:
{"name":"600154","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/f\/cff179deb16a8270bb941fd05ea246da.jpg","w":840,"h":525,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/f\/cff179deb16a8270bb941fd05ea246da"}
Please let me know if it runs!
Please let me know if it runs!
Runs fine on 1440x900 ... and looking good
Lenny, i think it would look nicer if you slowed it down a bit, it's too fast right now (for my eyes at least!).
I just checked the YouTube video, and it seems to be running slightly fast. It also seems to have dropped a few more frames than the version I uploaded.
Its also far too uniform and ring shaped.
I've attached a version with more randomness in the particle's velocities, so it makes it less evenly distributed.
edit:
Please let me know if it runs!
It ran very nicely here at 1680x1050.
Runs fine on 1440x900 ... and looking good
Great news... waiting for your entry, video looked nice.
It ran very nicely here at 1680x1050.
Good!
Your entry is still a little too fast for me, but maybe it's just me.
Cookies to Jonatan who came up with an idea that gave me an excuse to code something (it had been ages!)
blargmob: your program crashes on start for me
I'm finally done. YAY!
It was fun to make, even if I over engineered it (like I always do )
Seems everyone else has been able to cram everything in a neat and tight package (like main.c), whilst I went apeshit and made a shitload of files
The source was built with Visual Studio, .NET 3.5 and XNA 3.1, so you gonna need those.
The binary most likely needs some parts of XNA 3.1.
If no one for some reason is able to run/build my contribution, there is always youtube
Thank you Allegro.cc and members, not just for this thread, but all the help and stupid flamewars we had this year. Lets not stop next year
I'm of to bed, wont be online later today (it is 3am now) as I'm going over to my sisters place to "celebrate" the new year when I wake up.
I wish you all a happy 2010!
Vote for me, or else!
I'm a little drunk. Anyway, I've been too exhausted to attempt to build any entries, and I generally avoid binaries. From the YouTube submissions I've seen, ixilom's entry seems very well assembled. I am drunk so I don't really remember previous posts as well as I'd like to, but it does strike me as the most detailed[1].
I vote for mine.
This is probably the final version, no more time to work on it. Overall, I'm pretty pleased with it! Could use a bit more fireworks (about 38 seconds now), and a few more different types... And better polish obviously.
Great work everyone, I'm glad this idea took off
{"name":"600163","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/4\/c478ec4453ba6c3b48bc4b8752e98a62.jpg","w":794,"h":592,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/4\/c478ec4453ba6c3b48bc4b8752e98a62"}
{"name":"600165","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/c\/ec5088d2eedcac009df82c1f07c8e315.jpg","w":797,"h":601,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/c\/ec5088d2eedcac009df82c1f07c8e315"}
EDIT: I do have a strange problem; I'm using an STL vector for my storage, but the program crashes whenever it grows in size (so I have to reserve(some larger number) in order for it to run)... I cant figure out why. The relevant code should be in ParticleHandler.cpp if anyone wants to have a look at it.
Should be
Hmm. While that's correct (thanks for catching it!), it didn't actually solve the problem :/
I've been experimenting with adding a bit of bloom to it btw... Just drawing the particle buffer to 5 different bloom buffers (that are 1/4 of screen size), each with a 0.5 pixel offset (and one at 0,0) and then drawing those to the screen at full size.
It looks pretty good, but I think i might need to tweek a few color values around (things get a bit too white otherwise).
EDIT; also, 27k particles doesent even touch the FPS on my computer Pretty sweet if I may say so myself.
Happy new years everyone!
The problem is likely a memory error elsewhere in your code. A few tips... You should use a deque as it is more optimized for removing and inserting on the ends.
Use .at() instead of [] notation. This will throw exceptions which are good for debugging. In release mode you can use [] again resulting in a small optimization.
Here is a way to write two of your functions a bit more clearly / cleanly.
I generally avoid binaries.
Sounds like you've got a case of chronic gentooitis.
My vote goes for ixilom! Very pretty and ambitious.
I managed to track down that nasty little memory bug I had. I was holding on to a pointer to an object in a vector while I was adding stuff to the vector, so that when it got resized, the pointer was left dangling... silly.
Here is the latest (and last, this is getting silly now ) version if anyone is interested
It now has a fairly pretty "glow"-effect, motion blur, cheap reflective water (just a mirrored/stretched background) and a cheesy backdrop
Plenty of screenshots attached.
EDIT: I wonder if it's more effecient to store the particles as pointers in the vector, and take the cache hits or just do as I do now and take the heavier moving of memory instead.
I couldn't get any pretty firework particle explosions but I was able to make other neat particle effects at least.
I put my vote on Jonatan
I added rockets, it was quick and dirty actually. I'm not proud of the code, just the results, I think it looks quite pretty. I'm looking into optimizing it and making it even more optically pleasing.
Any suggestions on what do add?
I attached the source too, if anyone will look at it, ignore programme.cpp/.hpp. Is there any way to optimize the loops in explosion.cpp and main.cpp?
Resolution fail. Cant even see the top of the window (and I'm at 1280*1024, which afaik, is not considered tiny).
Votes
1 for Ixilom
OK fixed the resolution to 1024x768.