Dough

5 posts

Flag Post

I found a really neat applet by BlueThen on dough. The program was in Java, and was checking the distance between two points. If the points were close enough, the points were then connected. Then the points would have to be farther away to be disconnected. I thought it would be a great way to simulate fluid. The applet in question which can be found here used thousands of points. If I ported this to AS3 for my game, how many points do you reckon could be added before the SWF drops below 25 frames?

 
Flag Post
Originally posted by jasonjie88:

I found a really neat applet by BlueThen on dough. The program was in Java, and was checking the distance between two points. If the points were close enough, the points were then connected. Then the points would have to be farther away to be disconnected. I thought it would be a great way to simulate fluid. The applet in question which can be found here used thousands of points. If I ported this to AS3 for my game, how many points do you reckon could be added before the SWF drops below 25 frames?

TBH it entirely depends on how you implement it. Blitting/bitmap/bitwise and all that you could probably get a decent amount.

 
Flag Post

I don’t believe blitting is going to be the most expensive part of those calculations. I think the math might take longer than the rendering easily.

You still probably could be looking at several hundred points at 30 fps.

 
Flag Post
Originally posted by UnknownGuardian:

I don’t believe blitting is going to be the most expensive part of those calculations. I think the math might take longer than the rendering easily.

You still probably could be looking at several hundred points at 30 fps.

Yea, blitting wouldn’t take much work- but using a Vector and bitwise ops you could easily triple the speed from Arrays and standard mathematical equations.

Edit: Spatial partitioning would vastly increase performance also.

 
Flag Post

I did something somewhat related in AS3 a long time ago.

http://megaswf.com/s/2458657

Since it was a long time ago (when I knew even less than I do now), I guarantee that the code could be extremely optimized.