-
Notifications
You must be signed in to change notification settings - Fork 40
Classic Camera: Camera Field Objects
This is a copy and paste of a post I made awhile back and how the "Classic Camera" transition issues were solved. I'll probably update it into an actual page someday.
So it turns out the camera object did end up being the silver bullet after all. No matter what kinds of solutions I thought of, this was the only one that made any sort of progress. I think my main issue was trying to come up with an easy solution to a not so easy problem to solve. Because Link moves between transitions, there are moments he is "out of bounds" before the transition finishes. To understand why these classic camera issues happen, it's best to start with why it happens to begin with. Let's look at the shop.
This is one of many maps that exhibits the issue, because Link enters the shop out of bounds. In the image above, he starts in the circle and moves up. During this time, the camera is trying to get Link's "current field" which is out of bounds. This is why there is a brief period of seeing him at the top of the screen (assuming the hack is not active covering it up). There is also a "fix" in place to make the camera "snap" during transitions when classic camera is active. Otherwise, the camera would pan between transitions and it would look funky. For another example, it's why you see Link swimming to the left for a moment before the camera snaps into the map's main field. What you are seeing is that brief moment that Link is out of bounds, which then quickly snaps into place.
In the image above, the first few frames is that dark area with Link swimming to the left, only centered on the screen. Then the camera snaps into where it should be. This is why the hack I was using was so bad, it was trying to cover up visible parts of the game field. And sometimes Link's transition point was too close to the circle shader for the black cover up rectangle to be completely hidden. This is what lead me to believe an object already present on the field of where we need to go would be a good solution. It gives an anchor point to move the camera to when a transition starts, rather than using Link as the anchor. At least, right away anyway.
What originally made me think the camera object wasn't going to work, is that it's tough to know when to snap to Link and when to snap to the camera object. And it turns out, this depends on the map. For the bridge map, it must remain on the camera during both the transition in and out, or the field will move to the black area in either direction. So keeping the camera object active the entire time is fine for single screen maps like this. But Dungeon 1 also exhibits this behavior. As do all dungeons. And most caves. And these are not single rooms. A single camera object was never going to work.
Looking at Kanalet Castle upstairs, it has 3 entrances. So, I thought the best way to go about this is multiple camera objects. When a map is loaded, the distance between where Link enters is measured between it and each camera object. The camera object that is closest to the current door being used is the winner, and that is the camera object that the camera will use as an anchor point. This allows for the camera to always know "where to go" when changing maps.
The downside is, for every map that has multiple doors and passageways, there needs to be a camera object near every single one. This means nearly every map in the game needs to be updated. So there is a bit of work ahead. If there is not a camera object near the exit, then it will just find the next closest camera object, and the camera will not focus on the field it needs to. At least not until the transition finishes. When the transition is completely finished, the camera object list is cleared, the lock is lifted, and the camera moves back to Link. That is unless the camera object has a "Lock" property set, but that is only used for single screen maps like the bridge map. In that case, the lock is not lifted until returning to the overworld.
So to recap this long winded explanation:
- Camera objects are used near doors during classic camera to get the field they are on.
- They serve as a temporary anchor point for the camera to lock to during transitions.
- The closest camera object to the exit is the one that is used to anchor the camera to.
- A camera object must be near every single door on the map if they are used at all on a map.
- Camera only remains at the anchor point until the transition is finished then it goes back to Link.
- The camera object has a "Lock" property for single screen maps so it locks until the map is exited.
And one last example to send it home. The Dungeon 1 map below shows where all the camera objects are, which are near every single door in the dungeon. Whenever exiting these doors, the camera will reference the camera object in that field to get that field until the transition finishes, then it will use Link to get the current field.
- π‘ Home
- π€ Building & Contributing
- π Additional Info
- π Main Update Loop
- π§ Direction
- π₯οΈ Dialog Path Loader
- πΊοΈ Dungeon Minimap Files
- πΌοΈ Sprite Atlas Files
- π₯ Camera Field Objects
- π·οΈ Placeholder Tags
- πΌ Music Indexes
- π£ Launcher Mod Maker
- π§© Texture Replacement
- πΌοΈ Custom Menu Border
- π΅ Music Replacement
- πΆ Sound Effect Replacement
- πΊοΈ MapOverlay Custom Info
- π Dialog Replacement
- π LAHDMods