Jump to content
Eternal Lands Official Forums
mighty_archemedes

Camera Follow Mode

Recommended Posts

Hi. My name's Michael, I've been developing for over fifteen years now and have enough experience with OpenGL to know my way around it. I love this MMORPG, but there are a few small things I would like to correct.

 

The first issue is the need to constantly be rotating the camera around the player, along with controlling zoom and inclination. Back in the day (as far back as Zelda 64), there were routines that would cause the camera to follow the player's actor, constantly providing the perfect perspective for combat and other interactions. It took a little getting used to at first, but it was priceless as the game went on. Eternal Lands could most definitely use such a thing.

 

This presumes only that every actor has a stored angle that they are oriented toward, as their "front"; and that the camera can be treated as an invisible sprite, which is usually (perhaps imperatively) the case for OpenGL. It involves two steps. The first is to rig the camera so that it, by default, faces the same direction as the player actor (cheesecake...), and the second is to add a management routine for sudden turns, to keep it from jaggedly swinging over large angles in a single frame, and preserve the fluidity.

 

I have not had time to look over the architecture of the game yet. However, there are two possibilities that I can think of off of the top of my head for option two. The first is to leave a trail behind the actor characteristic of that which guided the AI in Half Life, back around '97, and follow it. That might be unfeasible. The second is to provide a tension algorithm that would move the camera back toward the head-on "neutral" alignment at a rate that is parabolically related to its distance from neutral. The further away it is, the faster it moves, until it's at neutral, where it moves at zero (remains still).

 

Combine that with the middle-button mouse movement, and you have one heck of an intuitive camera.

 

Give me your thoughts.

 

--Michael

Share this post


Link to post
Share on other sites

Options -> Sky&Cam

 

You might wanna have a look at options like "Follow Camera" and "Keep the camera behind the char", etc.

Share this post


Link to post
Share on other sites

Options -> Sky&Cam

 

You might wanna have a look at options like "Follow Camera" and "Keep the camera behind the char", etc.

 

I just found it, it makes life a lot easier. Nonetheless, it moves jaggedly, and adding a springiness would significantly increase playability. Not to mention, some kind of collision detection or transparency for wooded areas.

Share this post


Link to post
Share on other sites

One suggestion might be to sort on-screen objects by interpolating their distance between the player actor and the camera, making those at the distance of the player opaque and those at the camera transparent. This would provide for a nice fade without warping the environment. If the player used middle-mouse or the arrow keys to look behind, everything behind would slowly become visible while objects approaching the camera would be semitransparent.

 

This would get around potential jagged movement in the forests.

 

However, it assumes that the terrain does not qualify as any-old-sprite. (I don't want the GROUND to be transparent!) It also assumes that the trees do not qualify as terrain, and they jut might.

 

--Michael

Share this post


Link to post
Share on other sites

I just had another idea. A lot of the difficulty comes from the numerous turns that the actors take in trying to get from point A to point B. However, there's just one line between the two. If the camera were to be oriented in the general direction of point B (the destination), rather than the direction of the player, most of that jumpy camera spinning would be gone.

 

The only issue would be long trips across a map, where the player might need to cut around a mountain range. It all depends on the path finding algorithm. One potential solution might be a second, line-of-sight path finding algorithm that would create a course for the camera until movement is interrupted. The constraints would be that the player actor could not leave the view, and that the next way point would always be in sight. It might be even nicer if, as an afterthought, a little bit of a radius of curvature was added at the way points, to smooth out its motions.

 

This would almost completely remove the jaggedness.

Share this post


Link to post
Share on other sites

There are a few settings at the bottom of the sky&cam window to adjust the "springiness". I don't know how much else it can be improved upon. The transparent object thing might be nice though.

Share this post


Link to post
Share on other sites

The transparent object thing might be nice though.

 

yes :)

 

it would be real nice if objects between my char and camera are not visible and not blocking my view :)

 

like this :

elscreen066.JPG

 

 

maybe a check, camera ->object-> char

if the object has a specific distance to the char make it full or 1/3 alpha

Edited by wuffzel

Share this post


Link to post
Share on other sites

The transparent object thing might be nice though.

 

yes :)

 

it would be real nice if objects between my char and camera are not visible and not blocking my view :)

 

like this :

elscreen066.JPG

 

 

maybe a check, camera ->object-> char

if the object has a specific distance to the char make it full or 1/3 alpha

 

Well, the real question is, is the object in the way of the character? If so, it's easy to make a smooth interpolation of its distance. We don't have to have a set amount of alpha. I've also thought about having just a ring of alpha around the character, like a ball. This might look good, it might look confusing. There's only one way to know for sure and that's to try it.

 

Another thing that drives me nuts is when I'm chasing a small animal (with a huge weapon) and it keeps ducking behind trees. I can't keep up with it just because I'll end up clicking on an object behind me, and the mouse pick will drop to the ground below what I clicked. Then my character does a 180 and the animal is lost forever, free to fight another day. If we add transparency, then the picks should hit the furthest visible item.

 

Rabbits beware.

Share this post


Link to post
Share on other sites

Alpha around the character-no, because you need to see the objects on all sides(especially small objects)-unless I'm not getting what you're trying to say.

Plus only big objects that obscure the view of your character would need to be alpha's-trees, huge rocks, buildings. And you wouldn't want objects on the other side of your char. obscured.

 

There's an option in the config settings so you don't click on the objects and move towards them. I forget which..mouse bug maybe?

Share this post


Link to post
Share on other sites

There's an option in the config settings so you don't click on the objects and move towards them. I forget which..mouse bug maybe?

Yes Roja that's the one, very useful!

Share this post


Link to post
Share on other sites

Just search for the relevant strings, should be easy to find.

In draw_scene.c there is quite a bit of camera code, look there first.

 

Thanks, that's exactly the file that I'm looking for. I have so little time to search through these things, I'd rather spend it outlining and adjusting.

 

One other little detail, if you do manage to get this working and all, it should be an option to turn on/off.

 

Agreed.

 

An additional thought I had was to set this camera up so that there could be an over-the-shoulder Ghostbusters/Max Payne style camera. It would assist the player in that the objects immediately in front of them would not be blocked from mouse picking. This leaves me with a few modules.

 

#1: interpolated transparency between the player and the camera. This may also include a minimum transparency and a maximum transparency; maybe also a near and far cut-off point option.

#2: shoulder-camera mode. This would also, somewhat automatically, suggest "right-handed" and "left-handed" shoulder mode, changing the side that the player avatar is on.

#3: any last-second idea implementations on camera movement

 

That's three projects, which will be approached in that order. We'll see what makes it in--you can be relatively certain about #1 and fairly certain of #2. I have a few free evenings in front of me, and I'm starting by opening up that file and putting together a satisfactory UML of everything I read in it (like any good systems engineer) until I have a solid understanding--like I said, I have neither the desire nor the right to change a perfectly functional program any more than I need to.

 

If you happen to have any diagrams of that sitting around that you might be willing to throw me, Roja, I would appreciate it very much--it would save a lot of time! Wish me luck, people! (As an aside, if you don't have any such thing and want me to try UML-diagramming the whole thing, I will happily do that for you, Roja--it would increase the stability of, and speed up, any contributions people make in the future.)

 

(Yeah, I've been doodling all of this out on a cocktail napkin for a while. Trust me, cocktail napkins know all.)

 

--Mick

Share this post


Link to post
Share on other sites

Sorry, I don't even know what a UML is(i'm not a programmer), but I'll be here to help test when you get things implemented. Good luck and thanks! :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×