Zoned-Restricted Camera Following

Get help using Construct 2

Post » Wed Nov 26, 2014 1:24 pm

Does anybody know how to make a camera like this except have it been transition-less?

I've got most of my game set up except for enemies, structure of the map and the camera.
The camera in the tutorial follows the player within the zone, and makes a smooth, quick transition switching to the adjacent zone when the player enters a new zone.

I need the camera to focus on the player and have the player in the centre at all times, not leave the borders of the zone sprite but able to pass into the cross borders of one zone partially into the other zone so that the player stays inside the camera centre instead of it "jumping" into the other zone.

Any idea how to set that up?
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Wed Nov 26, 2014 2:10 pm

Whoops. This topic made me realized that I hadn't replied back to your last PM. Sorry about that.

The capx is attached. It contains a "ZoneConnect" sprite. Basically, when the player overlaps a ZoneConnect , the camera will look at any Zones overlapping the ZoneConnect , and treat them as one big zone. Getting everything to transition smoothly takes some fine tuning of the size and position of the ZoneConnect sprites. Also, as I mentioned before, corners are always the biggest issue with camera systems like this.

For anyone wondering what I'm talking about, here's a demo I had previously sent Nestris:
ZoneBasedCameraV2
You do not have the required permissions to view the files attached to this post.
Last edited by zatyka on Wed Nov 26, 2014 4:25 pm, edited 1 time in total.
B
64
S
19
G
8
Posts: 341
Reputation: 12,195

Post » Wed Nov 26, 2014 4:01 pm

@zatyka
No problem, thanks for the .capx! I actually thought I was bothering you so I didn't send any further PMs. lol

As fort he corners, I noticed that the "ZoneConnect" sprites were huge, after playing around with them I noticed what you mean by fine tuning them for a smooth transition.
Is it possible to put the ZoneConnections between the zones instead of on top of them and get a better transition?

I noticed that if you make the "ZoneConnect" overlap as much as they can, you get completely seamless transitions.
Would there be a way to keep this, but just always have the character completely in the centre of focus? So the camera doesn't pan, just keeps focus on the player and is still on these "rails"?

I'm going to give a try in my game and I'll put up a preview thingy html if I can so you can give it a play :)
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Wed Nov 26, 2014 4:37 pm

Is it possible to put the ZoneConnections between the zones instead of on top of them and get a better transition?

Not with what I've built. The entire system is based on the sprites overlapping.

I noticed that if you make the "ZoneConnect" overlap as much as they can, you get completely seamless transitions.

This may have unwanted side effects. e.g. visibility to an adjacent room that is not directly connected to the current room.

Would there be a way to keep this, but just always have the character completely in the centre of focus? So the camera doesn't pan, just keeps focus on the player and is still on these "rails"?

I don't think so. I can't think of a way to
  • Keep the camera on "rails"
  • Give the player a free range of motion
  • Perfectly transition the direction of rails (aka corners)
Some kind of compromise needs to be made. However, if someone else on the forum can think up a better solution, I'd be happy to be wrong.
B
64
S
19
G
8
Posts: 341
Reputation: 12,195

Post » Wed Nov 26, 2014 5:25 pm

What if we made an outline using sprites to form "rails"? :lol:
Sorry that's a joke.

What if we make the camera follow the player but unable to leave the "bounding boxes" i.e. zones?
We make a sprite the size of the camera, invisible of course, and pin it's position to the player, then we make the camera follow the sprite instead of the player, and the sprite unable to leave zones but able to cross between them.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Wed Nov 26, 2014 5:38 pm

I don't thing that will work quite as you expect, but encourage you to play around with the capx to try and get the desired result.
B
64
S
19
G
8
Posts: 341
Reputation: 12,195


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests