Jump to content
Sign in to follow this  
Taurus

Camera stuttering/lag

Recommended Posts

"bopp.sqf"

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_c = "camera" camCreate [(getPos player select 0),(getPos player select 1),(getPos player select 2)+20];

_c cameraEffect ["external","back"];

_c camSetTarget someGuy;

_c camSetFov 0.7;

_c camCommit 0;

sleep 60;

started by

nil = [] execVM "bopp.sqf";

It laggs/stutters and makes me sick.

Same goes for following an aircraft like

"boppEnhanced.sqf";

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = airCraft;

_c = "camera" camCreate getPos _unit;

_c cameraEffect ["external","back"];

_c camSetTarget _unit;

_c camSetFov 0.7;

_c camCommit 0;

while{(getDammage _unit) < 0.6} do{

_c camSetRelPos [0, -20,11.5];

_c camCommit 0;

sleep 0.00001;

};

Removing the sleep doesn't do the trick either.

This script is too exec:d by execVM.

And as the previous one it makes me sick, even sicker when watching, because of the lagg/stuttering

Please advice.

Share this post


Link to post
Share on other sites

Have you already tried preloading the camera ?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera camPrepareTarget someGuy;

_camera camPreparePos [(getPos player select 0),(getPos player select 1),(getPos player select 2)+20]

_camera camPrepareFOV 0.700

_camera camPreload 15

Share this post


Link to post
Share on other sites

Thanks for the answer.

Nope I didn't.

But I've tried it and it didn't solve my problem confused_o.gif

Still stutters/laggs.

May it be that I'm using .sqf and not .sqs which is said to be "faster" than .sqf?

Share this post


Link to post
Share on other sites

Maybe your PC is a lil slow. Maybe someone else try it out and see if it stutters on their PC.

Share this post


Link to post
Share on other sites

Without looking at your file, have you already tried to call the scripts the "regular" way by using exec only ? execVM runs asynchron to engine timer, maybe that´s why.

Share this post


Link to post
Share on other sites

Eh, that broke my script.

its got waitUntils and sleep in there and that wasn't liked at all when using exec instead of execVM.

I'll try with a good old spawn.

[edit]

Nah, didn't work either.

Still stuttering like when I'm running the game in x4 time compression.

[edit2]

Think I got hold of the problem

Doing

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">waitUntil{

_c camSetRelPos [0, -20,11.5];

_c camCommit 0;

((getDammage _unit) > 0.6)

};

Instead of

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">while{(getDammage _unit) < 0.6} do{

_c camSetRelPos [0, -20,11.5];

_c camCommit 0;

};

Worked more smoothly smile_o.gif

Apparently waitUntil is "faster" than while.

you learn something new each day.

Its unfortunate that if(someThing) exitWith{} doesn't seem to work whilst in a waitUntil tho confused_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×