|
Post by im2confused on Nov 24, 2006 1:08:49 GMT -5
Hi! How's it going?
I was wondering, if anyone could point me in the direction of a good party following example. aka The infamous 'Caterpillar system'.
I've tried at least a dozen times. From step towards, to ds list commands, to motion planning... I still haven't gotten it right! Frankly, I'm out of ideas and a little tired of trying to get it!
So, has anyone seen/have a good example of how to do this? For the record, my movement system is pixel by pixel and not tile by tile.
Mucho gracias!
|
|
|
Post by IsmAvatar on Nov 26, 2006 16:46:28 GMT -5
You can check out my snake examples, they demonstrate this, I believe. They can be found on my website, as linked in my sig.
They are under Examples, titled Snake Fluid Movement, and use Datastructures. They were made in GM5.3, but converting them to GM6 should be relatively simple.
|
|
|
Post by im2confused on Nov 26, 2006 23:45:35 GMT -5
Ah yes! Good example... however, this is as far as I already have gotten. I guess I should have mentioned this before, but the problem I was having was preventing the followers from going on top of the player (and eachother) when you don't move (while using ds_list commands). They either stay just far enough for only one direction, or are completely off and sometimes end up in front of the player/other follower.
So, yes... your example did help out nicely (because my way was much more code heavy then yours, so I can lighten the load thanks to this)... but the main problem persists! What I'm going to do now, is look into other methods of only reading certain lines if the player moves...
|
|
|
Post by IsmAvatar on Nov 27, 2006 2:36:48 GMT -5
Essentially, yes, a good strategy for party-leaders who may become stationary is to check that they are indeed not stationary before appending to their list of nodes. You can either check their basic movement variables to see if they have moved, or you can check their current position to the last node.
A problem may still be noticed with parties with non-constant velocity, as they decelerate, the party will cluster. Of course, if the party is constant velocity with a stationary option, there is no cluster problem, so I won't address this unless you see a need to.
|
|
|
Post by im2confused on Nov 27, 2006 18:12:38 GMT -5
Hmm the last node? I'll go check that out. So far, I have gotten it to work... to an extent. The party will stop moving, and stay in their positions... until you move again... then they jump back to the leaders position. Eek.
Oh, and yes.. they will have a constant velocity while moving, so their is no worries there.
Actually, since your code for the following example was so much more efficient then mine, may I ask what you would do to prevent them from cluttering and going on top each other? I'm sure this kind of thing would benefit the form since no kind of example has been made yet....
Anyways though, thanks for the help!!!
|
|
|
Post by IsmAvatar on Nov 29, 2006 15:11:29 GMT -5
It sounds like you're making the player add their position to the datastructure anyways, and only making the party not read from it. Perhaps you could link me to your file and I can take a look and see what you're doing wrong.
|
|
|
Post by im2confused on Nov 29, 2006 17:42:48 GMT -5
Wow! That's EXACTLY what I was doing. You have a very good understanding of this! I stopped them from reading it if the player didn't move, and of course resume if he did, which is clearly wrong. ...WHICH I JUST FIGURED OUT WHAT TO DO AS I WRITE THIS! What was needed of course, was to do the opposite! DUR! Must be the hair-bleaching that's getting to me... Thanks for helping realize this! I'm soooo mad right now though that I never thought of doing this a long time ago! It's been a month or two since I started to do this!! AHHHH! THAT MADNESS! I really must start paying more attention to common sense. Anyways, for you or anyone else's wish to see the example, here it is. host-a.net/FoSheezy/follow.gmdOf course, it IS just an edited version of your snake one, score still plays and everything but no collisions and you can stop and go. Anyways, thanks again! I'm so excited... ;D
|
|
|
Post by IsmAvatar on Nov 29, 2006 23:24:55 GMT -5
np
|
|