[Request] Smooth zoom
Moderator: Moderators
[Request] Smooth zoom
Title says it all. A small simple widget that makes the zoom transitions smoothly instead of snapping. Or if someone could point me in the right direction to making one myself, I'm interesting in learning some LUA.
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: [Request] Smooth zoom
Dont know if thats even possible. I think the problem is that you are bound to the stepped resolution of your mouse wheel.
Re: [Request] Smooth zoom
lua can smooth out the steps
Re: [Request] Smooth zoom
Yeah, I was going to use the SmoothScroll widget for some kind of reference, but it's far more complex than I would have guessed, so I'm at somewhat of a loss, since I don't even know where to start.
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: [Request] Smooth zoom
If you want a smoothed movement you can use the second parameter in SetCameraState. It seems as soon as you move the cam afterwards the setting gets overwritten and has to be refreshed every frame.
- Attachments
-
- gui_smoothcam.lua
- SmoothCam 0.5
- (1.08 KiB) Downloaded 152 times
Re: [Request] Smooth zoom
Thanks a ton, works perfect!very_bad_soldier wrote:If you want a smoothed movement you can use the second parameter in SetCameraState. It seems as soon as you move the cam afterwards the setting gets overwritten and has to be refreshed every frame.
Now I just need to understand how it works. D:
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: [Request] Smooth zoom
VBS could you make a version that works with the free style camera?
Re: [Request] Smooth zoom
This should be added to the official Spring release just cause it makes everything nice and smooth.
Smooth is goooood.
Smooth is goooood.
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
Re: [Request] Smooth zoom
it already is, type /togglecammode a couple times until it switches to smooth overhead cameraHobo Joe wrote:This should be added to the official Spring release just cause it makes everything nice and smooth.
Smooth is goooood.
and you can adjust general smoothing factor for all cams using the config values:
Code: Select all
"CamTimeFactor"
"CamTimeExponent"
Re: [Request] Smooth zoom
Hm, interesting, didn't know that.BrainDamage wrote:it already is, type /togglecammode a couple times until it switches to smooth overhead cameraHobo Joe wrote:This should be added to the official Spring release just cause it makes everything nice and smooth.
Smooth is goooood.
and you can adjust general smoothing factor for all cams using the config values:without the need of a widgetCode: Select all
"CamTimeFactor" "CamTimeExponent"
Still, my point stands, because none of that is on by default, so you'd either have to move to a different camera (not what most people want to do and noobs wouldn't know how), or edit configs (once again not what most people will want to do or even know about). This widget smooths out everything, including zooming and panning on MMB or screen edges.
Either would work, I suppose, but I don't the the effect that something smooth will have on first impressions as opposed to something that snaps should be ignored. Maybe it's just me, but it makes everything FEEL so much better.
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
Re: [Request] Smooth zoom
and if you'd have bothered trying the stuff I said, you'd have noticed it does the sameHobo Joe wrote:This widget smooths out everything, including zooming and panning on MMB or screen edges.
and the widget could just use one of the systems I mentioned, which would take 0 cpu time instead of wasting it pointlessy re-setting the smoothing every game frame
I find smoothed movements slow and frustrating personallyHobo Joe wrote:Maybe it's just me, but it makes everything FEEL so much better.
Re: [Request] Smooth zoom
I know, I'm just saying that it's not on by default and difficult to change for someone without the knowhow. I'm not familiar enough with scripting or Spring to know which is better from a performance standpoint, my point was just that the widget does a good job and it's toggleable for people who don't like smoothing - like you. :)BrainDamage wrote:and if you'd have bothered trying the stuff I said, you'd have noticed it does the sameHobo Joe wrote:This widget smooths out everything, including zooming and panning on MMB or screen edges.
and the widget could just use one of the systems I mentioned, which would take 0 cpu time instead of wasting it pointlessy re-setting the smoothing every game frame
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: [Request] Smooth zoom
CCC has smooth zoom.
http://springrts.com/phpbb/viewtopic.php?f=23&t=21450
See the final setting in the screenshot.
http://springrts.com/phpbb/viewtopic.php?f=23&t=21450
See the final setting in the screenshot.
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: [Request] Smooth zoom
It does not do the same. I also didnt know about the secret-smoothed-overhead-cam but with the widget you get every cam smoothed (maybe except free-style-cam) and you are not bound to one hardcoded smoothed cam. I dont like the idea to have every camera twice, one smoothed and one not.BrainDamage wrote:and if you'd have bothered trying the stuff I said, you'd have noticed it does the sameHobo Joe wrote:This widget smooths out everything, including zooming and panning on MMB or screen edges.
Since this widget is clearly a hack, a generic engine support for smoothing all cameras would be cool.
I dont expect setting the camera once in a frame to be noticable cpu heavy. Correct me if I am wrong. Every lua'd camera has to do it that way I suppose.BrainDamage wrote: and the widget could just use one of the systems I mentioned, which would take 0 cpu time instead of wasting it pointlessy re-setting the smoothing every game frame
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
Re: [Request] Smooth zoom
uhh, read my post again? you conveniently omitted the part of the config optionsvery_bad_soldier wrote:It does not do the same.
....
Since this widget is clearly a hack, a generic engine support for smoothing all cameras would be cool.
BrainDamage wrote: and you can adjust general smoothing factor for all cams using the config values:
Code:
"CamTimeFactor"
"CamTimeExponent"
without the need of a widget
no, they set the camera only when movement is executed, not every frame, and while resetting the camera isn't too expensive compared to some other widgets, it is pointless and wasteful when options for smoothing already exist builtin in the engine and the amount of cpu used to set them makes your hack actually a huge waste in comparisonvery_bad_soldier wrote:I dont expect setting the camera once in a frame to be noticable cpu heavy. Correct me if I am wrong. Every lua'd camera has to do it that way I suppose.BrainDamage wrote: and the widget could just use one of the systems I mentioned, which would take 0 cpu time instead of wasting it pointlessy re-setting the smoothing every game frame
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: [Request] Smooth zoom
Ooops, sorry, point taken (I thought the parameters only modify the smoothed cam). I like it! I will try to modify the widget to just set those parameters.
You didnt try to imply that I ommited that part on purpose, did you?
You didnt try to imply that I ommited that part on purpose, did you?
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
Re: [Request] Smooth zoom
nah, sorry, I guess I exaggerated with the reply tone
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: [Request] Smooth zoom
Well, I played around with it but I did not manage to get it working.
I started by setting those parameters from a widget. This did not change anything for me, not for the Smooth-cam and not for the other cams.
Then I skipped the widget part and put those values directly into my springsettings.cfg. But again, nothing happened.
I took a look at the spring's source code to find out whats happening. The only place where cameraTimeFactor is used seems to be in void CameraHandler::CameraTransition(float time). But this function does not seem to be used at places to smooth out zoomings for example. But I may be wrong.
To other variable cameraTimeExponent does not get used in any cam handler at all I think.
So, any hints about where I am wrong are very appreciated. It seems I am somehow on the wrong path.
I started by setting those parameters from a widget. This did not change anything for me, not for the Smooth-cam and not for the other cams.
Then I skipped the widget part and put those values directly into my springsettings.cfg. But again, nothing happened.
I took a look at the spring's source code to find out whats happening. The only place where cameraTimeFactor is used seems to be in void CameraHandler::CameraTransition(float time). But this function does not seem to be used at places to smooth out zoomings for example. But I may be wrong.
To other variable cameraTimeExponent does not get used in any cam handler at all I think.
So, any hints about where I am wrong are very appreciated. It seems I am somehow on the wrong path.