2025-07-20 01:21 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003540Spring engineGeneralpublic2013-03-11 23:02
Reportermsafwan 
Assigned ToKloot 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version93.0 
Target VersionFixed in Version 
Summary0003540: Camera smooth function no longer working.
DescriptionTo demonstrate this:
add unit into group number,
press group number,
and you will see that camera transition no longer available!

Now camera instantly teleport and move in stepwise fashion.

IMO this is related to this fix:
http://springrts.com/mantis/view.php?id=3452

Can't someone figure out how the original stutter came from and not fix it with something else?
Tagscamera transition
Checked infolog.txt for Errors
Attached Files
  • patch file icon cam_transition.patch (1,229 bytes) 2013-03-09 09:37 -
    diff --git a/rts/Game/UnsyncedGameCommands.cpp b/rts/Game/UnsyncedGameCommands.cpp
    index 6257e75..7f02b97 100644
    --- a/rts/Game/UnsyncedGameCommands.cpp
    +++ b/rts/Game/UnsyncedGameCommands.cpp
    @@ -743,8 +743,8 @@ public:
     			pos += (*ui)->midPos;
     		}
     		pos /= (float)selUnits.size();
    -		camHandler->GetCurrentController().SetPos(pos);
     		camHandler->CameraTransition(0.6f);
    +		camHandler->GetCurrentController().SetPos(pos);
     		return true;
     	}
     };
    @@ -1227,8 +1227,8 @@ public:
     
     	bool Execute(const UnsyncedAction& action) const {
     		// cycle through the positions
    -		camHandler->GetCurrentController().SetPos(game->infoConsole->GetMsgPos());
     		camHandler->CameraTransition(0.6f);
    +		camHandler->GetCurrentController().SetPos(game->infoConsole->GetMsgPos());
     		return true;
     	}
     };
    diff --git a/rts/Lua/LuaUnsyncedCtrl.cpp b/rts/Lua/LuaUnsyncedCtrl.cpp
    index 1e7c497..a9aeb3f 100644
    --- a/rts/Lua/LuaUnsyncedCtrl.cpp
    +++ b/rts/Lua/LuaUnsyncedCtrl.cpp
    @@ -874,8 +874,8 @@ int LuaUnsyncedCtrl::SetCameraTarget(lua_State* L)
     		transTime = lua_tofloat(L, 4);
     	}
     
    -	camHandler->GetCurrentController().SetPos(pos);
     	camHandler->CameraTransition(transTime);
    +	camHandler->GetCurrentController().SetPos(pos);
     
     	return 0;
     }
    
    patch file icon cam_transition.patch (1,229 bytes) 2013-03-09 09:37 +

-Relationships
+Relationships

-Notes

~0010017

msafwan (reporter)

I think Spring 91 camera is OK, it don't have the stutter.

But IMO i prefer stutter than no camera transition

~0010018

cleanrock (reporter)

msafwan, selecting group twice in 91 do not trigger a camera transition as far as i can see.

I am a bit unsure of this but here goes:

If we keep UpdateCam(); in start of CCameraHandler::CameraTransition we need call CameraTransition before setting camera pos.
I attached a patch which fixes transitions for F3 and transition to com at start.

There are a few other places we call CameraTransition after setting pos which may need fixing:
CCameraHandler::ToggleOverviewCamera()
second call to CameraTransition in COverheadController::MouseWheelMove(float move)
LuaUnsyncedCtrl::SetCameraState(lua_State* L)
SmoothController::MouseWheelMove(float move)

~0010019

msafwan (reporter)

Last edited: 2013-03-09 15:45

View 2 revisions

owwhh... kk sorry. What I meant was "Spring.SetCameraTarget(x,y,z,smooth)" no longer has smooth feature. I forgot I was using it for group recall.
-_-

I really scared if I cause some unnecessary code change. I really don't understand what's going on :(

Cleanrock, do you know when do camera focus on commander at start? I would like to override it with Spring.SetCameraTarget() with smooth in Spring 91.

~0010021

cleanrock (reporter)

msafwan, start com transition in 91 is smooth, what do u want to change ?

~0010025

msafwan (reporter)

Last edited: 2013-03-10 14:33

View 4 revisions

cleanrock, I am using Freestyle camera and Spring.SetCameraTarget() will only show you correct target if you view from South like TA camera. So in ZK I put this override:

https://code.google.com/p/zero-k/source/browse/trunk/mods/zk/LuaUI/cache.lua#99

so whenever I rotate the camera in any direction, the Spring.SetCameraTarget() can still point toward the right position.

I would like to override for com start, BUT if someone can integrate it into Spring then will be cool! :>
but the formula fail when you view toward sky, so its not perfect.

+Notes

-Issue History
Date Modified Username Field Change
2013-03-09 03:31 msafwan New Issue
2013-03-09 03:32 msafwan Tag Attached: original camera transition
2013-03-09 03:33 msafwan Tag Detached: original camera transition
2013-03-09 03:33 msafwan Tag Attached: camera transition
2013-03-09 03:59 msafwan Note Added: 0010017
2013-03-09 09:34 cleanrock Note Added: 0010018
2013-03-09 09:37 cleanrock File Added: cam_transition.patch
2013-03-09 15:43 msafwan Note Added: 0010019
2013-03-09 15:45 msafwan Note Edited: 0010019 View Revisions
2013-03-09 16:44 zerver Assigned To => zerver
2013-03-09 16:44 zerver Status new => assigned
2013-03-10 08:04 cleanrock Note Added: 0010021
2013-03-10 14:28 msafwan Note Added: 0010025
2013-03-10 14:30 msafwan Note Edited: 0010025 View Revisions
2013-03-10 14:31 msafwan Note Edited: 0010025 View Revisions
2013-03-10 14:33 msafwan Note Edited: 0010025 View Revisions
2013-03-10 23:03 zerver Changeset attached => spring develop a70ef844
2013-03-10 23:03 zerver Status assigned => resolved
2013-03-10 23:03 zerver Resolution open => fixed
2013-03-11 23:02 Kloot Changeset attached => spring release 728c1a13
2013-03-11 23:02 Kloot Assigned To zerver => Kloot
+Issue History