Cosm – having agents following each other in cosm

May 1, 2011 at 8:25pm

Cosm – having agents following each other in cosm

Hi

I am using the Cosm library, and I have a few agents with randomly fluctuation colors. I want agents to follow each other based on if they are the same color, at any given moment

I am getting the XYZ world coordinates from each one – and am using (ZL Compare) and (gate) to check if agents match and send coordinates to the other same-colored agent – but when I send them through (pak position f f f) and to (cosm.nav) of the other agent, the only thing that happens is that the agent is positioned in the middle of the world.

In other words; they dont follow each other but are only repositioned in the place the start when the patch is loaded

If anyone has been building algorithms to have agents chaise eachother It would be much appriciated if you could show me how you have done it.

Best regards

#56769
May 1, 2011 at 8:50pm

The best example are in the cosm example patcher in the Camera Follow subpatch. But I think you have to send the position xyz to the object directly.

The proper way to do this I think though is a little trickier. Will investigate.

– Pasted Max Patch, click to expand. –
#203451
May 1, 2011 at 9:02pm

Thanks :)

#203452
Oct 17, 2011 at 11:43pm

I am trying to use the camera follow subpatch above

It works fine for a while (about a minute) but after that, the camera sets on a certain trajectory and stops following the given agent??

seems like a bug

Also, when this happens the W,A,S,D buttons stop working ( they work until this “bug” starts its thing)

Any good ideas of what might be causing this to happen ?

All the best.

#203453
Oct 19, 2011 at 5:11pm

Hi

There could be a bug in the camera tracking patch; maybe the quaternion is not being normalized (small differences can accumulate over time, leading to bizarre results), or maybe its an issue with measuring the distance in the toroidal space. I’m sorry that with the Max 6 release workload we probably won’t have time to look into this now.

Try changing the speed at which the camera follows (slow it down) or vary the distance to the followed object – might not fix it, but might make it take longer to become apparent. Sorry I can’t be more helpful right now.

Graham

#203454
Oct 19, 2011 at 5:55pm

Thanks grrrwaaa

Yeah if I jerk the rotation control of each agent – then it starts working again but stops working after the same time interval, after that

I have yet to test if changing speed will affect it in any way

I am trying to get agents to follow each other like a flock and I would actually like the following-patch to be faster than in the above example

I understand that many Max-ers are busy with Max6 coming out, but if you have any other examples (or can point me to) of agent following patches or methods, it would be much appriciated

(also if you have any more documentation or examples than is on the cosm website/download I would be very interested.)

Thanks alot for the response

Best regards.

#203455

You must be logged in to reply to this topic.