How do I ; Chipmunks + rts

Get help using Construct 2

Post » Mon Sep 21, 2015 3:09 pm

Hey,

A while back i reed that you can pair chipmunks physics with rts, for units not to walk on top of each other. Can someone tell me how to make it work that way?Thx!
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
85
S
27
G
20
Posts: 1,962
Reputation: 18,651

Post » Mon Sep 21, 2015 9:22 pm

You can attach the physics object to another physics object via a joint, and move one like so:
also make sure the objects don't collide with each other.
Then you would just move the object that needs to follow a path, and the physics object attached will get pulled.
Image

edit: the 10*sprite2.mass stuff should be 100 instead of 10.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Mon Sep 21, 2015 11:31 pm

I was searching around and didn't you ask this before in a way?

Anyway can't this problem be simplified further?
https://dl.dropboxusercontent.com/u/542 ... _push.capx

Use a family to be able to pick two different instances and then just compare the distances between the two and then move them apart with the "move at angle" action if they're too close?
B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Post » Wed Sep 23, 2015 9:32 pm

Prominent wrote:You can attach the physics object to another physics object via a joint, and move one like so:
also make sure the objects don't collide with each other.
Then you would just move the object that needs to follow a path, and the physics object attached will get pulled.
Image

edit: the 10*sprite2.mass stuff should be 100 instead of 10.


Thx. Willlook in to it.

R0J0hound wrote:I was searching around and didn't you ask this before in a way?

Anyway can't this problem be simplified further?
https://dl.dropboxusercontent.com/u/542 ... _push.capx

Use a family to be able to pick two different instances and then just compare the distances between the two and then move them apart with the "move at angle" action if they're too close?


Hi,

Thx for example. Will examine it. But I have concern that it wont work well, if its based of example from example rts project. The issue in rts example is that pushingout is easy to glitch out,with just few clicks the units end up on topof each other. But will examine.

Still I'm interested to see ho it would workwith physics. Bouncing out would be desirable too.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
85
S
27
G
20
Posts: 1,962
Reputation: 18,651

Post » Fri Sep 25, 2015 8:06 pm

My capx will keep the enemies from piling up. If they are piled up they will spread out very quickly. The only drawback is they can be pushed into the walls a bit if things are crowded.

Prominent's solution is to basically have a second object attached to the object with the pathfinder behavior. That bypasses the pathfinder overriding the physics positions, and probably is the best way to Incorporate physics. The rest is to stop the velocity of the objects so all we get is the pushing action. I'm unsure of the purpose of the force though.
B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Post » Fri Sep 25, 2015 8:43 pm

R0J0hound wrote:My capx will keep the enemies from piling up. If they are piled up they will spread out very quickly. The only drawback is they can be pushed into the walls a bit if things are crowded.

Prominent's solution is to basically have a second object attached to the object with the pathfinder behavior. That bypasses the pathfinder overriding the physics positions, and probably is the best way to Incorporate physics. The rest is to stop the velocity of the objects so all we get is the pushing action. I'm unsure of the purpose of the force though.



Would you be able to make example with physics for me? I'd highly appreaciate it!
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
85
S
27
G
20
Posts: 1,962
Reputation: 18,651

Post » Fri Sep 25, 2015 10:50 pm

R0J0hound wrote: I'm unsure of the purpose of the force though.

force was just to negate gravity, but I suppose the gravity could be turned off instead. Could probably also use different type of joint if you want it more springy. I don't know what would happen if you have multiple objects trying to pass each other, etc. They would probably bump into each other and try to get around- so a circular shaped physics object would help prevent them getting stuck. You could probably stop the path movement if a physics object gets too far away, to allow it to catch up, or even perform some other operation to walk through other objects, like changing the physics group it is in temporarily.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Sun Sep 27, 2015 7:23 pm

@R0J0hound Ive checked your demo, but I can see it not working that tight in rts game :< Could I ask you for help again, to make a demo of rts movement with physics? Thx
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
85
S
27
G
20
Posts: 1,962
Reputation: 18,651

Post » Mon Sep 28, 2015 2:33 am

@Prominent
Ah, that does make sense. I forgot about that.

@megatronx
Doesn't Prominent's idea work?
B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Post » Mon Sep 28, 2015 11:43 am

R0J0hound wrote:@Prominent
Ah, that does make sense. I forgot about that.

@megatronx
Doesn't Prominent's idea work?


I'll check now. But even if it does, I have no clue how I could apply this to many units. Any suggestions?

I'm thinking of such idea: out of selected units having only first unit pathfind, and the others are following either it or create a chain. How this could be done?

edit@ @R0J0hound The @Prominent example doesn't seam to work https://www.dropbox.com/s/9286l0hy9pp9etk/tst.capx?dl=0
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
85
S
27
G
20
Posts: 1,962
Reputation: 18,651

Next

Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher, zsoldiers and 5 guests