Actors following main actor, and mimicking movements?

PhiliePhilie PRO Posts: 240
edited April 2012 in Working with GS (Mac)
Hello!

I have an idea for a game, and was wondering how difficult it would be to have a main actor, with 4 actors that follow him. Pretty much I was looking to do a follow the leader sort of idea, but say the main actor was on an obstacle course, and had to jump over something.. if he successfully jumped over, I'd like the other 4 actors, in order, to jump over too.

Is this possible, are there limits, is this too complex?

Any answers would mean a lot - thanks everyone!

Have a great day,
Matt

Best Answer

  • bloomerbloomer Posts: 53
    Accepted Answer
    I think the problem with implementing this design in GS is that it demands a mechanism for recording the movements of the first actor so that the following actors can copy him on a delay, and there isn't a facility for this.

    When tables become writeable you may get closer, but I think it would still be too difficult because any method requiring manual recording of data by the programmer is extremely fraught. This technique needs some kind of data stream object that's 'fire and forget'.. turn it on to start recording movements, plug it into other actors to have them copy it, no programmer intervention required.

    The closest I've seen, which still doesn't do what you really want, is to have a skeleton structure where objects follow each other. But that's the thing - they're interdependent, so if the head walks around in a small circle, the others don't walk around in a small circle. There's no delay or real copying going on, basically each segment drags along the next segment via a physical relationship. I saw this in DBA's Robosnake Template (which is pretty freaking cool!.. showed me how to do this.) That's a template you need to pay for to get it from their resource centre: http://www.deepblueapps.com/Deep_Blue_Ideas_Ltd./Home.html

Answers

  • jckmcgrawjckmcgraw Member Posts: 647
    @philie

    Hmmmm.... What is so significant/purpose of the other characters following the main one? I'm not trying to hammer down your idea, I just need to get a better feel for what you are trying to do.

    Jack McGraw
  • theCodeMonsterstheCodeMonsters Member Posts: 359
    edited April 2012
    Very easy to do, here's a video explaining it:



    Only instead of a mouse position, use your other actors. Same concept though.

    Go Check out my Progress on GSBot!
    Follow me on Twitter
  • jckmcgrawjckmcgraw Member Posts: 647
    @theCodeMonsters

    I don't know how that video would help @Philie
  • PhiliePhilie PRO Posts: 240
    Let me explain:

    Go to 4 minutes and 11 seconds in, watch that. You see how the one Mario follows the other exactly, thats what I want to mimic.

  • jckmcgrawjckmcgraw Member Posts: 647
    @philie

    Would the 2nd Mario (that is following the first) be there for effect, or would they have an otherwise significant purpose?

    Jack McGraw
  • PhiliePhilie PRO Posts: 240
    @philie

    Would the 2nd Mario (that is following the first) be there for effect, or would they have an otherwise significant purpose?

    Jack McGraw
    He has a purpose, there would be 4 "Marios" following the main one, and they would each be a life, so if the first one dies/falls/fails, then the next one takes over.
  • jckmcgrawjckmcgraw Member Posts: 647
    @Philie

    There we go now we're getting somewhere... I know this link I found isn't exactly what you want, but the point I want to make is that what you are trying to do is fairly complicated to me, and there is no way I would be able to explain it to you at this point in time.

    http://www.deepblueapps.com/Deep_Blue_Ideas_Ltd./GSTemplateRBS.html

    The template is for sale, which you could use and take apart. You could just add some gravity to the scene, and have each one of its bodies collide with the ground, and make them into people and add animations. Just a thought...

    Hope this helps a bit,
    Jack McGraw
  • PhiliePhilie PRO Posts: 240
    @bloomer - Thank you for the in-depth answer, exactly what I was looking for. I knew it couldn't be done, just hoping for a miracle ;) - oh well, back to the drawing board! Thanks again!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Yeah writeable tables is what you want. If your doing something basic you can use behaviors,attributes and actors to act as collision triggers to trigger certain things and to follow the player and mimic his movements. This would probably be impractical im sure for anything advanced though.

    I made you a quick demo of how that would work though just in case you were curious.

    http://www.mediafire.com/?kcv4jf6j79ezt41
  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    It can be done,
    You can et actors to mimic the movement & animations (but not mimic actions) have a look at John's temp
  • MazdakfxMazdakfx Member Posts: 15
    Hi there,

    I need the same thing, actors following the first one each as a life.
    First one is jumping, so the others has to jump same position with delay?
    I have to repeat them same as first one or need to ask them to follow the firs?
    Any body has the answer please?

    Regards
    Mazdak
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @Mazdakfx Here's a demo I made that shows how to do this: http://forums.gamesalad.com/discussion/comment/456267/#Comment_456267.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • MazdakfxMazdakfx Member Posts: 15
    edited March 2014
    @tatiang‌ Thanks for you reply,
    Do you know what I mean?!
    For example, I have 3 same actors, I wand them to follow each other(first actor) az a chain or warm, But each one are autonomic as life.
    Maybe the attachment picture will help.
    I made the first actor (Red) , which is running ( jumping actually) by click. Now I need the other actors following it.
    image
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2014

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • MazdakfxMazdakfx Member Posts: 15
    @tatiang‌ Thank you very much , It's really helpful.
    Is there any way to make follower without table?!
  • MazdakfxMazdakfx Member Posts: 15
    @tatiang‌ My leader don't need table, so there is no table!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @‌Mazdakfx
    @tatiang‌ Thank you very much , It's really helpful.
    Is there any way to make follower without table?!
    I guess my question would be... why? Sure, you can do it without a table. But the delay would be hard to create with just x/y attributes, which is why I chose a table.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • MazdakfxMazdakfx Member Posts: 15
    @tatiang‌ Thank you.
    So I need to add a table to my leader first?!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @tatiang‌ Thank you.
    So I need to add a table to my leader first?!
    Well, in the demo I posted a link to, I have the leader record its positions to a table and then the followers move according to the data from the table. I also worked in a delay so that the follower in the back is slower than the follower ahead of it, etc.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • MazdakfxMazdakfx Member Posts: 15
    edited March 2014
    @tatiang‌ Your answers are realy helpful. I do appreciate.
    Now I added a table, and it works. But as I said, my actor is moving forward and jumping by click, the followers are following till first click, after first click , they stop following and going forward faster than leader, but still jumping by click.
    How can I fix that?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2014
    @Mazdakfx‌

    You'd have to set it up the same way I have it in my demo. I recommend opening my demo file and changing the leader and follower actors' rules so that they are the same movement (move forward and jump) as what you're wanting and see what happens. If you "added a table" I'm not sure that you have it set up the same way. You could also post a video of what's happening and I might have a better idea then.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • MazdakfxMazdakfx Member Posts: 15
    @tatiang‌ It was my mistake! the followers ware at the wrong layer, I fixed it and it works perfectly.
    Thank you verry much for your help.
    Now, the followers have to work same as leader.
    When the leader or any of fllowers died, other actors have to move forward.
    I need to make definition for any of followers same as leader.
    How to do that please?
  • MazdakfxMazdakfx Member Posts: 15


    Well, in the demo I posted a link to, I have the leader record its positions to a table and then the followers move according to the data from the table. I also worked in a delay so that the follower in the back is slower than the follower ahead of it, etc.
    @tatiang‌ Where is the delay? I need to remove it!
    Also when I add X position for demo, followers stick together. How to separate them?

    https://www.dropbox.com/s/pyzgx6yacu8d1x8/LeaderFollowerBirds2.gameproj.zip
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    The delay is in the actor's self.rowLagOffset attribute but also in the way I set up the timer. I sent you a PM earlier... if you need me to customize the demo for you, let me know.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • MazdakfxMazdakfx Member Posts: 15
    @tatiang‌ When I changed time to 0.0 nothing happend!
Sign In or Register to comment.