Quote:
Originally Posted by Treylina
Also the pipe dream script is poorly optimised, which eats my FPS. For a big hint why;
"[16:40:47] Sir Ementaler: I looked into the script of Obi's example level and found an easy way to optimize it.
[16:40:47] Sir Ementaler: Turns out he already only changed the palette once every two frames but every four frames he applied changes 5 times, lol."
|
What I did was change the palette cycling code in onMain to
Code:
if (jjGameTicks % 2 == 1) {
cycleLiquid();
//rocksGlow();
if (jjGameTicks % 4 == 1) {
crystalGlow();
liquidPoolRipple();
crystalRipple();
cloudsGlow();
if (jjGameTicks % 8 == 1) {
liquidPoolGlow();
}
}
jjPalette.apply();
}
and replace all occurrences of " newPal.apply() " with " jjPalette = newPal ". Not precisely the way I'd write that code myself but that required fewest modifications.
__________________
I am an official JJ2+ programmer and this has been an official JJ2+ statement.
|