Thread: TRViewer update
View Single Post
Old 12-09-16, 03:47   #13
sapper's Avatar
Join Date: Sep 2007
Posts: 1,609

Incorrect animation values (eg. FrameRate, FrameOffset, FrameEnd, FrameStart) cause a lot of TRViewer's crashes.

I tried to avoid these crashes by skipping problem animations but this means the animation may be missing if the level is saved.

Adding code to handle these problem animations is too big a task for me so instead I will let TRViewer process the animations as normal and so maybe crash.

I added code to this version to write to Paolone's error log.txt the problems with animations instead of skipping animations or showing a pop up message.

Studying the Last Revelation levels revealed that there are some animations that do not have any keyframes stored according to the FrameOffset values.
These deleted/unused animations appear to be always designated by a FrameRate of 5.
Since TRViewer calculates the number of keyframes from FrameStart and FrameEnd it will assume the keyframes exist and thus read incorrect data.
If you view a non custom animation in TRViewer that has a Framerate of 5 then it does not exist.
TRViewer, however, will save these false animations when it saves a level!

In custom levels sometimes the animations have incorrect FrameStart and FrameEnd values. I think Wadmerger causes a lot of these.
Paolone's code tries to fix these errors but may not be successful.
This means TRViewer may calculate a huge incorrect number of keyframes and so will try to read keyframe data beyond the end of the actual keyframe data.
TRViewer usually crashes in this case.

This version of TRViewer was compiled in Visual Studio 2013 Community Edition so MicroSoft's VC++2013 redistributable may be needed.

Version 5 revision E:

-Removed animation skipping code.
-Added code to report problems with animations in the [level_name]_log.txt file
-Compiled in VS2013.

-Copy the exe file to an existing TRViewer folder. Download full package (revision 5) in first post if you don't have TRViewer already.

Here is a program I used to examine the animation values for TR4 files and show what problems there may be for TRViewer.

EDIT: Actually upon further study I might be able to have TRViewer create a 1 keyframe animation using zero angles and translations for those animations that have no keyframes stored in the level instead of displaying false animations. No idea if this will affect gameplay however.
Check trsearch\Tools for some of my programs

Last edited by sapper; 12-09-16 at 10:48.
sapper is offline   Reply With Quote