[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - Speed with Springs

Speed with Springs

Official forum for the .

Speed with Springs

Postby brettc » Thu Apr 19, 2012 12:59 am

brettc
 
Posts: 10
Joined: Thu Mar 08, 2012 9:12 pm

Re: Speed with Springs

Postby slembcke » Thu Apr 19, 2012 9:09 am

Woah. You are using 1/500th of a second as your timestep. That is crazy small. Most simulations use between 1/60th to 1/180th of a second.

Also what are you using for solver iterations (space.iterations, not to be confused with your iterations variable you are using for substeps).
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Speed with Springs

Postby brettc » Sat Apr 21, 2012 9:09 pm

OK. You've confirmed I was doing something dopey! I think I just cut and pasted this code from a pymunk example. The space.iterations was set to 1. So I've rewritten it now with some more informed values (dt = 1/50, and space.iterations=10).

Now, however, the physics is very unstable. I've discovered this is because I'm using a very high value for the spring stiffness (> 500!). I'm really just tuning things so they "look right", rather than paying much attention to values. So a high spring stiffness looks like a bad idea, unless you use lots of iterations.

I'm now trying to use the PinJoint. I take it that I can make this act a little "spring-like" by tuning the parameters.

What I'm looking for is a stretchable, highly damped spring. And when the spring gets too stretched, I remove the joint.

If you have any suggestions, that would be great.

Cheers,
Brett
brettc
 
Posts: 10
Joined: Thu Mar 08, 2012 9:12 pm

Re: Speed with Springs

Postby cjhorton » Sat Apr 21, 2012 10:26 pm

I wonder if constraining the cells to the ground instead of each other would work?
cjhorton
 
Posts: 11
Joined: Fri Mar 30, 2012 11:04 pm

Re: Speed with Springs

Postby brettc » Mon Apr 23, 2012 6:10 am

brettc
 
Posts: 10
Joined: Thu Mar 08, 2012 9:12 pm

Re: Speed with Springs

Postby slembcke » Mon Apr 23, 2012 10:19 am

Yeah. Using a stiffness of 500 sounds pretty high (at least guessing that your cells masses are in the 1-10 range). You could try using soft pivot or pin joints (set the maxForce of the joint to something other than infinity). That will act somewhat like an very strong, highly damped, but stable spring. It's not quite the same behavior, but maybe it will be closer to what you want anyway.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Speed with Springs

Postby cjhorton » Mon Apr 23, 2012 5:51 pm

Yeah, constraining them to ground wouldn't work. I forgot that even cells in the center keep dividing after their initial divide.

I assume you are wanting to do something similar to this?



You say cells can bud two others...are you limiting how many times each cell can divide(like a cell can be a parent to two other cells only?) or was this a simplification of the division of cells? It seems that you will have more than 200 springs for 400 cells unless you are removing them at some point.

Image

If the cells can only be a parent to two child cells, then the initial cell(cell 1) will only be attached to two cells. But, every cell (cells 2, 3, and ...) after that will be attached to three cells. If the cells can be a parent to more than 2 child cells, then there will be n attachments.

You are taking this into account?
cjhorton
 
Posts: 11
Joined: Fri Mar 30, 2012 11:04 pm

Re: Speed with Springs

Postby larryb » Mon Apr 23, 2012 10:30 pm

@brettc,
You've probably seen these videos:
-> Scott's: Jelly Chipmunk
-> Soft body physics using Box2d

I guess it would be more like:


Are these showing similar physical properties that you want for the cell bodies?
larryb
 
Posts: 3
Joined: Mon Oct 10, 2011 12:18 am

Re: Speed with Springs

Postby brettc » Sun Apr 29, 2012 2:33 am

Hi. Thanks for the all the responses.

cjhorton: the video is definitely something like the idea. I've actually written something similar using box2d. The particular problem I'm interested here is much simpler. The cells actually bud, rather than split (yeast do this). At the moment a cell is simply a circle. I want to keep cells simple so I can have lots of them. And yes there are lots of springs. The first cell has 4 daughters (branches). After that, each cell can have 1 or 2 daughters. The cells quickly get crowded, and joints get stressed. Then I break them.

larryb: Thanks for the vids! I've seen some of those, and as I say above, I've even made something like this. But this one is a bit simpler. The cells are not softbody, just simple circles. I'm interested in the relationship between branching and joint strength, and how it affects the size of clumps that break off.

I've now got it working using pinjoints. It works ok, but there is a lot of "quivering" behaviour. This, I take it, is instabilities in the physics. I'll play around and see if I can improve it.

Thanks for the interest. I'll put something up on youtube soon...

Brett
brettc
 
Posts: 10
Joined: Thu Mar 08, 2012 9:12 pm

Re: Speed with Springs

Postby slembcke » Sun Apr 29, 2012 10:19 am

Are you using 0 length pin joints? If you are, you should substitute pivots instead. With a large number of constraints in the space, you'll need to turn up the number of space.iterations (spring forces aren't actually constraints, only the damping is, so the iterations wouldn't have made much of a difference there).
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 0 guests