Shop Mobile More Submit  Join Login
How to use
All 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 :D I think there still is room for optimization + making it more stable but it is already very good :)


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 :) Still thinking.
Add a Comment:
 
:iconlaurenisabae:
laurenisabae Featured By Owner Aug 16, 2015  New Deviant
Tetro is my favorite :3 This is me, when clicked on tetro: yay 
Reply
:icondj-derpyhelmet:
DJ-derpyhelmet Featured By Owner Oct 11, 2014  Professional Traditional Artist
i crashed
Reply
:icontawnypeltwarrior:
tawnypeltwarrior Featured By Owner Aug 14, 2014  Student Artist
I made my shockwave crash ;u;
Reply
:iconzoiexx:
Zoiexx Featured By Owner Jan 27, 2014  Hobbyist General Artist
The tetro makes me feel like I'm falling.
 I like it.
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Jan 28, 2014
)
Reply
:iconlespiritkitten565:
LeSpiritKitten565 Featured By Owner May 31, 2013  Student General Artist
Tetro = Expanding circle, then fills in the universe C:
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Jun 1, 2013
:)Yeah this universe started from 4 blocks :D
Reply
:iconxxdoctormythxx:
xXDoctorMythXx Featured By Owner May 20, 2013  Student Artist
omg the whole thing woz filled with balls lol
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner May 20, 2013
)
Reply
:iconalphawolf1212:
alphawolf1212 Featured By Owner Jan 4, 2013  Hobbyist Traditional Artist
this is AWESOME!!!
Reply
:iconphoenixwing18:
PhoenixWing18 Featured By Owner Feb 13, 2012  Hobbyist General Artist
WWWWOOOOOOOOOOOOOOOOAHHHHHHHH THAT TETFRO ONE IS WILD
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Feb 14, 2012
Hehe, yeah like it too :) Could be used as interactive logo for physics engine or something :D
Reply
:iconphoenixwing18:
PhoenixWing18 Featured By Owner Feb 14, 2012  Hobbyist General Artist
yea ikr
Reply
:icondynamicability:
dynamicability Featured By Owner Apr 19, 2011
sci-fi!!!
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Apr 19, 2011
Not anymore, its reality now :D
Reply
:icondynamicability:
dynamicability Featured By Owner Apr 19, 2011
that is so great because it's kinda fun
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Apr 19, 2011
Heh, I have potentially more fun thing based on that. Here [link]
You can collide images with it :)
Reply
:iconcypherwraith:
CypherWraith Featured By Owner Jan 4, 2011
Damn, dude. This makes my attempts at flash feel stupid. Excellent job!
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Jan 4, 2011
Heh, well I was starting somewhere too :)
Reply
:iconheliacwolf:
HeliacWolf Featured By Owner Dec 31, 2010  Student Digital Artist
Шикарно) Мне особенно нравится Тетро)) Завораживает)
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Dec 31, 2010
Ага :) Тетро прикольный, подходит как логотип движка или что то :)
Reply
:iconheliacwolf:
HeliacWolf Featured By Owner Dec 31, 2010  Student Digital Artist
Ага))
Reply
:iconiluvcats123:
iluvcats123 Featured By Owner Dec 24, 2010
you and shock-value r gods!^-^
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Dec 24, 2010
Ahaha that's new and exaggerated I guess :D But thanks.
Hmm on other hand on which criteria do you judge us like that? I mean for example this work here needs some understanding of what is possible and not with Flash to truly make a comment like that. Makes me curious if you do or just like how it looks :)
Reply
:iconnight976:
Night976 Featured By Owner Nov 26, 2010
how do u control the particles?
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Nov 26, 2010
What do you mean?
Reply
:iconqrs22:
qrs22 Featured By Owner Sep 19, 2010  Hobbyist Digital Artist
Cool.
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Sep 19, 2010
Thanks :)
Reply
:iconqrs22:
qrs22 Featured By Owner Sep 19, 2010  Hobbyist Digital Artist
No problem, although a level designer would be nice.
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Sep 19, 2010
Will do something with time I guess, checking out various collision resolution schemes now. Check my newer works to see. Also check this [link] I guess you will like that :)
Reply
:iconsonicrules1:
SONICRULES1 Featured By Owner Aug 30, 2010
LAWL i got it to max amount of ballz: 50000 (dont do it cus its a giant LAG
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Aug 30, 2010
Hehe, well yeah it is dangerous :)
Reply
:iconsukomi:
sukomi Featured By Owner Jul 7, 2010
Epicness!
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Jul 7, 2010
Thanks :D
Reply
:iconparanoio:
paranoio Featured By Owner May 26, 2010
very nice performance and thanks for the book link i was looking for something like that
So you use a grid ? i was thinking in create a grid class but with the option to be recursive hope that make sense to use with some experiments of motion detection, would like to hear more of your method.
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner May 27, 2010
Well that books covers (may be not very deeply) all broad phase algorithms I know. Various trees, grids, sorting etc. Good for checking what techniques are used and why. Though as I said it gives kind of superficial(if that's the right word) overview so it may not be enough if you don't have some prior or other sources of information on the subject.

An yeah I use uniform grid here. As for recursive I think you mean breaking regions of grid to subgrids depending on how many balls fall in it. I tired it before and it does seem to have a bonus of not needing to specify grid size as it does that itself based on situation. But there is a problem with it... You need to rebuild it each time(other algorithms may not need that) and also looping trough it becomes not trivial. By that I mean that in any grid based variation of such clustering there will be objects who span over many cells. So for them you need to loop trough such cells. And for such nonuniform grid that process may be less trivial. I don't imply that this approach is slower, it just that it highly depends on many details of realization and for that case it is very hard to get them right... May be some day I will try. Though I am not shore I need to at the moment. This thing works very fast already for 2D stuff + I have ideas for probably speeding it up even more.
Reply
:iconparanoio:
paranoio Featured By Owner May 27, 2010
yea the use of a subgrid was just an idea i had when working in a project but as you said its dynamic wich sometimes makes the movie become slow .

wish flash someday has the power to do this : [link]

Anyway im starting to read the book , thanks again.
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner May 27, 2010
Welcome :)
As for link. Well I think major problem is 3D graphics there. Having 3K physical objects I think is possible or is very close to being possible. Problem is that rendering happens in CPU, with effective offloading to GPU I think we could win some 50% of power + C++ is still some 20x faster and I think with better compilers and some improvements to language in strict mode flash should be able to get some 10x speed up (check how much Haxe or Joa Ebert apparat can squeeze out of existing player) or how Adobe managed to insanely optimize Flash for Android :) I also heard that a team of developers was formed inside Adobe to build next generation Flash compiler so we can wait hopefully some amazing improvements in that direction after 1-2 years(seems to be usual Adobe development cycle wtih CS3 being out in 2007 CS4 in 2008 and CS5 now in 2010) I guess we can await it next spring/summer :)

I am also very curious about Unity3D and JS optimizations Google and others do + WebGL combo... Though demos I saw of WebGL was not impressive so far... Eat CPU at Flash 3D level :(
Reply
:iconharm-less:
Harm-Less Featured By Owner May 10, 2010  Professional Interface Designer
O..M..G, amazing dude, you're so good with math based things :P

And hi btw, long time no speak. I've been busy with a lot of things, I'm sure you know how that goes :)
How are you doing?

Ontopic: Funny coincidence, I was browsing the web for "collision/check if in range" algorithms when I stumbled upon this new study of yours (I've haven't been on DA much too, sorry :P ). So far I was really impressed by this: [link] but it seems yours is even faster and even with actual collisions. I'd love to see how you did it :)
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner May 11, 2010
Thanks tough everything is relative :) I am not really THAT good with a math but probably better then average.

Yeah especially in freelance it becomes pretty chaotic and busy :) What you are busy with?
As for me. Finished with freelance for now(well not really one damn project still haunts me? Already told them in January that I don't have much time for them).
Working in firm that writes games for social networks now. Can't say I am fully satisfied but it is a valuable experience.

I think that uniform grids and sweep and prune have more power if made right. Quad tree is too complex of a structure that is more expensive to reconstruct and depending on how you do it may be more expansive to loop trough.
Here I am actually experimenting with various ideas for combining Sweep And Prune and uniform grids. Sweep And Prune is powerful because it is simple and reuses sorting ideas well and it can be lopped trough efficiently. But when there are so much objects it starts to loose as it does not filter out collisions that are on same lines. So if you have 1000 objects on same line its efficiency falls considerably. While grids often are too complex to loop trough and they often use indexed arrays, are harder to rebuild etc etc. But it does not have flaws with lines which makes it potentially better.
Currently thinking of ways to combine strong parts of both eliminating weak parts of both :) This one actually is an early try. When will have time will try some more.
Reply
:iconharm-less:
Harm-Less Featured By Owner May 13, 2010  Professional Interface Designer
Well, I got into the freelance business again recently, but full-time this time. Hopefully it will work out :)
I'm working on a remake of my homepage and I'm working on an rts game which is a dream of mine, I'll show you soon. Really hard to balance the performance just right, that why I need a fast "check if in range to shoot" algorithm to name an example :)
And on the lookout for clients of course :)

But right now I'm planning to check every .5 or 1 second if and enemy is in range, it doesn't have to be every frame. I think that works just fine.
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner May 13, 2010
I see making game then :) How many enemies?
Reply
:iconharm-less:
Harm-Less Featured By Owner May 14, 2010  Professional Interface Designer
Ehm, well, I was hoping at least 500 units total, my team and the enemies. I don't think 1000 will be a good think to do, so I'll just limit the amount of units you can create in the final game.
So far it looks like it can be be done with tests I ran. I've done a lot of optimizing the performance already, I want this game to be as perfect as possible. I'll show you an example as soon as I can.
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner May 14, 2010
I see :) Well good luck :)
Reply
:iconkichakicha:
kichakicha Featured By Owner Apr 1, 2010  Hobbyist Digital Artist
Love It ^^

Improve Your Skills, You Will Be Great :D ;)
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Apr 1, 2010
Thanks :D
Reply
:iconthecosmicmonkey:
TheCosmicMonkey Featured By Owner Mar 17, 2010
I love it so much and how did you do it?
Reply
Add a Comment:
 
×




Details

Submitted on
January 24, 2010
Image Size
42.8 KB
Resolution
700×700
Thumb

Stats

Views
29,184 (1 today)
Favourites
191 (who?)
Comments
144
Downloads
327

License

Creative Commons License
Some rights reserved. This work is licensed under a
Creative Commons Attribution-Noncommercial 3.0 License.
×