2025-06-14 04:42 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000973Spring engineGeneralpublic2008-10-22 15:47
ReporterPendrokar 
Assigned ToAuswaschbar 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version0.76b1+svn 
Target VersionFixed in Version0.76b1+svn 
Summary0000973: Replays miss unit orders when recording with frame-by-frame!
Description When using Frame-By-Frame video recording(Ctrl+F10) in replays after a while unit orders go missing or even are done much later(know that this lags for me... that is recording at 0.1/0.2 game speed).
 Don't know what it will take to fix this issue. Maybe even remake the replay system to frames if it is not like that already.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • ? file icon 080712-Castles-0.76b1+-2.sdf (31,510 bytes) 2008-07-12 15:38
  • diff file icon demosync.diff (3,170 bytes) 2008-07-12 17:36 -
    Index: rts/Game/GameServer.cpp
    ===================================================================
    --- rts/Game/GameServer.cpp	(Revision 6153)
    +++ rts/Game/GameServer.cpp	(Arbeitskopie)
    @@ -1241,55 +1241,59 @@
     
     void CGameServer::CreateNewFrame(bool fromServerThread, bool fixedFrameTime)
     {
    +	if (!demoReader) // use NEWFRAME_MSGes from demo otherwise
    +	{
     #if (BOOST_VERSION >= 103500)
    -	if (!fromServerThread)
    -		boost::recursive_mutex::scoped_lock scoped_lock(gameServerMutex, boost::defer_lock);
    -	else
    -		boost::recursive_mutex::scoped_lock scoped_lock(gameServerMutex);
    +		if (!fromServerThread)
    +			boost::recursive_mutex::scoped_lock scoped_lock(gameServerMutex, boost::defer_lock);
    +		else
    +			boost::recursive_mutex::scoped_lock scoped_lock(gameServerMutex);
     #else
    -	boost::recursive_mutex::scoped_lock scoped_lock(gameServerMutex,!fromServerThread);
    +		boost::recursive_mutex::scoped_lock scoped_lock(gameServerMutex,!fromServerThread);
     #endif
    -	CheckSync();
    -	int newFrames = 1;
    +		CheckSync();
    +		int newFrames = 1;
    +	
    +		if(!fixedFrameTime){
    +			unsigned currentTick = SDL_GetTicks();
    +			unsigned timeElapsed = currentTick - lastTick;
    +			if (timeElapsed>200) {
    +				timeElapsed=200;
    +			}
     
    -	if(!fixedFrameTime){
    -		unsigned currentTick = SDL_GetTicks();
    -		unsigned timeElapsed = currentTick - lastTick;
    -		if (timeElapsed>200) {
    -			timeElapsed=200;
    -		}
    -
     #ifdef DEBUG
    -		if(gameClientUpdated){
    -			gameClientUpdated=false;
    -		}
    +			if(gameClientUpdated){
    +				gameClientUpdated=false;
    +			}
     #endif
     
    -		timeLeft += GAME_SPEED * internalSpeed * float(timeElapsed) / 1000.0f;
    -		lastTick=currentTick;
    -		newFrames = (timeLeft > 0)? int(ceil(timeLeft)): 0;
    -		timeLeft -= newFrames;
    -	}
    -
    -	bool rec = false;
    +			timeLeft += GAME_SPEED * internalSpeed * float(timeElapsed) / 1000.0f;
    +			lastTick=currentTick;
    +			newFrames = (timeLeft > 0)? int(ceil(timeLeft)): 0;
    +			timeLeft -= newFrames;
    +		}
    +	
    +		bool rec = false;
     #ifndef NO_AVI
    -	rec = game && game->creatingVideo;
    +		rec = game && game->creatingVideo;
     #endif
    -	bool normalFrame = !IsPaused && !rec;
    -	bool videoFrame = !IsPaused && fixedFrameTime;
    -	bool singleStep = fixedFrameTime && !rec;
    -
    -	if(normalFrame || videoFrame || singleStep){
    -		for(int i=0; i < newFrames; ++i){
    -			++serverframenum;
    -			//Send out new frame messages.
    -			if (0 == (serverframenum % serverKeyframeIntervall))
    -				Broadcast(CBaseNetProtocol::Get().SendKeyFrame(serverframenum));
    -			else
    -				Broadcast(CBaseNetProtocol::Get().SendNewFrame());
    +		bool normalFrame = !IsPaused && !rec;
    +		bool videoFrame = !IsPaused && fixedFrameTime;
    +		bool singleStep = fixedFrameTime && !rec;
    +	
    +		if(normalFrame || videoFrame || singleStep){
    +			for(int i=0; i < newFrames; ++i){
    +				assert(!demoReader);
    +				++serverframenum;
    +				//Send out new frame messages.
    +				if (0 == (serverframenum % serverKeyframeIntervall))
    +					Broadcast(CBaseNetProtocol::Get().SendKeyFrame(serverframenum));
    +				else
    +					Broadcast(CBaseNetProtocol::Get().SendNewFrame());
     #ifdef SYNCCHECK
    -			outstandingSyncFrames.push_back(serverframenum);
    +				outstandingSyncFrames.push_back(serverframenum);
     #endif
    +			}
     		}
     	}
     }
    
    diff file icon demosync.diff (3,170 bytes) 2008-07-12 17:36 +

-Relationships
+Relationships

-Notes

~0002403

Auswaschbar (reporter)

The replay system is frame-aware: newframe-messages are part of the replay and so all orders are recieved in the exact same frame as in the original game.

Do the replays work when you don't record?

~0002409

Pendrokar (reporter)

Last edited: 2008-07-12 15:39

"Do the replays work when you don't record?"
Yes they do.

 Just tried It is because of delayed and unsynced frames. With Frame-By-Frame(Xvid 3000 bit 800x600 codec) the recording goes with 15 FPS. With Fraps it is 3 FPS without any delays or unsynced frames BUT the 3 FPS is because I have some problem with either the processor or Hard Disk(mostly when creating or reading large data(50 Mb+) but from that isn't the fault).

 I have both recordings of a replay where I nocost cheat and just build one KBOT and Vehicle lab and some LLT's with COM and start making units and so on but Frame-By-Frame just gets to labs and LLT's built, and doesn't ever get unit nanolathing orders.

Replay showed with Fraps recording(compressed Xvid) - http://spring.jobjol.nl/show_file.php?id=1204
Replay showed with Frame-By-Frame recording - http://spring.jobjol.nl/show_file.php?id=1205

[Edit]Demo file added too it was made in 0.76 rev6124!

~0002410

bibim_ (reporter)

Maybe related: http://spring.clan-sy.com/phpbb/viewtopic.php?f=11&t=14562

~0002411

Auswaschbar (reporter)

Could you please try the patch I attached?

~0002412

Pendrokar (reporter)

ahh I will need to compile it? :(
Get all the programs and so on?
Is there an easier way?

~0002413

Auswaschbar (reporter)

Oh, I was assuming that you build your svn version for yourself.I will try to reproduce it here with wine and ffdshow.
+Notes

-Issue History
Date Modified Username Field Change
2008-07-08 00:16 Pendrokar New Issue
2008-07-11 18:22 Auswaschbar Note Added: 0002403
2008-07-11 18:22 Auswaschbar Status new => assigned
2008-07-11 18:22 Auswaschbar Assigned To => Auswaschbar
2008-07-12 15:25 Pendrokar Note Added: 0002409
2008-07-12 15:38 Pendrokar File Added: 080712-Castles-0.76b1+-2.sdf
2008-07-12 15:39 Pendrokar Note Edited: 0002409
2008-07-12 15:42 bibim_ Note Added: 0002410
2008-07-12 17:36 Auswaschbar File Added: demosync.diff
2008-07-12 17:37 Auswaschbar Note Added: 0002411
2008-07-12 17:53 Pendrokar Note Added: 0002412
2008-07-12 19:00 Auswaschbar Note Added: 0002413
2008-10-22 15:47 Auswaschbar Status assigned => resolved
2008-10-22 15:47 Auswaschbar Fixed in Version => 0.76b1+svn
2008-10-22 15:47 Auswaschbar Resolution open => fixed
+Issue History