Jump to content
Eternal Lands Official Forums
emajekral

Camera Modifications (Roja this is for you)

Recommended Posts

cvs has the ability to make diffs. in most cases, that's the best option (it knows what files to compare, etc)

 

cvs diff -Nuar > patchfile.patch

 

note that the options can be set in a cvs settings file in $HOME, in which case you don't need to specify them, and that you can chose which files to diff... in the example, none are given, so it does all in CVS. you could, instead:

 

cvs diff actors.c

Uhm... you can't do a cvs diff -Naur. In cvs, r stands for revision, and R stands for recursion, so thus you actually need cvs diff -NauR.

Edited by crusadingknight

Share this post


Link to post
Share on other sites
Uhm... you can't do a cvs diff -Naur. In cvs, r stands for revision, and R stands for recursion, so thus you actually need cvs diff -NauR.
whoops, that then. serves me right for only skimming the man page (I have settings saved in $HOME on *nix, and use tortoisecvs on win, so little wonder I'm not familiar with it :devlish: )

Share this post


Link to post
Share on other sites

Yay I got to test it out!

 

newcamera.jpg

 

 

First off, it looks great! Good job!

 

The follow camera is a bit jerky yes, however I do understand why and your limitations. So just do the best you can with it, as it is a nice feature to have, just makes you a bit dizy right now :P

 

 

Secondly, With this type of view some type of level of detail option really is needed. Just look at my FPS in the shot there(and with shadows off it's not any better). I think it's best to start a new thread/discussion on it. I think the view is worth it enough to do what it takes to make LOD.

 

 

Lastly, we really do need a sky! With different clouds, stars at night, a moon and sun... pleeease :P

Share this post


Link to post
Share on other sites

Photoshop them? Are you kidding? No way I learned C and programmed in a dynamic sky with volumetric clouds, twinkling stars that appear in constellations depending on the month of the year, a sun & moon, the whole works, just yesterday!....hehe

 

 

Nah, photoshop is my friend :P

Share this post


Link to post
Share on other sites

The thing is, fog and skybox doesn't really match correctly. You see in the pictures of EL and other games that do that that objects in the back look like gray blobs against blue sky. It looks unnatural. You can do a "hack" and make the sky "fade" into the single color of fog as it approaches the ground, but still that works only for object until a certain height, but it should look good enough.

 

One thing I've thought but never really implemented is how an emulation of a round planet would look. You could just use a vertex shader to offset the vertices down the y-axis according to its distance from the viewer. Far-away objects would end up being below the feet of the viewer, thus taking care of the visibility/invisibility. Kinda like sailors see faraway objects smoothly appear due to the fact that Earth is round: even without fog at all, they still have limited vision because of that fact.

Edited by mikeman

Share this post


Link to post
Share on other sites

I have been looking at skyboxes and stuff. Looks like an infinite plane instead of a skybox might work better. let me get the links...

Edited by Drakos7

Share this post


Link to post
Share on other sites

about the terrain. would it be possible to have the client work with two "grids"?

 

as in, one that hold the height of the diffrent tiles, and one thats deformed based on said data. then the tile texture is stretched over the latter grid.

 

this way you have a tile with height 0 and one with height 1 next to it.

on one grid this will be as allways, but on the other the corners of the border between the 0 tile and the 1 tile are moved to a halfway point between those two posisions. that way it will appear as i the ground is sloping upwards towards the 1 tile.

 

one possible problem is with the maps that use tile heights to create stairs and similar...

 

btw, is the camera mouse controled in the first person and over the shoulder view?

as in, hold down one button, move the mouse around, and you move the camera...

Edited by duran

Share this post


Link to post
Share on other sites

btw, is the camera mouse controled in the first person and over the shoulder view?

as in, hold down one button, move the mouse around, and you move the camera...

 

There is no first person view, only over the shoulder.

 

The new camera is flexible. It has a follow mode and a free mode. In follow mode the camera tries to follow the character at a user specified angle. You place the camera relative to your character and it does the rest. In its latest incarnation the camera works without any hiccups but does not do collision detection, and I will never implement code to do that (because I've seen it done badly too many times and I don't think I'm good enough to do any better). There are some parameters to tune camera follow speed and acceleration in a new configuration tab - because the character can only face in 8 discrete directions and following too tightly is nausea inducing. As in the official client (OC) camera repositioning is done with the mouse or the up,down,left,right, page up, and page down keys. In free mode the camera is exactly like the one in the OC except that you have the option of using the camera from parallel to perpendicular to the ground.

 

If you've ever played Neverwinter Nights then you have a rough idea of what to expect.

Share this post


Link to post
Share on other sites

sounds good :)

 

heh, it may even make it simpler to target rabbits and similary small animals in forests.

Edited by duran

Share this post


Link to post
Share on other sites

emajekral, did you finish the auto-follow camera thing?

 

I was also wondering, can you make an optino to have a first person view as well? This would probably have to have any zooming disabled, and would function more as a "look around" type camera with the camera directly in front of your character. Would work best with a hotkey assigned too. Would give cool screenshots, hehe :lipssealed:

Share this post


Link to post
Share on other sites

emajekral, did you finish the auto-follow camera thing?

 

I was also wondering, can you make an optino to have a first person view as well? This would probably have to have any zooming disabled, and would function more as a "look around" type camera with the camera directly in front of your character. Would work best with a hotkey assigned too. Would give cool screenshots, hehe ;)

 

Oh boy. I've got lots to say. Sorry.

 

Auto Camera is kinda finished. There's some mode switching stuff I want to look at. Right now when you switch between follow mode and regular mode the camera jumps to a different angle. I'm going to eliminate that jump.

 

Trying out a first person view is possible. In some games I've played there's such a view, and there are different ways to handle it.

Spyro the Dragon, Knights of the Old Republic:

  • the look around view does only that: you move the camera around to look at things, but you must switch back to regular camera to move.

Action games:

  • actually switch between full featured first person and third person.
  • In EL this would make first person an action mode: mouse look then click on what you want to do, switch out to do anything else (with a different camera and everything)

Star Wars Galaxies:

  • mouse look mode and a HUD mouse mode
  • same view for both except the cursor becomes a crosshair in look mode

Things to consider:

  • Just look, limited interaction, or full interaction with mode switching
  • What to do with cursor: hide, center, make into some crosshair type shape that changes when an actionable item(Ooooh! Corporate speak!) is available?
  • Is there something logical the middle mouse button should do? Could it toggle between HUD and look? Should it be left alone and the game be played as before?
  • Just look is easiest, a little harder if we want the mouse hidden (but not much harder).
  • What hotkey to use? Do we still want a hot key if the mouse toggles the interaction mode?
  • If motion is permitted in first person mode there will need to be some kind of spring back cause the camera will move strangely if you're not pointing the right way. (I tried it, then needed to go lie down for a bit :o)

Some other things I've been considering:

  • Should we provide hotkeys for useful camera positions?
  • Should there be a lock camera feature, or is middle mouse safe enough? (I've ruined a good position through a desire to look sideways for a bit)
  • Should we allow the player to store a few favorite camera positions?

A big problem with follow camera:

  • There's little I can do about the fact that the character often stops in a position that is different than the general direction of travel.
    • I could try some crazy stuff that makes the in game character face a direction that is different than the one it faces on the server and is instead a smoothed out version of the travel direction, but that would be bad - we don't like the client representing information that is different than what's on the server.

Doing the first person camera itself is really very easy. There's already code in the client to do special stuff when rendering your character. I could use the same code to turn off the character, then set a flag that tells the camera code not to move out, just to move to eye level then rotate to match the camera's direction.

 

BUT I made a boo boo and started implementing some very broken sky and LOD code over top of fixes to the camera, so I have to fix that before trying anything else. Before releasing first person I'm pulling out the sky stuff cause it's really bad right now. I've got some stabler stuff in LOD. Does anyone want to be able to change the back clipping plane, remove layers of tiles and change whether to display objects smaller than some size?

 

Hey experienced programmers: what's the [best|a good] way to manage development of multiple features? How are patches merged into the client? If I want to prep a change for merging what do I do? Are these related? Is there a thread for this? (I'm expecting answers like use your own CVS, Subversion is nice, blah blah blah. What I want is: How I work on different projects then merge the results nicely later. How I cope with changing CVS code. Maybe I need to be neducated in diff and patch. If that's it then tell me so.)

Share this post


Link to post
Share on other sites

First Person View:

 

Is it possible to make it like in the 1st person shooter games? minus the hand sticking out. You'd still click with the mouse to move, and have all functionality the same except for zoom in/zoom out I'd assume. But you could rotate the camera up/down/side-to-side.

Share this post


Link to post
Share on other sites

you cannot make first person shooters with the way the map is processed now.

With first person shooters maps are in a format that uses Binary space partitioning Tree data structure to store maps. This is a more efficent format that makes painting graphics easyer but it has the dissadvantage of being more complex and it requires a lot of time to compile the maps into an efficent tree, but this is done ahead of the time once so ingame it is much faster.

 

Doing this will dramatically improve performance (especially indoors) but there are always limitations, it works best with first person shooters where there are walls that block the view, with bsp it allows polygons that are behind other objects to be ignored from paining (instead of paining everything from back to front).

Share this post


Link to post
Share on other sites

Walking with the mouse in First Person View will be a real pain, because of the flat angle, and therefor completely useless imho. In egoshooters and other FPS games you use the keyboard to move freely around, which is impossible in EL because of the way EL handles the movement.

Share this post


Link to post
Share on other sites

not necessarily, with the current client and perspective cranked way up it can get close to 1st person but still add some option for click-to-move.

besides, we could probably use arrow keys as turn/move in that case, just make step forward move like 5 steps, so it'll keep you going a while

Share this post


Link to post
Share on other sites

It wouldn't be a pain..it'd be like the same as this new extended camera option, with the exceptions that you woudln't see your character, and there'd probably be no zoom. You can still angle the camera up/down.

Share this post


Link to post
Share on other sites

dns_server: I am aware that the scene representation is inefficient or used inefficiently. There are reports of very slow frame rates and I am looking at strategies to deal with it. The objective is not, however, to make a first person shooter out of EL, but to provide some first person interaction on a trial basis.

 

In terms of how to use BSP trees, they allow ordered rendering of a scene, generally back to front (good for alpha blending), but can also do front to back (duh). Using that information one can use occlusion culling to improve performance. There's an NV extension on gForce 3 and newer cards that allows that test to be done in hardware. I have an article from Croteam on how to do it properly. Outdoor maps could benefit a lot from this. Especially if there were an additional sort on object size ( a separate bsp tree for big stuff to be rendered first then small stuff is occlude tested against that).

 

BTW, I'm having trouble categorizing the tree structure used in bbox.[ch] (see esp. sort_and_split). What is it? It looks a bit like a k-d tree. I've seen some discussion of the use of octree or k-d trees over bsp trees. Usually bsp trees seem to win, but... Perhaps the structure we already have could be used to better advantage? Until I know what kind of structure BBox uses I can't do much. Take your answers to the LOD thread. That thread was created to be a place to discuss framerate fixes. (Or make a new thread if you want to take on the responsibility.)

 

For now I'm relying on my machine to just cruch the numbers. I get framerates over 8fps for all maps, and generally hover at 30. But I have a P-820D with 1G ram, and a gForce 6800. A little over the target machine for EL, i'm sure.

 

kl4Uz, ttlanhil, Roja: Reserve judgement until you see it. It may be good, it may be bad. I may throw up my hands and quit. I may have an aneurism looking at some of the hacks in the code (mine and others'). Who knows? I've already changed plans 2 or 3 times as I make progress. I'll keep you posted.

Share this post


Link to post
Share on other sites

Hey experienced programmers: what's the [best|a good] way to manage development of multiple features? How are patches merged into the client? If I want to prep a change for merging what do I do? Are these related? Is there a thread for this? (I'm expecting answers like use your own CVS, Subversion is nice, blah blah blah. What I want is: How I work on different projects then merge the results nicely later. How I cope with changing CVS code. Maybe I need to be neducated in diff and patch. If that's it then tell me so.)

 

Very soon we'll have an update, so please don't make any patches or anything just yet.

After the update, the best thing to do is make use of #ifdef NEW_CAMERA //new code #else //old code #endif

This way both the old code and new code can coexist, depending on the compile options.

Share this post


Link to post
Share on other sites

kl4Uz, ttlanhil, Roja: Reserve judgement until you see it. It may be good, it may be bad. I may throw up my hands and quit. I may have an aneurism looking at some of the hacks in the code (mine and others'). Who knows? I've already changed plans 2 or 3 times as I make progress. I'll keep you posted.

 

Please don't get me wrong, as I'm really looking forward to this :o

Share this post


Link to post
Share on other sites

Work complete. :)

 

There is now a first person camera. :D

 

Use ctrl-f (for first person) to toggle first person camera.

 

cbe1.jpg

 

There are two interaction modes: action and HUD

 

Action mode has an X in the middle of the screen for a targeting reticle, and a text banner to describe the interaction type (Walk, Use, Attack, etc.). It is implemented using the grab mouse feature of SDL. This feature should work in Linux and OSX as well as Windows, but it has not yet been tested on those platforms.

 

cbe2.jpg

 

HUD mode is just like regular Eternal Lands, except the camera can be first person.

 

cbe3.jpg

 

Use ctrl-g (for grab mouse) to toggle action/HUD mode.

 

Action mode is available for all cameras, but it works best for first person.

 

It is possible to use hotkeys to turn on chat, map, and other dialogues while in action mode, however I recommend hitting ctrl-g to release the mouse before using the map, cause you can't do it while you're there. I'll fix that if it bugs enough people (probably when I make/get a graphic for the reticle and replace the text interaction banner with the appropriate icons).

 

(I have a video ready to upload to Google Video. Do we want that?)

 

There are also some mode change fixes for the follow camera. It now keeps the camera at the angle positioned it when you switch in and out of follow mode (I hope).

Edited by emajekral

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.

×