OpenTESArena icon indicating copy to clipboard operation
OpenTESArena copied to clipboard

Last frame of entity animations might be sticking for an extra game frame

Open afritz1 opened this issue 3 years ago • 1 comments

This is easier to see at a lower FPS like 10 or 15. I wanted to avoid a while loop there since that would probably be too slow for thousands of entities.

https://github.com/afritz1/OpenTESArena/blob/f75383f6a302655049193001330738608bdabec5/OpenTESArena/src/Entities/EntityAnimationInstance.cpp#L167

afritz1 avatar Jan 29 '21 17:01 afritz1

I might be misunderstanding the problem and this is just how it would be due to beat frequencies or something? Anyway, changing it to this seems to have no change:

this->currentSeconds += dt;
if (looping)
{
	while (this->currentSeconds >= totalSeconds)
	{
		this->currentSeconds -= totalSeconds;
	}
}

afritz1 avatar Mar 28 '21 01:03 afritz1

I think this was fixed with the software renderer part 1 refactor. It's still kind of noticeable but it isn't always the last frame, so I think it's a beat frequency thing that varies based on the difference between the entity's frame rate and the game's, which is okay.

afritz1 avatar Mar 19 '23 18:03 afritz1