HOME | DD

Published: 2010-01-24 22:56:57 +0000 UTC; Views: 39756; Favourites: 178; Downloads: 392
Redirect to original
Description
How to useAll you can do in this version is to change amount of balls (first stepper), change partitioning algorithm step(second stepper, do not recommend as it seems to perform well with that),
forces dumping (third stepper, can lead to pretty different results).
And finally you can pick some presets I made using combobox.
Have fun.
Background story
So after making Collision Study 4 and checking it's bottleneck I started to think on how to fix it (Sweep And Prune algorithm was used there). Well did not come up with ways of improving Sweep And Prune.
Ended up checking this book [link] which I recommend to anyone who wants to write alike stuff.
Well it turned out I already knew all types of broad phase collision detection techniques probably except for k-d/bsd trees which are kind of expensive in some ways. Good to store static level but probably not that good with moving stuff.
Anyways in the end come up with idea of kind merging some parts of uniform grid partitioning and Sweep And Prune loosing some benefits of SAP but in same time hopefully fixing big SAP weakness. It was tricky and code is little bit messy. But in the end it almost doubled performance with right tuning
Further plans
Well this work mostly serves as algorithm performance test but after playing with presets I am thinking on making something like little sandbox thing where you could create/share/reuse presets yourself using range of small easy tools
Related content
Comments: 147
Sunlis In reply to ??? [2010-01-26 00:23:06 +0000 UTC]
'Tetro' makes for a pretty awesome visual effect.
π: 0 β©: 1
wonderwhy-ER In reply to Sunlis [2010-01-26 09:26:21 +0000 UTC]
Yeah Wanted to call it Color Clash but forgot
So stayed as first name tetro
π: 0 β©: 0
HiddenSpartan In reply to ??? [2010-01-26 00:21:00 +0000 UTC]
I see a falling sand game clone here.
π: 0 β©: 1
wonderwhy-ER In reply to HiddenSpartan [2010-01-26 07:22:37 +0000 UTC]
Hehe well such games are one of my greatest preparations. Simulated ecosystems Tough this one here may be will not do. They are little bit different.
π: 0 β©: 0
deArtistofWar In reply to ??? [2010-01-25 22:53:14 +0000 UTC]
Oh man, did I not notice those other Modes c:
You should hear me do sound effects for the crash landing! : D
π: 0 β©: 1
wonderwhy-ER In reply to deArtistofWar [2010-01-25 23:06:01 +0000 UTC]
I added them today
Haha I am thinking on making two star wars ships made of balls colliding with Imperial March playing on the background
π: 0 β©: 1
deArtistofWar In reply to wonderwhy-ER [2010-01-25 23:45:05 +0000 UTC]
Hah great idea! I will be expecting it. q:
π: 0 β©: 0
shock-value [2010-01-25 22:50:57 +0000 UTC]
This is so cool! And fast! I don't know much of what is going on "under-the-hood", but would your optimization techniques be workable with a more fully featured physics engine (with poly collisions, variable masses, etc)? Or is it limited to just identical circles? Either way this is really great stuff--amazed to see such a simulation in Flash running well!
π: 0 β©: 1
wonderwhy-ER In reply to shock-value [2010-01-25 23:04:55 +0000 UTC]
I am amazed too.
As for more full featured stuff. I am intending on working on adding stuff but it will drop performance. This was only broad phase testing.
π: 0 β©: 0
Apofiss In reply to ??? [2010-01-25 22:35:48 +0000 UTC]
impressive collision tests! just to add material type / hardness / other parameters~
π: 0 β©: 1
wonderwhy-ER In reply to Apofiss [2010-01-25 22:59:17 +0000 UTC]
Thanks.
Well adding weight, size, friction, dumping on particle level is easy, it's all there just not implemented or used.
π: 0 β©: 1
Apofiss In reply to wonderwhy-ER [2010-01-25 23:05:46 +0000 UTC]
*is still amazed by what flash action script can do* kind of future platform for almost anything
π: 0 β©: 1
wonderwhy-ER In reply to Apofiss [2010-01-26 07:19:59 +0000 UTC]
Well any programing platform can. Flash just most popular that works in a browser currently. Guys that are working with GPUS achieve even more insane results for various reasons. For example read just another day that in one of fluid simulation types they achieved growth from 2k particles to 60k over last 6 years Kind of faster then mine 100 - 3k here
π: 0 β©: 1
Apofiss In reply to wonderwhy-ER [2010-01-26 10:49:40 +0000 UTC]
indeed, popular in a browser, no need for extra installation for end-user to run anything-flash (if installing flash player itself doesn't count). like 8 years ago, seeing moving animation just by clicking on it, that already was pretty much 'wow' ...and now~ anyway whenever it comes to coding (withing delphi) lua script comes very handy for a non-programmer liek me, even in real-time :]
π: 0 β©: 1
wonderwhy-ER In reply to Apofiss [2010-01-26 10:52:24 +0000 UTC]
Hehe
Actually I heard that Lua was ported to AS3.
Here this guy even makes funny thing where he tries to use it
[link]
π: 0 β©: 1
Apofiss In reply to wonderwhy-ER [2010-01-26 11:12:21 +0000 UTC]
"well, thanks to Adobe Alchemy, a project which allows C/C++ code to be converted over to a format the Flash player will recognize..."
interesting! i know that delphi code can be converted over to a C/C++ format/code(?) that makes some possibilities further hmm :]
π: 0 β©: 1
wonderwhy-ER In reply to Apofiss [2010-01-26 11:14:32 +0000 UTC]
Yeah that does. Not everything will work well tough. Code that uses System stuff to which player does not have access or which were not mapped from System calls to Flash calls will not work.
Tough people did manage to port Doom and Quake to Flash this way with some tweaks
π: 0 β©: 1
Apofiss In reply to wonderwhy-ER [2010-01-26 11:53:16 +0000 UTC]
hmm yeah, not even talking about opengl. thought the ported Quake runs in software mode(?)
apart from that imagine flash using gpu rendering/calculating power similar to nvidia cuda thing mmm~
π: 0 β©: 1
wonderwhy-ER In reply to Apofiss [2010-01-26 12:20:46 +0000 UTC]
Yeah no OpenGL ;(
Well first quake was ruining in software mode. OpenGl was added later.
And yeah hardware 3D is something many Flashers want for years already... Because of Adobe being silent about it more or less I am constantly checking alternatives. Silverlight from Microsoft is on same terms in that question. No real hardware 3D. Only some GPU cache and video acceleration.
Then there is Unity3D. Most tasty alternative so far. C# as a language, porting to iPhone, Mac, Wii, Windows, browser plugin(under mac and windows) with GPU acceleration and pretty good IDE for polished for 3D games making.
Unfortunately it so far suffers from firstly bugs/errors (2-3 years old technology + small collective + bugless 3D across many browsers/os systems is not that easy). And another problem is install base. Unity seems to have pretty small I think main reason is that there is no real apps that get attention a lot and use Unity3D. My boss for example says to forget it as he thinks Unity3D will never get large user base... I do not agree but this is a open question.
And finally there is WebGL This one is a native browser extension that allows JavaScript to call OpenGL which renders it to
Apofiss In reply to wonderwhy-ER [2010-01-26 12:52:35 +0000 UTC]
indeed, besides platform possibilities install base is like critical point, at least exposure/business wise. it's like for amatuers 3D is left as a self-expression candy while 2D probably has more appeal towards mainstreem (farmville? ). in the end the flash-script is a way to go.
π: 0 β©: 1
wonderwhy-ER In reply to Apofiss [2010-01-26 13:04:36 +0000 UTC]
Actually if you check many games on Facebook already have 3D at least for avatars. Restaurant City probably is most popular with 3D avatars. Tough there are Playfish blowing games that is completely 3D and there are others.
So it's not that 3D is only eye candy for enthusiasts stuff only, and it is not that there is no demand for 3D, it just that for some reason major platforms on a surface ignore hardware 3D for some reason I do not know.
At work I am actually working on a project that involves 3D avatars for players + 3D games and you can't imagine how much 3d designers cry for Flash not having proper hardware 3D and how hard it is to make it work fast on software and not look like crap... For gods sake my iPhone has better possibilities then Flash on powerful PC... I am just speechless on that question honestly...
π: 0 β©: 1
Apofiss In reply to wonderwhy-ER [2010-01-26 13:21:24 +0000 UTC]
rather simple 3D may work just fine while talking about little projects/games (liek within facebook, xbox live and etc) it's that mainstreem game consumers lean towards something not too complicated and fun where 2D overall seems a perfect solution (and quite less coding input from a developer); not sure of any statistics, just my biased observation, but i got that impression.
p.s. i presume the ignorance for 3d in major platforms is just another greedy business wise strategy to stimulate/secure other current high-end platforms, who knows~
ok, less talk more work *back to drawing*
π: 0 β©: 1
lightbird In reply to ??? [2010-01-25 22:27:48 +0000 UTC]
I see many colourful stars. And an electroencephalogramm xD
π: 0 β©: 2
wonderwhy-ER In reply to lightbird [2010-01-25 22:29:23 +0000 UTC]
Electrowoot? Just joking
I guess you liked Tetra variant
π: 0 β©: 1
lightbird In reply to wonderwhy-ER [2010-01-25 22:34:45 +0000 UTC]
This is something I'm fairly familiar with (not the principle, but on my own skin in the past :-/ ); [link]
And which variant might be that?
π: 0 β©: 1
wonderwhy-ER In reply to lightbird [2010-01-25 22:43:44 +0000 UTC]
No I did knew what that is.
And one on the icon with 4 colors. Called Tetra in combobox.
π: 0 β©: 0
lightbird In reply to lightbird [2010-01-25 22:28:56 +0000 UTC]
That said, I only see that something happens when I regulate the number of dots. Me and my tug of war with calculus
π: 0 β©: 0
YoungLink19 In reply to ??? [2010-01-25 08:44:37 +0000 UTC]
It's kinda like how astronomical bodies collide
There should be a reset button!
π: 0 β©: 1
wonderwhy-ER In reply to YoungLink19 [2010-01-25 09:02:54 +0000 UTC]
There will be preset saving loading
π: 0 β©: 0
psykopath In reply to ??? [2010-01-25 07:25:59 +0000 UTC]
I keep refreshing just to watch the red and green collide
π: 0 β©: 1
wonderwhy-ER In reply to psykopath [2010-01-25 07:40:30 +0000 UTC]
Hell YEAH!!! Doing it too
I actually am thinking of making small editor that allows to create shapes out of particles, set speeds to groups of them, save, load and share such presets
π: 0 β©: 1
psykopath In reply to wonderwhy-ER [2010-01-25 08:05:52 +0000 UTC]
I'd like to see a tall column with gravity making it drop
π: 0 β©: 1
wonderwhy-ER In reply to psykopath [2010-01-25 09:04:52 +0000 UTC]
Hmm my physics may not work well with gravity... I mean it is iterative and will not be able to sustain volume...
π: 0 β©: 1
psykopath In reply to wonderwhy-ER [2010-01-25 09:35:11 +0000 UTC]
I was wondering how you move the circles so close together without them colliding when you update one before the other. Do you loop through twice, once for moving, then for collision?
π: 0 β©: 1
wonderwhy-ER In reply to psykopath [2010-01-25 10:28:29 +0000 UTC]
They actually are not touching They are all have radius 1 but are on 1-2 distance from each other. It just they they are so small it seems there is no space between + partially drawing fault...
π: 0 β©: 0
wonderwhy-ER In reply to cryo-draws [2010-01-25 07:31:05 +0000 UTC]
Ouh YES!!! Thinking on making and editor where you can create shapes and set speeds for them and hit play afterwords
π: 0 β©: 0
cryo-draws In reply to cryo-draws [2010-01-25 01:01:48 +0000 UTC]
Π²ΠΎΠΎΠ±ΡΠ΅ Π±ΡΠ»ΠΎ Π±Ρ Π»ΡΡΡΠ΅, Π΅ΡΠ»ΠΈ ΠΊΠ°ΠΆΠ΄ΡΠΉ ΡΠ°Π· Π±Π»ΠΎΠΊΠΈ Π±ΡΠ»ΠΈ ΡΠ°Π·Π½ΡΠ΅ Π ΡΠΎ ΠΏΡΠΎΠΈΡΡ
ΠΎΠ΄ΠΈΡ ΠΎΠ΄Π½ΠΎ ΠΈ ΡΠΎ ΠΆΠ΅ ΡΡΠΎΠ»ΠΊΠ½ΠΎΠ²Π΅Π½ΠΈΠ΅.
π: 0 β©: 0
wonderwhy-ER In reply to deArtistofWar [2010-01-25 07:33:24 +0000 UTC]
Haha you have no idea how fun it was when I got to first two rects colliding yesterday
π: 0 β©: 1
deArtistofWar In reply to wonderwhy-ER [2010-01-25 12:32:52 +0000 UTC]
hah - hah, I can try to imagine. c:
π: 0 β©: 0
HiGhLy1 In reply to ??? [2010-01-24 23:03:27 +0000 UTC]
whoa what... How?? Rendering that many particles in a physical environment... without calc lag... makes my cock burn...
π: 0 β©: 1
wonderwhy-ER In reply to HiGhLy1 [2010-01-25 07:36:34 +0000 UTC]
Well this is 5th version of collision study that goes on for few years I think
Started at hundreds of balls and slowly got here
π: 0 β©: 0
<= Prev |