Jump to content
Sign in to follow this  
madrussian

Time acceleration for RPG style missions

Recommended Posts

I've got a survival-style mission in mind where the player must survive X number of days (while gathering food, weapons, ammo, etc) and then at some point make it to safely. Even though the mission spans multiple days, I'd like to condense the gameplay to a couple hours time max and thus need to accelerate time. And allow the player to "sleep", etc.

So, I've been playing around with skipTime and setDate, but unfortunately I'm getting some quite undesirable results.

Both of these commands result in a noticeable lag, each time they are called. I don't recall seeing this lag with these commands in OFP and perhaps ArmA1, but it is indeed significant in ArmA2.

After some investigation (using Chernarus), I've confirmed these lags have an firm association with the graphics that are being rendered, in terms of the ViewDistance and level of Fog. With a clear day and ViewDistance set to 2500, there is noticeable and signifigant lag (couple seconds maybe) using these commands. However, with fog maxed out -or- ViewDistance at 500, the lag disappears. [Also, please be advised my computer is up to snuff (i7-920 w/ GTX-275), so that shouldn't be a contributing factor.]

Ideally, I'd like to just do a simple accelerate on daytime and leave it at that. But I don't want to force the player to play in Fog or with crappy ViewDistance. The only workaround I can think of right now is to have four distinct phases of the day (morning, afternoon, evening, night), and force a transition between them by temporarily pulling in the VeiwDistance or Fog in prep for accelerating time to the next daytime phase, actually doing the time accel, and then pushing ViewDistance or Fog back out afterwards.

Anyone have better luck with these two time acceleration commands (skipTime and setDate) or have any other ideas on how to accomplish this? Thanks again as always. :)

Share this post


Link to post
Share on other sites

hmm im not sure, but i was thinking about incorporating it into my campaign as well (to simulate a sniper waiting a few days for a target to show up)

but if i set that a unit will fly in and unload from a chopper 6 hrs time in the waypoint, does skipping time 6hrs make the unit move there; or does the timer count the real time, not game time for waypoints?

Share this post


Link to post
Share on other sites
_ratio = _this select 0;

_skipInterval = _this select 1;

while{true}do{

sleep _skipInterval;

skipTime ((_skipInterval / 3600) * _ratio);

};

I'll need to find what numbers you slot in. I believe there is a way to make it more frequent but with smaller jumps, so you notice less :) I.e. skip 1/4 of a minute every minute.

Share this post


Link to post
Share on other sites

Well i cant give you any advice on how to speed up game time however i have another idea.

It might not be what you want, but what you could introduce is a system where the player can choose to rest. For example, game time is normal but if he wants to skip time etc you could use a radio comand with

skip 1 hour

skip 12 hour

skip 24 hour

Once one is selected the screen blacks out, then the comand does its thing (so you dont see the change in weather/light etc) and then backs in with "12 hours later"

Share this post


Link to post
Share on other sites
but if i set that a unit will fly in and unload from a chopper 6 hrs time in the waypoint, does skipping time 6hrs make the unit move there; or does the timer count the real time, not game time for waypoints?

Not sure, but that would be pretty easy to test, right?

I'll need to find what numbers you slot in. I believe there is a way to make it more frequent but with smaller jumps, so you notice less :) I.e. skip 1/4 of a minute every minute.

Well even if I only call either of those commands ONE TIME, I get that huge hit of lag.

It might not be what you want, but what you could introduce is a system where the player can choose to rest. For example, game time is normal but if he wants to skip time etc you could use a radio comand with

skip 1 hour

skip 12 hour

skip 24 hour

Once one is selected the screen blacks out, then the comand does its thing (so you dont see the change in weather/light etc) and then backs in with "12 hours later"

That's pretty close to the basic idea I've got for sleeping at night. When it gets late enough, the player gets an action or radio entry to sleep (which is optional). Then as you mention we can fade out, skip the time, and then fade back in without issue. (i.e. You won't see the lag.)

But for this mission idea to work, I've really got to force time to move forward to explain why the player is hungry, and all the apocalyptic ambient events I have in mind. Wouldn't make sense to just have it all take place over the course of a couple real-time hours of time.

Anyhow, I'm starting to lean toward dividing the day into quarters (and have the length of each segment chooseable at the start of the mission, default 5 min per quarter). Have the time advance over a 10-20 second period to next quarter. Maybe play some music while the time advances. Pulling in the fog to eliminate the lag while time advances and then pushing it back out may actually add to the ambiance of the mission and remind the player he's gonna starve if he doesn't keep moving. Depending on how you think about it, it's really kind of a neat mission dynamic. ;)

Thanks for the comments and suggestions guys. :)

So anyone else get big per-call lag on these two commands (skipTime and setDate)?

Share this post


Link to post
Share on other sites

skipTime seems to stutter if you try to skip too much time per skip. Like 15 mins is real laggy. Half a minute is real smooth. The downside is that it takes a lot longer to skip hours :( I use setDate in my missions with a screen fade to black and back in, and also use bis_fnc_showTime which displays that counting clock like you see in Harvest Red during transitions.

Share this post


Link to post
Share on other sites

Interesting. I wonder how many of these bis_fnc's there are? I just discovered them today reading up on implementing ALICE. :)

So I just tried a series of single instances of skipTime commands are various durations (on a clear day, no fog, VD=2500, on the ground with lots of Chernarus horizon visible)

My results:

skipTime 0.1 results in huge lag (the good part of a full second, at least).

skipTime 0.01 results in bit of lag.

skipTime 0.005 results in perhaps(?) unnoticeable lag.

0.005 hours = 18 seconds. Yeah, you're going to need a whole lot of those to get anywhere, and how fast can you even call it? Not sure, I'd have to do more experimenting.

My main issue with skipTime is that you see the clouds ripping across the sky. SetDate avoids this problem, but if it has the same limits on small duration as skipTime, well that's a real shame. (Again more experimenting required.)

Share this post


Link to post
Share on other sites

While I look for that script example...

What if you make the illusion of time with the suggested black-outs/fading/fog, etc, PLUS removing the watch from the player? :)

Share this post


Link to post
Share on other sites

If it's of any help, this is the script I wrote to "skip time" with setDate. The game pauses for maybe a couple seconds, but if you do any of the suggestions above, the player won't notice. You will have to modify the variables slightly, since this one sets the time to 5:45 AM.

_year = date select 0;
_month = date select 1;
_day = date select 2;
_curHour = date select 3;
_curMin = date select 4;
_endHour = 5;
_endMin = 45;
if (_endMin > 59) then
{
_endMin = _endMin - 60;
_endHour = _endHour + 1;
};
_showtime = [
[_year,_month,_day,_curHour,_curMin], //--- Start time
[_year,_month,_day,_endHour,_endMin], //--- End time
200
] call bis_fnc_showTime;

waitUntil {_showtime};
setDate [_year, _month, _day, _endHour, _endMin];

If you do use the bis_fnc_showTime, it requires the function module like all BIS functions :)

If you don't want it, just remove the call for it, and the waitUntil after it.

Share this post


Link to post
Share on other sites

AZCoder, could you possibly guide me/us through the use of this? I too would love a time accelerator that does not show visible lag.

Fyi, with this script, accTime.sqf that I posted earlier;

_ratio = _this select 0;

_skipInterval = _this select 1;

while{true}do{

sleep _skipInterval;

skipTime ((_skipInterval / 3600) * _ratio);

};

I use this to execute it:

[0.5,30] execVM "accTime.sqf";

Edit: Or, rather, how to use your script to, over time (pardon the pun), have more time pass (i.e. accelerated). How do people do 'quick time', as seen in domination, etc?

Edited by HateDread

Share this post


Link to post
Share on other sites
Interesting. I wonder how many of these bis_fnc's there are? I just discovered them today reading up on implementing ALICE. :)

So I just tried a series of single instances of skipTime commands are various durations (on a clear day, no fog, VD=2500, on the ground with lots of Chernarus horizon visible)

My results:

skipTime 0.1 results in huge lag (the good part of a full second, at least).

skipTime 0.01 results in bit of lag.

skipTime 0.005 results in perhaps(?) unnoticeable lag.

0.005 hours = 18 seconds. Yeah, you're going to need a whole lot of those to get anywhere, and how fast can you even call it? Not sure, I'd have to do more experimenting.

My main issue with skipTime is that you see the clouds ripping across the sky. SetDate avoids this problem, but if it has the same limits on small duration as skipTime, well that's a real shame. (Again more experimenting required.)

well maybe you can try a for loop that just skips time at 0.005 - so 18 seconds times how many loops the for loop has to go? it shouldnt lag then since if its smooth on it already being processed once it should just smoothly transition couple hours ahead.

but it might have the script to hiccup with a huge forloop thats like 2000 cycles..

Share this post


Link to post
Share on other sites
What if you make the illusion of time with the suggested black-outs/fading/fog, etc, PLUS removing the watch from the player? :)

Are you saying to remove the watch so it won't break the immersion if the player looks at it and see's the time flying by? I suppose it's worth thinking about, but the player is going to know it's a time accelerated mission after all.

If it's of any help, this is the script I wrote to "skip time" with setDate.

Thanks, that may come in handy. :)

well maybe you can try a for loop that just skips time at 0.005 - so 18 seconds times how many loops the for loop has to go? it shouldnt lag then since if its smooth on it already being processed once it should just smoothly transition couple hours ahead.

Yeah now that I've got skipTime to not lag, I need to do some more experimentation on just how much time can be sped through while maintaining a completely lag-free experience. I am thinking though that most of my lag issues happened when I switched over to setDate. I want to use setDate (so no clouds a ripping across the sky), but it will be interesting to do some quantitative analysis on how the lag issues stack up exactly with regard to setDate vs skipTime.

Share this post


Link to post
Share on other sites

Yeah spot on :)

Actually, if you've found a way to do it, please post it for people like me :D You've also inspired me to start an RPG, too, possibly :)

And I'd be very interested in your results!

Share this post


Link to post
Share on other sites
Actually, if you've found a way to do it, please post it for people like me :D

Isn't the watch an inventory item? If so, just remove it if you like, then no more watch. :)

You've also inspired me to start an RPG, too, possibly :)

And I'd be very interested in your results!

Hey good luck with your mission. I may post a WIP thread on mine eventually in the User Missions subforum, if I get enough together to where I'm pretty sure I'll finish it. Mine is a massively ambitious undertaking, but I'm pretty motivated right now. We'll see. ;)

Share this post


Link to post
Share on other sites

Haha I know how to do that - it was my suggestions after all.

I meant what solutions you've got for the time acceleration. I.e. what you wrote below;

Yeah now that I've got skipTime to not lag, I need to do some more experimentation on just how much time can be sped through while maintaining a completely lag-free experience. I am thinking though that most of my lag issues happened when I switched over to setDate. I want to use setDate (so no clouds a ripping across the sky), but it will be interesting to do some quantitative analysis on how the lag issues stack up exactly with regard to setDate vs skipTime.

Share this post


Link to post
Share on other sites

Sorry I didn't see your question before now. The only thing in my script controlling how long it takes is the bis time function call, which has the value 200 as 3rd parameter. But basically time flies fast as it is written. Or technically, time simply jumps from now to later, with a delay for the clock animation. I basically got it from Harvest Red with minor alteration.

Share this post


Link to post
Share on other sites

@HateDread

Oh, I see what you saying now. :)

And once I settle on something time-accel-wise, I'll report back here, in case it might help you or someone out. btw- How is your mission progressing? What's the brief scoop of what it's all about? I'm interested!

@AZCoder

Your method may very well be the way to go. Will definately check it out. Right now I've moved over to other mission facets, like how to have criminals that hold up the player and/or AI civs at gunpoint, rob them, and then shoot if they don't comply. I've made some pretty big leaps in that area lately. Eventually I'll have to revisit this time accel thing, as it's part and parcel to the mission.

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  

×