How do I find out with chipmunk joints?

Get help using Construct 2

Post » Sun Dec 13, 2015 7:36 pm

Message: Paramonov can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
http://www.youtube.com/watch?v=vLp_BO3AUAs
Image
Image
Hi, I need help on the joints. As you can see in the screenshots, I create something like microorganism fluid forms. At this stage, I ran into a problem: the cells repel each other and do not want to live together as a single substance. What additional commands should be used? How can I do to cells could be added, the body grow, and being lived in one form? In principle, it does not matter, it will be liquid or not, the main thing - is that growth is on the cells, as well as destruction.

Still I am trying to make sure that they are not repelled by each other like mad, but do not pass through each other. Any idea how to do it?
Sorry for my English, I myself am from Russia.
B
7
S
2
Posts: 13
Reputation: 710

Post » Mon Dec 14, 2015 10:21 am

any help?
B
7
S
2
Posts: 13
Reputation: 710

Post » Mon Dec 14, 2015 10:29 am

As stated here..
Please be patient while waiting for response..
Not everybody is online all the time..

Your question is about chipmunk physics, which is a third party plugin not many people use, so the amount of people able to answer your question isn't really big..

I guess your best bet would be to wait for @r0j0hound
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Dec 14, 2015 7:50 pm

@Paramonov
I don't think chipmunk is going to be fast enough for any kind of fluid simulation with particle attraction forces. I had a go & couldn't get anything to work with decent frame rates - here's my best attempt:

https://dl.dropboxusercontent.com/u/523 ... nTest.capx
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Mon Dec 14, 2015 8:48 pm

Message: Paramonov can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
mattb wrote:@Paramonov
I don't think chipmunk is going to be fast enough for any kind of fluid simulation with particle attraction forces. I had a go & couldn't get anything to work with decent frame rates - here's my best attempt:

https://dl.dropboxusercontent.com/u/523 ... nTest.capx

Unfortunately, I could not open the file due to an older version (not yet updated), but thanks anyway. I need it chipmunk as the assurances of developers - it is faster than a regular physics. A physics apply in general to essentially necessary that it interacted with the rest of the world.
B
7
S
2
Posts: 13
Reputation: 710

Post » Mon Dec 14, 2015 9:15 pm

Joints won't help in this case, and in your image you're creating a joint with itself which does nothing. what you want is to apply a force to all the objects to an average center. Here's one way:
Code: Select all
global number centerx=0
global number centery=0

every tick
--- set centerx to 0
--- set centery to 0

for each sprite
--- add sprite.x to centerx
--- add sprite.y to centery

every tick
--- set centerx to centerx/sprite.count
--- set centery to centery/sprite.count
--- sprite: apply force polar(angle(self.x,self.y,centerx,centery), 100)


I used a force of 100 but that could be changed. You could even make it proportionate with the distance from the center.
Further ideas include applying the force to the average center of only the particles in a radius around each particle. You could also do a repelling force between the sprites to keep them away from each other. It would give more of a fluid motion. You'd have to tweak it in such a way so the attracting and repelling forces balance.

Here's some fluid experiments i'be done before:
viewtopic.php?f=147&t=116854&p=842125&hilit=fluid#p842125

And here's one from today:
https://dl.dropboxusercontent.com/u/542 ... _blob.capx
To make it more fluid like I made the sprites be in a collision group to disable collisions between each other. Then I compared the distances between each pair and repel or attract depending on the distance. The forces are proportionate to the distances using a spring equation: Force=-k*displacement. To add to the stability I gave the sprites a max speed. Also I readjusted their positions when they get to close since the force when the objects are almost on top of each other will send the sprites flying.

One thing I haven't tried that's used in fluid simulations is velocity smoothing. Basically you average out the velocity of the particles around another particle, where the weight they have in the average depends on the distance.
B
89
S
30
G
95
Posts: 5,154
Reputation: 63,444

Post » Mon Dec 14, 2015 10:27 pm

Message: Paramonov can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
R0J0hound wrote:One thing I haven't tried that's used in fluid simulations is velocity smoothing. Basically you average out the velocity of the particles around another particle, where the weight they have in the average depends on the distance.

Your example is super, i will using some ideas from the distance. But you are a bit misunderstood my message. I'm not trying to make a liquid - I create a world with lots of organisms, and apply all the forces of physics for all I have not included in the plans. Well, I'm talking about the first three examples. And I'm trying to do it all with dynamic figures, now I will explain.
That is the concept like this: there is a cell, it is divided, creating around himself another cell, and so on. These cells create a single microorganism having the force of movement ONLY FROM the original CELL.
Image
That is the idea with joints look more than attractive. I also wanted to cover all the cells of some plastic shell, but the features of the program is not allowed. In your example, I try to think of something, but unfortunately, it is very clumsy method, because the body - it's not a bunch of rabid cells. In general, I will make its source code, look, if not more difficult.
http://rghost.ru/download/88VG78Mfb/d47282a5a6229200290acfaaaabd072f5a6227db/Evo2.capx
B
7
S
2
Posts: 13
Reputation: 710

Post » Tue Dec 15, 2015 5:08 am

I don't have all the plugins required to open your capx. If you want to attach objects together like that then yeah, joints would work. There are probably some examples in the forum that do that.

If the original cell is the same object type as the other cells then you'll need to do a forum search on how to pick two different instances of the same type so you can attach one to the other.

Once you can do that then the pivot joint combined with a gear joint is a useful way to attach two objects together (there's an example of this in the chipmunk topic). If the attached objects overlap at all they will jitter around so it's also to put connected objects in a collision group so the ignore collisions with each other.
B
89
S
30
G
95
Posts: 5,154
Reputation: 63,444

Post » Tue Dec 15, 2015 11:04 am

Success! I still did what I wanted. Not quite true, but it happened.
If it is useful, I leave scheme.
I created an invisible grid around the cell. Every time a cell divides - it is created on the spot invisible stuff and fixed with two joints to the previous cell. Invisible stuff destroyed.
Image
Image
Image
Image
Of course there is still much work, because me need to adjust the speed and a lot of other things, but generally work with joints over.
B
7
S
2
Posts: 13
Reputation: 710

Post » Tue Dec 15, 2015 1:43 pm

These cells create a single microorganism having the force of movement ONLY FROM the original CELL.


If you simplify the particle attraction forces to only point towards the main cell, you can get decent performance while keeping inter-particle collisions turned on (nice idea though R0J0hound having no collisons & only forces keeping them apart, performance seems good that way). Here's a fun experiment that looks like a radioactive fried egg :D https://dl.dropboxusercontent.com/u/523 ... tTest.capx
B
27
S
12
G
1
Posts: 157
Reputation: 3,359


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Cool Gamez, marcoscodas and 9 guests