Have camera travel along SmoothMesh

Have camera travel along SmoothMesh

Requests for features in the spring code.

Moderator: Moderators

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Have camera travel along SmoothMesh

Post by zwzsg »

In TA overview camera mode and Total War camera mode, when we move the camera around, it keeps its height relative to ground constant, and that is pretty good.

However, when passing over a cliff, wall, or pit, the camera jumps and that is not so good.

So I suggest that instead of following the heightmap, it follows the smooth mesh grid (the one used for airplaines).

Note: How low can the camera be should still be limited by the real terrain, I'm only talking about how the camera follows the ground when moved around.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Have camera travel along SmoothMesh

Post by Beherith »

I like this idea, would work just fine with TA cam
How would one zoom in near the penishills on tabula though?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Have camera travel along SmoothMesh

Post by knorke »

seems like a good idea.
inb4 "lua it" but shouldn't it be possible to use zeroKs "complete controll camera" widget as a base to do that?
How would one zoom in near the penishills on tabula though?
awkwardly? :oops:
When manual adjust camera-height, the real terrain would be the limit. Only when scrolling in x-z the smooth mesh would be used for y.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Have camera travel along SmoothMesh

Post by smoth »

I think that the camera should stay at it's level unless zoomed in below hill level so it can pop over the hills if need be but that falling camera shit, that makes no sense to me.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Have camera travel along SmoothMesh

Post by Jools »

Yeah, it's annoyinmg that it pops up when going over a hill. It makes it take longer to scroll over the map too.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Re: Have camera travel along SmoothMesh

Post by Das Bruce »

Can you mandate camera behaviour with lua or are you stuck with default behaviours?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Have camera travel along SmoothMesh

Post by zwzsg »

I was hoping it was a simple enough request that it could just be fixed at the engine level instead of having to once again hack around it with a giant pile of fragile Lua.

What I mean is that, althought it is possible and not even too difficult to code a new camera system with a Lua system, that would create a whole new slew of neverending issues. In particular, incompatibilities with other widgets wanting to set the camera. Because those "Lua camera" are not really new camera mode, but just widget/gadget that every frame place the FPS camera at a certain angle & position. Let me explain: I have a gadget that makes you control a single unit and have the camera follows it. I have a widget that automatically place the camera at pretty angles over action-filled area when speccing. I have people playing KP with their own custom camera widget. And when two *dgets compete for camera controls, things get very ugly.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Have camera travel along SmoothMesh

Post by CarRepairer »

zwzsg wrote:I was hoping it was a simple enough request that it could just be fixed at the engine level instead of having to once again hack around it with a giant pile of fragile Lua.

What I mean is that, althought it is possible and not even too difficult to code a new camera system with a Lua system, that would create a whole new slew of neverending issues. In particular, incompatibilities with other widgets wanting to set the camera. Because those "Lua camera" are not really new camera mode, but just widget/gadget that every frame place the FPS camera at a certain angle & position. Let me explain: I have a gadget that makes you control a single unit and have the camera follows it. I have a widget that automatically place the camera at pretty angles over action-filled area when speccing. I have people playing KP with their own custom camera widget. And when two *dgets compete for camera controls, things get very ugly.
A) You're wrong, it's very difficult and I've been working on it for years. Writing a new camera widget means _rewriting_ all the motions of the engine camera you take for granted, like scrolling and unit following.

B) That is why all the stuff you mention goes into the same single widget! Hey good ole car already did it for you. Some features of COFC:

All camera motions configurable.
Unit following.
3rd person unit following.
Free mode (allow you to move camera underground and point at any angle).
Smoothscroll - love it or hate it, I put it in there and it's optional.
Follow players' cursor when spectating. Uses data from alliedcursor widget.

Point me to the action-following code and I'll throw that in there too.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Have camera travel along SmoothMesh

Post by zwzsg »

Ok, it's very difficult to Lua a camera, whatever. But, difficult or not, the point is, it will never integrate well with the rest.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Have camera travel along SmoothMesh

Post by CarRepairer »

Err, it does.

Anyway if I could get an equivalent to spring.tracescreenray that gives the smoothmesh point instead of groundpos I could swap that function in and be done.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Have camera travel along SmoothMesh

Post by knorke »

equivalent to spring.tracescreenray that gives the smoothmesh point instead of groundpos
Did you try like that:
..., gx,gy,gz = Spring.TraceScreenRay ( mouseX, mouseY)
smooth_y = Spring.GetSmoothMeshHeight (gx,gz)
smooth_x, smooth_z = gx,gz

Yes,it is not the real coordinates but maybe close enough?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Have camera travel along SmoothMesh

Post by zwzsg »

Gah, now you're all discussing Lua and my engine feature request will be ignored. :cry:
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Have camera travel along SmoothMesh

Post by FLOZi »

Move all camera controls to lua 8)
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Have camera travel along SmoothMesh

Post by Forboding Angel »

Remove engine cameras, insert COFC (It does everything the others do)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Have camera travel along SmoothMesh

Post by smoth »

Forboding Angel wrote:Remove engine cameras, insert COFC (It does everything the others do)
no
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Have camera travel along SmoothMesh

Post by Google_Frog »

COFC is so unstable it was disabled by default in ZK. I introduced a few people to the game and without fail I had to go over and disable COFC for them within the first 10 minutes to play as it had done something stupid like stick in the terrain.

Anyway as for the engine request this should be an option. Too often hardcoded changes are applied to the engine because one person wanted it. Options (springsettings) fix all the problems.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Have camera travel along SmoothMesh

Post by Forboding Angel »

You didn't set the defaults correctly. In evo, I went through and set the defaults so that they act very similar to f2 and f4 cams respectively.

It isn't fair to blame the widget because the zk people didn't bother setting good defaults.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Have camera travel along SmoothMesh

Post by Hoi »

Shitstorm in 3... 2... 1...
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Have camera travel along SmoothMesh

Post by CarRepairer »

I don't care if some people/mods want to use my widget or not. I interjected into this thread as a response to the question of whether you can make a fully functional camera widget in lua. I spent a lot of time adding as many features imaginable as you can read in my post. There are always more to add of course.

@Googlefrog: I'd be happy to debug anything if I were given a method of duplicating the issue.

@forb: thanks for defending. If they don't want to use it, oh well.

@knorke: thanks for the code. I'll give it a shot. If it works I'll make it an option in the widget.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Have camera travel along SmoothMesh

Post by smoth »

I just don't want to see the engine code stripped out and replaced with your camera, I think it is good work but not what I want in a camera if you feel me man.
Post Reply

Return to “Feature Requests”