Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Let's have a (virtual) fireworks competition!

This thread is locked; no one can reply to it. rss feed Print
Let's have a (virtual) fireworks competition!
Trent Gamblin
Member #261
April 2000
avatar

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.

Vanneto
Member #8,643
May 2007

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.

In capitalist America bank robs you.

Jonatan Hedborg
Member #4,886
July 2004
avatar

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?

blargmob
Member #8,356
February 2007
avatar

Jonatan, that was beautiful!

---
"No amount of prayer would have produced the computers you use to spread your nonsense." Arthur Kalliokoski

Vanneto
Member #8,643
May 2007

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)

In capitalist America bank robs you.

Jonatan Hedborg
Member #4,886
July 2004
avatar

liballegro_image-4.9.15.dll is missing (at least).

ixilom
Member #7,167
April 2006
avatar

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 ;D
{"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"}600139

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

Vanneto
Member #8,643
May 2007

I don't even link with allegro_image, so don't know why it complains about that. How about now?

In capitalist America bank robs you.

ixilom
Member #7,167
April 2006
avatar

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 :P

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

Archon
Member #4,195
January 2004
avatar

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?

Jonatan Hedborg
Member #4,886
July 2004
avatar

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"}600144
{"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"}600145
{"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"}600146

LennyLen
Member #5,313
December 2004
avatar

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.

video

FMC
Member #4,431
March 2004
avatar

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)

[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites]
Written laws are like spiders' webs, and will, like them, only entangle and hold the poor and weak, while the rich and powerful will easily break through them. -Anacharsis
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover. -Mark Twain

Thomas Fjellstrom
Member #476
June 2000
avatar

Its also far too uniform and ring shaped.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

ixilom
Member #7,167
April 2006
avatar

[Edit]
Eh, wasn't funny... I quoted wrong person thinking it was someone else.

;D

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

FMC
Member #4,431
March 2004
avatar

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"}600154

Please let me know if it runs! :)

[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites]
Written laws are like spiders' webs, and will, like them, only entangle and hold the poor and weak, while the rich and powerful will easily break through them. -Anacharsis
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover. -Mark Twain

ixilom
Member #7,167
April 2006
avatar

FMC said:

Please let me know if it runs! :)

Runs fine on 1440x900 ... and looking good :)

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

LennyLen
Member #5,313
December 2004
avatar

FMC said:

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:

FMC said:

Please let me know if it runs!

It ran very nicely here at 1680x1050.

FMC
Member #4,431
March 2004
avatar

ixilom said:

Runs fine on 1440x900 ... and looking good

Great news... waiting for your entry, video looked nice.

LennyLen said:

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 :(

[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites]
Written laws are like spiders' webs, and will, like them, only entangle and hold the poor and weak, while the rich and powerful will easily break through them. -Anacharsis
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover. -Mark Twain

ixilom
Member #7,167
April 2006
avatar

Finito

I'm finally done. YAY!

Jibberish

It was fun to make, even if I over engineered it (like I always do :P)
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 :P

The files

Source
Binary

Getting it to work

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.

Youtube

If no one for some reason is able to run/build my contribution, there is always youtube :)

video

Thanks

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 ;D

Final words

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! ;)

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

bamccaig
Member #7,536
July 2006
avatar

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. :D 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]. :D

References

  1. Though honorable mentions go to LennyLen for his brilliant fake, which I thought was sooooo awesome until I realized it was a fake. ;D
ImLeftFooted
Member #3,935
October 2003
avatar

I vote for mine.

Jonatan Hedborg
Member #4,886
July 2004
avatar

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"}600163

{"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"}600165

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.

ImLeftFooted
Member #3,935
October 2003
avatar

void ParticleHandler::removeParticle(int index) {

    particleArray[index] = particleArray[particleArray.size()-1];

    particleArray.pop_back();

}

Should be

void ParticleHandler::removeParticle(int index) {

    if(index != particleArray.size() - 1)
        particleArray[index] = particleArray[particleArray.size()-1];

    particleArray.pop_back();

}

Jonatan Hedborg
Member #4,886
July 2004
avatar

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!



Go to: