Author Topic: CT/CC Caterpillar System  (Read 1886 times)

ReiSnatcher

  • Iokan (+1)
  • *
  • Posts: 4
    • View Profile
CT/CC Caterpillar System
« on: July 28, 2008, 07:43:25 pm »
Hello, I'm new around here, so no one will know me, but I was the one that made the CT Font that is availiable for download at the CT Novel Project site.

Anyways, my question is if anyone has figured out how to replicate the party caterpillar system in CT or CC. I've been trying off an on for 2 or 3 years trying to duplicate it, but I just can't seem to get it. Everything I've tried has ended in failure.

The reason I ask is, of course, because I do have a fangame I'm working on, but to be honest, without that caterpillar system, it just doesn't have the Chrono Trigger feel to it. As for the CC caterpillar system... I am moving into 3D game programming, and with the leaps and bounds you guys have made at extracting the CC game models... well, I'm sure you can see where my train of thought leads.

My previous theory on how the CT caterpillar system works was that every move that Chrono makes is stored and then repeated by the the next character in line, but offset. However, there were many little things in the characters movement that made this idea fail, so I'm back at square one again.

I searched around on the forum for a while, looking for threads already addressing this topic, but I couldn't find any.
If anyone has any idea on how to faithfully duplicate the CT or CC caterpillar system, please post it! I would be eternaly greatfull for any help in figureing this out!

Luminaire85

  • Guru of Time Emeritus
  • Chronopolitan (+300)
  • *
  • Posts: 311
    • View Profile
    • Chrono Cinema
Re: CT/CC Caterpillar System
« Reply #1 on: July 29, 2008, 12:56:11 am »
My previous theory on how the CT caterpillar system works was that every move that Chrono makes is stored and then repeated by the the next character in line, but offset. However, there were many little things in the characters movement that made this idea fail, so I'm back at square one again.

Huh, I always thought that was all there was to it. Can you give an example of one of the times when that idea doesn't work?

ReiSnatcher

  • Iokan (+1)
  • *
  • Posts: 4
    • View Profile
Re: CT/CC Caterpillar System
« Reply #2 on: July 29, 2008, 03:08:18 am »
Most of it has to do with the locations of the characters in relation to the coordinates where they change direction to follow you, and how it's not the same as your characters previous location in relation to the coordinates where he turns.

 I'll post some screenshots detailing what I mean tomorrow, but right now I'm going to sleep.

tushantin

  • CC:DBT Dream Team
  • Hero of Time (+5000)
  • *
  • Posts: 5645
  • Under Your Moonlight, Stealing Your Stars
    • View Profile
    • My Website
Re: CT/CC Caterpillar System
« Reply #3 on: July 29, 2008, 12:06:03 pm »
My ignorance in programming languages kicks me in that face... and it bloody hurts!!

In any case, this might be of help.

Make two invisible blocks, and program it to follow the character, the co-ordinates to be "slightly" adjusted, and slight delay in commands. Then each block would be modified, switching tot he models of a character you have in party. Like this...

If Ayla in slot one,
Then, block1 = Ayla's model.

ReiSnatcher

  • Iokan (+1)
  • *
  • Posts: 4
    • View Profile
Re: CT/CC Caterpillar System
« Reply #4 on: July 29, 2008, 01:46:16 pm »
That's not exactly what I'm tryign to figure out. I'm trying to figure out how to make them follow eachother correctly, not how to make them switch their order or to display them.

I have a few screenshots and diagrams.


The above image shows what I mean when I say that it can't be just copying the first characters movements, as the second character has to move extra distance in order to reach the point where they turn.


This image shows how I the character system seems to work.
1. Both Characters are at rest.
2. Characters both move left.
3. First character begins moving downwards, but second character continues moving left.
4. Both characters move downwards.

These are the motions it goes through, and the only thign I can think is that everytime you press a button is that it stores the coordinates of where you pressed the button and moves the second character to that point, before using the next one, but that seems far too complicated to me. There must be another way that this works, but I just can't figure it out.

Anyone have any ideas?

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: CT/CC Caterpillar System
« Reply #5 on: July 29, 2008, 03:10:29 pm »
But in order for marle to be farther than crono, crono had to walk a little bit extra before you took the screenshot.
 

I'm pretty sure that when you first load a location all 3 characters are at the same spot.  PC1 gets the first move (a freebie) then PC2 gets teh second move (a freebie with respect to PC3) and then the whole pipeline is filled.

So yes, from that screenshot marle is walking farther but there is also a longer period of time for her to get there. 

You should be able to just make a queue of chracter movements and the output of PC1 is the input of PC2, out put of PC2 is input for PC3.  If the queue is empty (pipeline is being loaded up) don't do anything.


--JP

Ramsus

  • Guest
Re: CT/CC Caterpillar System
« Reply #6 on: July 29, 2008, 03:25:17 pm »
Don't copy the movements; copy the locations.

I'll post an example later.

ReiSnatcher

  • Iokan (+1)
  • *
  • Posts: 4
    • View Profile
Re: CT/CC Caterpillar System
« Reply #7 on: July 29, 2008, 03:30:27 pm »
You are right, they do all start in the same spot, plus when they join your team, they walk right on top of you, so it would work like that again.

Alright, I can understand how that works now, but right now I fail to see how copying the locations vs copying the movements would be any more efficient or effective. I eagerly await to see the example.

Now I just need to figure out how to get the short delay between when the first character moves and the second character starts to follow working.



Ramsus

  • Guest
Re: CT/CC Caterpillar System
« Reply #8 on: July 29, 2008, 11:48:05 pm »
Actually, the method I had in mind isn't like Chrono Trigger's at all (I just went and played the game again for a few minutes to check -- it was a lot simpler than I remembered), so I'll do examples of both.

Ramsus

  • Guest
Re: CT/CC Caterpillar System
« Reply #9 on: July 30, 2008, 09:47:31 pm »
I'll just quit here at implementing my own algorithm. The method I used simply requires that the following object be able to "see" the target object's speed, direction, and location in order to follow it. No fancy event queues or the like.

Most of what you want to look at is in the follower_update function in follow.c.

Some other notes: This code is for demonstration, so there's no error checking or memory cleanup. There isn't even collision detection for the edge of the screen.

I didn't have to worry about memory leaks... only a set number of sprites are created, and the OS frees everything at exit, but if I were to keep going, I'd have to add cleanup functions, and I'd separate out the loading of images into a global array of surfaces to avoid duplicating surfaces.

Also, I just used blobs for sprites and a solid color background, so forgive the lack of eye candy.

Finally, I'm not a game programmer, so study my code at your own risk. As for copyrights, consider it public domain.

[attachment deleted by admin]

Ramsus

  • Guest
Re: CT/CC Caterpillar System
« Reply #10 on: July 30, 2008, 10:03:40 pm »
I updated the source code for the follower_update function by adding more comments. This archive just has the source code and images, since none of the actual code was changed.

[attachment deleted by admin]