Page 1 of 1
[Request] Smooth zoom
Posted: 08 Aug 2010, 09:25
by Hobo Joe
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.
Re: [Request] Smooth zoom
Posted: 08 Aug 2010, 16:23
by very_bad_soldier
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
Posted: 08 Aug 2010, 16:41
by aegis
lua can smooth out the steps
Re: [Request] Smooth zoom
Posted: 08 Aug 2010, 17:18
by Hobo Joe
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.
Re: [Request] Smooth zoom
Posted: 08 Aug 2010, 18:10
by very_bad_soldier
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.
Re: [Request] Smooth zoom
Posted: 08 Aug 2010, 20:29
by Hobo Joe
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.
Thanks a ton, works perfect!
Now I just need to understand how it works. D:
Re: [Request] Smooth zoom
Posted: 08 Aug 2010, 22:12
by Forboding Angel
VBS could you make a version that works with the free style camera?
Re: [Request] Smooth zoom
Posted: 08 Aug 2010, 22:33
by Hobo Joe
This should be added to the official Spring release just cause it makes everything nice and smooth.
Smooth is goooood.
Re: [Request] Smooth zoom
Posted: 08 Aug 2010, 22:44
by BrainDamage
Hobo Joe wrote:This should be added to the official Spring release just cause it makes everything nice and smooth.
Smooth is goooood.
it already is, type /togglecammode a couple times until it switches to smooth overhead camera
and you can adjust general smoothing factor for all cams using the config values:
without the need of a widget
Re: [Request] Smooth zoom
Posted: 08 Aug 2010, 23:48
by Hobo Joe
BrainDamage wrote:Hobo Joe wrote:This should be added to the official Spring release just cause it makes everything nice and smooth.
Smooth is goooood.
it already is, type /togglecammode a couple times until it switches to smooth overhead camera
and you can adjust general smoothing factor for all cams using the config values:
without the need of a widget
Hm, interesting, didn't know that.
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.
Re: [Request] Smooth zoom
Posted: 08 Aug 2010, 23:53
by BrainDamage
Hobo Joe wrote:This widget smooths out everything, including zooming and panning on MMB or screen edges.
and if you'd have bothered trying the stuff I said, you'd have noticed it does the same
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
Hobo Joe wrote:Maybe it's just me, but it makes everything FEEL so much better.
I find smoothed movements slow and frustrating personally
Re: [Request] Smooth zoom
Posted: 09 Aug 2010, 00:21
by Hobo Joe
BrainDamage wrote:Hobo Joe wrote:This widget smooths out everything, including zooming and panning on MMB or screen edges.
and if you'd have bothered trying the stuff I said, you'd have noticed it does the same
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 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. :)
Re: [Request] Smooth zoom
Posted: 09 Aug 2010, 06:27
by CarRepairer
CCC has smooth zoom.
http://springrts.com/phpbb/viewtopic.php?f=23&t=21450
See the final setting in the screenshot.
Re: [Request] Smooth zoom
Posted: 09 Aug 2010, 19:48
by very_bad_soldier
BrainDamage wrote:Hobo Joe wrote:This widget smooths out everything, including zooming and panning on MMB or screen edges.
and if you'd have bothered trying the stuff I said, you'd have noticed it does the same
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.
Since this widget is clearly a hack, a generic engine support for smoothing all cameras would be cool.
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
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.
Re: [Request] Smooth zoom
Posted: 09 Aug 2010, 20:03
by BrainDamage
very_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.
uhh, read my post again? you conveniently omitted the part of the config options
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
very_bad_soldier wrote:
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
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.
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 comparison
Re: [Request] Smooth zoom
Posted: 09 Aug 2010, 20:10
by very_bad_soldier
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?
Re: [Request] Smooth zoom
Posted: 09 Aug 2010, 20:22
by BrainDamage
nah, sorry, I guess I exaggerated with the reply tone
Re: [Request] Smooth zoom
Posted: 12 Aug 2010, 20:42
by very_bad_soldier
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.