How do I recreate the camera from Super Metroid?

0 favourites
  • 5 posts
From the Asset Store
Create a boss fight with this easy to follow game pack. Recreate the classic attacks of Mutoid Man from Super Smash TV
  • I have a version of this, but it's messy and glitchy, and I'm certain I'm overthinking it.

    Super Metroid has a camera that lets players move inside a box area, without the camera moving. Only when the player moves beyond the border does it start to track along.

    I've tried this with one scroll-to object, but maybe it's better to use two? I'm not sure. The stages in this game are either horizontal-only, vertical-only, or open movement, so maybe it needs three cameras? The player is a basic platform object, if that's important.

    There is a quick breakdown of this type of camera here, but I imagine it's popular in many 2D games.

    suppressivefiregames.tumblr.com/post/85891843723/an-analysis-of-super-metroids-camera-code-and-using

    Thank you for any guidance!

  • What is your issue? Are you having trouble with the camera leading ahead of movement, constraining the camera at room edges, or transitioning between rooms? Break it down, you should be able to create each system separately, and set the conditions under which each should take effect.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You're right, it should be a simple process of breaking it down! I think i've just made a mess of it enough times that I'm convinced I'll never get it settled!

    The biggest thing I'm noticing is a lot of jank and jittery scrolling; I think it's because the camera is struggling to keep up? Or maybe it's unrelated, like browser-based screen tearing? I don't know how to tell the difference, so I'm assuming it's my code!

    The second failure has been keeping locked to the player, but letting them move around within the camera's bounding box without the camera moving.

    I've tried different methods: attaching/unattaching the camera box as a child; using a lerp with high interpolation (to remove the drift); moving the camera at the player's velocity/angle; and I've not been able to make it smooth.

    Just for posterity I've included the sketches I'm working out, but this totally feels like something three lines of code will fix once the correct method is identified.

  • docs.google.com/document/d/1iNSQIyNpVGHeak6isbP6AHdHD50gs8MNXF1GCf08efg/pub

    Well... It's probably not as simple as you think. Good camera behavior can be very complicated, and unfortunately I don't have a "quick" example that I can just give you. But that's why it's very important to clearly define how you want the camera to behave under different conditions and situations.

  • Hey, this is great reference (for any project)! Thanks so much!

    The bit about Metroid explains a new approach—the camera has a velocity, and it catches up to the player—and I'm eager to try it.

    I really appreciate your help!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)