PDA

View Full Version : New format is much faster when looping



ColonelSandersLite
Dec 19 2006, 05:49
I'm working on converting my time flow accelerator and dynamic weather changer (some of you may be familiar with these) to arma, and I thought I may have to scrap the time flow changer because it was sucking down processor power if it was running precisely enough to not look like crap.

Once I converted it to the new format using proper loops and such though, it flies.

Nearest I can figure, the old format needs to reread the script in memory from top to the line marker everytime, but the new format doesn't since It's using proper loops.

--------------------------------------------
Doesn't seem like it makes as big a difference as I thought at first. It undoubtedly makes a difference, it's just not *that* big, although it may be for certain very large scripts. I don't know.

KeyCat
Dec 19 2006, 11:02
Sounds great!

Still fooling around testing some of the new script commands and hopefully documentation will improve in a not to distant future...

/KC

Kronzky
Dec 19 2006, 13:35
Interesting!

Which commands and structures in particular were you using?
Were you able to do a side-by-side comparison of their performance in OFP vs. ArmA?

ColonelSandersLite
Dec 19 2006, 15:03
No, side by side, both in arma. Considering that, for me, arma actually runs better overall (more men + better graphics), it would be impossible to compare the 2 games side by side in this manner.

But a sqf using a
while {condition} do
{
dostuff
};
structure is better than using a sqs with a
#loop
dostuff
? condition : goto "loop"
style structure.

I'm not really sure by what percentage or whatever. I'm thinking it's going to vary by file lengh and the exact location of the loop anyways.

Kronzky
Dec 19 2006, 20:38
But while (http://community.bistudio.com/wiki/while) isn't really new to ArmA. "While" has been around for a while... http://forums.bistudio.com/oldsmileys/wink_o.gif

Did you use any other new structures that executed faster?

Big Dawg KS
Dec 19 2006, 22:08
But while (http://community.bistudio.com/wiki/while) isn't really new to ArmA. "While" has been around for a while... http://forums.bistudio.com/oldsmileys/wink_o.gif

Did you use any other new structures that executed faster?
While isn't new, what is new is the ability to use while in scripts with new commands such as sleep (http://community.bistudio.com/wiki/sleep) to replace the goto structure.

ColonelSandersLite
Dec 19 2006, 22:26
No, I'm saying the difference is the sqf script syntax running a real loop better than a fake loop.