Home   Help Search Login Register  

Author Topic: Frame rate spikes causing desynchonisation  (Read 2530 times)

0 Members and 1 Guest are viewing this topic.

Offline domomo

  • Members
  • *
Frame rate spikes causing desynchonisation
« on: 07 Sep 2007, 19:49:42 »
im sure a lot of you suffer from this, its usually when you first run the mission, a sort of frame spike might cause the sounds to be delayed or the camera script to miss a second or two.  i've tried to remove this problem by creating 3 second  delays before cutscene actually begin, but still, then the scene starts on the first loading, its never perfect,

anyone have advise on how to fix this problem? because even for some of the most powerful computers out there, their still not quick enough to avoid that inital spike, and the spike length can be different every time, thank you

surdus

Offline Cheetah

  • Former Staff
  • ****
Re: Frame rate spikes causing desynchonisation
« Reply #1 on: 07 Sep 2007, 19:55:34 »
Do you preload the camera?
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline domomo

  • Members
  • *
Re: Frame rate spikes causing desynchonisation
« Reply #2 on: 07 Sep 2007, 20:09:57 »
what do you mean by preload? all i do it create the camera as soon as the intro (in this case) begins,

Offline Cheetah

  • Former Staff
  • ****
Re: Frame rate spikes causing desynchonisation
« Reply #3 on: 07 Sep 2007, 21:01:59 »
While waiting before starting the intro (in a black screen for example) use the preloadCamera command for all the camera positions you use. It makes the game load all the textures at those spots.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline domomo

  • Members
  • *
Re: Frame rate spikes causing desynchonisation
« Reply #4 on: 07 Sep 2007, 21:24:30 »
this does look useful, i have applied it to my cutscene at all the major positions (the inital positions of cameras that appear far away from the previous) however this doesnt make a lot of difference. what the problem is, is the subtitles i have made for the voice acting, when i start the cutscene (normally happens when Arma is started up) and the text sometimes appears about a second before the sound, which i find very strange since the sound script (which has both the sound and subtitles) is activated in the camera script a whole 7 seconds after the preload should have finished.  this only ever seems to happen at the start, but its like the whole thing jumps a second ahead, but the sound track remains the same (since its a file).

it just doesnt make any sence, because its given way more than enough time and the sound and subtitles which are in the same .sqs run at exactly the same time.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Frame rate spikes causing desynchonisation
« Reply #5 on: 08 Sep 2007, 09:13:40 »
Stupid question, but:

Does the sound file start from second one? Sometimes when recording there could easily be a short delay between the official start of the sound and when sound is actually coming out.  :) Otherwise, I sadly know very little about sound-editing and the like.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline domomo

  • Members
  • *
Re: Frame rate spikes causing desynchonisation
« Reply #6 on: 08 Sep 2007, 15:03:33 »
the subtitles is designed to synchonized with the sound on the same script.

however i know what the problem is now and how to fix it.  i tried the preload but i still yet have to find out how to use it more effectively, in some cases i think it can actually make things worse, but what seems to cause the problem is when a new camera position is activated at the exact same time as another (one with sound). this can cause problems but so long as the first opening to the intro or cutscene synchronize well every time, its unlikely the same problem will happen half way though because both script have already been activated.

the initial spike causes all activated scripts to skip a second or so (dependent of your computer), however sound files will work normally, so if you have subtitles or a movie which is meant to synchronize with music. its important to give no more than a second delay.

what this means is that the first camera position must start about a second before the music or sound track.  That way the sound track and any other scripts will activate perfectly, here is my solution.

This is the camera script which runs first:

Code: [Select]
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal", "back"]

;=== 15:24:43                                                               ;<<-- First Camera Position
_camera camPrepareTarget [11881.79,313.77,99885.13]
_camera camPreparePos [11881.79,5140.30,1.68]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera
~1
titlecut ["To Create a New World","PLAIN"]
~4
titlecut ["","BLACK IN"]
[]exec "IntroVoice.sqs"
10 fadesound 0
goto "1"
#1
;=== 11:24:33
_camera camPrepareTarget [4303.95,104813.88,2.03]
_camera camPreparePos [11779.62,5312.31,19.14]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera

;=== 11:25:52
_camera camPrepareTarget [-19296.09,100422.24,1.80]
_camera camPreparePos [11840.93,5391.42,19.26]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 20
@camCommitted _camera

_camera camPrepareTarget v1
_camera camPreparePos [11840.93,5391.42,19.26]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 5

This is the second script with the voice acting and music along with the subtitles:

Code: [Select]
~0.5                               ;<<-- Initial delay. Gives the computer half a second
                                     ;----- to buff up the graphics and get over the spike
                                     ;----- before the sound track and subtitles start.
playmusic "FirstIntro"
~4
titlecut ["For the time being the Rebels can't make a move.","PLAIN DOWN"]
~3.1
titlecut ["It doesn't stop them posing a threat, eventually they will make their stand.","PLAIN DOWN"]
~3.4
titlecut ["They still have no idea what their up against.","PLAIN DOWN"]
~3.0
titlecut ["Neither to we, we have lost almost a thousand men these last few months and we still haven't found any of their commanders.","PLAIN DOWN"]
~6.6
titlecut ["We are drawing near my friend, we still have cards we haven't played.","PLAIN DOWN"]

What i have now is a fully working intro, you can wait for the mission to come out or you can watch the intro on youtube now: http://www.youtube.com/watch?v=DBBwSO9d7gI