Shop Forum More Submit  Join Login
Well not that I am completely satisfied with performance of collision detection I am off to collecting various collision resolution schemes and other stuff that comes with them (simulation integration schemes).

How to use
Just click, hold and move mouse to spawn balls, rollover components to see hints about them

Schemes I used here

Firstly my older code that dates back to my experiments with Ball World [link] back in 2007
Back then it was too slow to see how unstable it gets sometimes.

Second scheme is Position Verlet, very simple and more stable then my code, still easily goes crazy at around of 1k or more balls. You can see nice Java example here [link]

I plan to add more schemes in future.

So far it seems that in such cases it is physics stability that becomes a bottleneck and not the performance :) Hmm hmm :) Also as I am lazy and it is a testing builds it contains a some of unnecessary code like system energy calculation that eats up performance. So it's not at its best in that sense.

Update
Small change, tried adding other model but so far failed,
aside from that thought that it would be good to see how unsatisfied situation is. So added coloring to balls that shows how much penetrations by other balls they experience this frame. For Verlet it also represents how much energy is emitted by them this frame to push out those other balls :)
Add a Comment:
 
:iconinfestedmatt03:
InfestedMatt03 Featured By Owner Sep 30, 2014  Student Digital Artist
i turned it down to 0 balls

it crashed :/
Reply
:iconinfestedmatt03:
InfestedMatt03 Featured By Owner Sep 30, 2014  Student Digital Artist
100 Gravity: ...
Reply
:iconirawarrior:
IRAwarrior Featured By Owner May 2, 2014  Hobbyist General Artist
Gravity: 0.3 + Amount of balls: 800 = Boiling effect!
Reply
:iconcrazyferretfun:
crazyferretfun Featured By Owner Mar 15, 2014  Hobbyist Traditional Artist
fun
Reply
:iconigloo-australia:
Igloo-Australia Featured By Owner Apr 25, 2013
50K balls 0 gravity and computer and game are still alive o.o
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Apr 26, 2013
Yeah, I did crazy stuff there :D
Reply
:iconvkremennaya:
vkremennaya Featured By Owner Oct 18, 2011  Student General Artist
SO... MANY... BALLS... oh wow it got stuck after 50k. XD
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Oct 19, 2011
Hehe, thanks. And for :+fav:'s too :)
Reply
:iconvkremennaya:
vkremennaya Featured By Owner Oct 19, 2011  Student General Artist
XD np. Keep up the great work!!! I find hours of enjoyment on the little flashes :3
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Oct 20, 2011
Hehe :D Thanks :)
Reply
:iconvkremennaya:
vkremennaya Featured By Owner Oct 20, 2011  Student General Artist
np... TOWER STACKER FTW
Reply
:iconvbcnxm:
vbcnxm Featured By Owner Aug 7, 2011
heh, it crashed with 1772 balls at 0 gravity
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Aug 8, 2011
Heh :) Browser crashed?
Reply
:iconvbcnxm:
vbcnxm Featured By Owner Aug 8, 2011
no, not quite, only the game/test did, I was still able to browse around
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Aug 8, 2011
Ouh, which browser do you use?
Reply
:iconvbcnxm:
vbcnxm Featured By Owner Aug 8, 2011
I'm using internet explorer, the test/game just went blank with an exclamation point, crashing the test, but while crashed and crashing, I was still able to open new tabs, browse off of them, and scroll on the page
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Aug 9, 2011
Heh, interesting. I do not use IE for quite a while, just checking that my stuff works there from time to time and that's it :) Interesting how it behaves when Flash starts to use lot of resources and look as if it froze.
Reply
:iconheliacwolf:
HeliacWolf Featured By Owner Dec 31, 2010  Professional Digital Artist
АВфыаы ааа это такая забавная игрушка *____* супер 8D
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Dec 31, 2010
Спасибо :) С наступающим новым годом тебя, побольше тебе вдохновения и творчества :)
Reply
:iconheliacwolf:
HeliacWolf Featured By Owner Dec 31, 2010  Professional Digital Artist
И тебя тоже с наступающим)) *_______*
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Dec 31, 2010
Как празднуешь? С друзьями? С родственниками?
Reply
:iconheliacwolf:
HeliacWolf Featured By Owner Dec 31, 2010  Professional Digital Artist
С родственниками)
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Dec 31, 2010
А я тоже :)
Reply
:iconalexasharlot:
AlexaSharlOt Featured By Owner Dec 7, 2010
Awesome balls :D lol
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Dec 7, 2010
In real world conversation I would be confused from such phrase I guess :rofl:
But thank you :rofl:
Reply
:iconthecheesegrater:
theCheeseGrater Featured By Owner Oct 26, 2010  Hobbyist Digital Artist
This was fun to play with :D I have a new and shiney computer.... i managed to run this with 4000 balls which filled up the entire screen completely. The verlet algorithm produced an nice even distribution where as your old algorithm produced awesome looking metaball things :P it started loosing fps at about 7000 balls though this still only registered as 10% on my cpu. also it would seem as though it mainly uses only one of my 8 threads and only slightly uses 3 others. So i wonder what the limiting factor is then? RAM speed maybe? If action script ever supports the use of 8 threads you could do some amazing things with flash :O

anyway... well done :P :thumbsup:
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Oct 26, 2010
Heh, 8 core PC? That's big :D
Well using multiple CPU's is tricky, if every banner maker will be able to do it it can be pretty dangerous. I actually was testing some stuff with clipboard and managed to hang my PC trying to save something like few milliards of symbols in to the clipboard, froze it so much that even ctrl+alt+delete failed to show :D Imagine what noombs can do being able to spawn threads as much as they like.

10% and drop in FPS... Hmm... Half of the problem here is rendering, but I wonder why it is 10% usage only. Still impressive how much you CPU can handle :)

Have you seen/read my last journal? Have you seen Adobe Max session?
Reply
:iconthecheesegrater:
theCheeseGrater Featured By Owner Oct 27, 2010  Hobbyist Digital Artist
true true... banner adverts able to max out my intel 960 is a bit scary :S
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Oct 27, 2010
Yeah, I wish that Adobe make some params for Flash player that tether it so that site owners will be able to impose limitation on user resource use + probably giving some of it to the user like it ask for camera and or P2P functionality access. Probably it is good idea to make it ask for for high performance stuff too.
Reply
:iconthecheesegrater:
theCheeseGrater Featured By Owner Oct 26, 2010  Hobbyist Digital Artist
refreshed the window and tried again... runs with a poor frame-rate then crashes the plugin as soon as you add more then 100 particles... either Adobe or Mozilla has some explaining to do... lol
Reply
:iconpavelzuk:
pavelzuk Featured By Owner Oct 8, 2010  Professional General Artist
Hah 50,000 balls almost crashed the game, and once I set it back to 100, it won't work :c
[link]
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Oct 8, 2010
Ouh my god you are crazy :D Strange it did not hang or something :D
Reply
:iconjoeylol:
JOeYLOL Featured By Owner Oct 5, 2010
FLAMING BALLS
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Oct 5, 2010
Kind of :)
Reply
:iconsimsdoc:
SimsDoc Featured By Owner Oct 4, 2010
I like this alot the collision looks very nice , good update.
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Oct 5, 2010
Thanks :)
Reply
:icongrungetv:
GrungeTV Featured By Owner Oct 4, 2010  Professional General Artist
Nice update mate! The colours are a great touch! :)
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Oct 5, 2010
Yeah this gives something like collision energy transfers visual representation. Noticed that with Verlet energies go one direction from right to left.
Reply
:iconpixelquarry:
pixelquarry Featured By Owner Oct 4, 2010
That's neat!
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Oct 5, 2010
Thanks :)
Reply
:iconsmilyorg:
SmilyOrg Featured By Owner Sep 25, 2010
How are you applying the resolution step in the Verlet scheme? How many times? That's not nearly enough times! :D

Also, don't cheat by having low gravity! :D
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Sep 25, 2010
Well what gravity is set by default is not important, I am comparing resolution/integration schemes here, you can set it to higher if you want.

As for iteration, once for both, again for comparison of how they fare in same circumstances.
Reply
:iconsmilyorg:
SmilyOrg Featured By Owner Sep 26, 2010
I was mocking you for having low gravity, because low gravity just masks the inherent instability of the system ;)
I'd be nice if you added an additional scheme that has more Verlet resolution iterations per frame, because it makes the whole system a LOT more stable even at higher gravity numbers :)
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Sep 26, 2010
Well I guess comparing those algorithms that can have multiple iterations per step is good idea as they may have different mm convergence speed. But so far Verlet is only one I know of + I am not really sure how it is implemented, just running collision detection/resolution step multiple times? Seems expansive.
Reply
:iconsmilyorg:
SmilyOrg Featured By Owner Sep 26, 2010
I think it's pretty much just running the resolution like 2-3 times with a finer/lower correction/timestep for each one :)
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Sep 26, 2010
Hmm but that would have consequences. I mean resolution happens only for collision pairs, if only that step is run multiple times then new pairs are not added and others are not removed while balls move because of resolution. As a result it will be less correct. You will be ending up with balls moving inside other balls they did not collided before the step.
Reply
:iconsmilyorg:
SmilyOrg Featured By Owner Sep 27, 2010
But if you do both detection and resolution multiple times, consequences will never be the same!
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Sep 27, 2010
Well thing here is that by doing more iterations you hope to converge to the real solution of the problem more precisely. But in what you proposed may be it will make error smaller for found collision pairs but while it will raise error for now found ones especially in such case as I test here...

Considering that Verlet copes with that stuff with energy it will become exploding... Or so it seems to me. I mean at step 1 ball A moved outside ball B will be moved in to ball C more, at next step opposite will happen as now ball A collides with C and will be moved inside ball B again... Seems to me it may become quite dribbling and unstable... Or so is my logic.

BTW did you use some kind of article as base for your experiment? I remember I asked you something like that then :) But don't remember your answer.
Reply
(1 Reply)
:iconalimjshafi:
alimjshafi Featured By Owner Sep 21, 2010  Student Filmographer
Excellent Job Man!
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Sep 21, 2010
Thanks :)
Reply
Add a Comment:
 
×




Details

Submitted on
September 19, 2010
Image Size
43.8 KB
Resolution
1200×750
Link
Thumb

Stats

Views
12,144
Favourites
53 (who?)
Comments
65
Downloads
163
×