Cosm - having agents following each other in cosm

    May 01 2011 | 8:25 pm
    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

    • May 01 2011 | 8:50 pm
      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.
    • May 01 2011 | 9:02 pm
      Thanks :)
    • Oct 17 2011 | 11:43 pm
      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.
    • Oct 19 2011 | 5:11 pm
      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.
    • Oct 19 2011 | 5:55 pm
      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.
    • Dec 23 2015 | 4:12 pm
      Hello edsonedge
      Did you manage finally to get it? I´m also interested in something similar. I want to find an ant logarithm; agents tracing ´pheromonic´ paths, that lead the other agents to the same target, constructing at the end a well-shaped and optimized path as ants do in real life. I know that this algorithm exists, but I can´t find something simiar in Max. There is other emergent agent based modeling based in flocks in JavaScript examples in Max, but not the one that I´m searching. Any clue?