Pineapple Lake
Member
I'm trying to import my 1.4 project into GMS 2 but I have a small optimisation problem concerning backgrounds.
GMS 2 creates a couple of compatibiliy scripts for backgrounds, but they are not very cpu friendly.
__background_get_element is my main concern, it takes up a lot of step % because it uses a lot of string functions.
It basically scrolls through all layers to find the compatibility background layers. In my game this means it's called approx. 10 times per step because I set the x and y of every background in every step using background_x[value] and background_y[value].
A solution I came up with was renaming all background layers with consistent names like "Background_0" and "Background_1" so I can address them directly. However, I have over 100 rooms in my project, with >5 backgrounds each, so this will take a long time.
Does anyone have a better idea?
So basically any cpu friendly alternatives to background_x and background_y without changing all rooms or object code?
GMS 2 creates a couple of compatibiliy scripts for backgrounds, but they are not very cpu friendly.
__background_get_element is my main concern, it takes up a lot of step % because it uses a lot of string functions.
It basically scrolls through all layers to find the compatibility background layers. In my game this means it's called approx. 10 times per step because I set the x and y of every background in every step using background_x[value] and background_y[value].
A solution I came up with was renaming all background layers with consistent names like "Background_0" and "Background_1" so I can address them directly. However, I have over 100 rooms in my project, with >5 backgrounds each, so this will take a long time.
Does anyone have a better idea?
So basically any cpu friendly alternatives to background_x and background_y without changing all rooms or object code?