Hello guys.
I have map 2d platformer, I wrote lots of scripts that make computers complete levels of this game kind of perfectly
For all that scripts I used sort of Movement API(created by me) from the original map and LOTS AND LOTS OF TIMERS
So, for example how part of my script looks like:
Now, imagine that there are lots and TONS of same looking functions with even more timers inside
Imagine that amount of code only for this scripts is ~5k lines of code
Now the question is
I have map 2d platformer, I wrote lots of scripts that make computers complete levels of this game kind of perfectly
For all that scripts I used sort of Movement API(created by me) from the original map and LOTS AND LOTS OF TIMERS
So, for example how part of my script looks like:
Code:
function Level_1_5_Help_7 takes nothing returns nothing
local timer t1 = CreateTimer()
local timer t2 = CreateTimer()
local timer t3 = CreateTimer()
local timer t4 = CreateTimer()
local timer t5 = CreateTimer()
local timer t6 = CreateTimer()
local timer t7 = CreateTimer()
local timer t8 = CreateTimer()
call TimerStart(t1, 0, false, function Right7)
call TimerStart(t2, 0.2, false, function StopRight7)
call TimerStart(t3, 0.6, false, function Right7)
call TimerStart(t4, 0.68, false, function StopRight7)
call TimerStart(t5, 1.08, false, function Right7)
call TimerStart(t6, 1.16, false, function StopRight7)
call TimerStart(t7, 1.56, false, function Right7)
call TimerStart(t8, 1.64, false, function StopRight7)
endfunction
Now, imagine that there are lots and TONS of same looking functions with even more timers inside
Imagine that amount of code only for this scripts is ~5k lines of code
Now the question is
- Do I have to null every local timer at the end of its function? Does unnulled timers cause some memory leaks?
- When I start script in the game sometimes FPS start lowering huge, what to do with that?
- Again, how to solve FPS lowering in general case? At the moment I have pretty weak computer(some ppl say its ancient wooden one in compare to modern ones) Would the more powerfull PC help?