Hi!
I have some serious FPS drop in my current script (and in all my script -_-) but I don't really know why except that I'm not a good scripter.
So, what can be the possible main sources of heavy FPS drop and what are things to do or not do to avoid this kind of issues? Most scripteur here do awesome things whitout lag so I have to do something wrong :/
I'm a bit desperate...
To expand and explain Sparen's post:
- First, open your LogWindow (if you don't have it, activate it from the config.exe)
- Breakdown your script into parts. What do we first want? Movement ? Bullets ?
- If you did the task-based approach you'll have your life easier, otherwise good luck...
- Comment out everything first.
Begin iteration: 1 - Launch the game and check how many objects/script tasks are running.
2 - Uncomment bits of parts > Test > monitor the FPS and log window. How many objects are made? What is the script task count etc etc
3 - Hold the ALT key to fast forward the game bit then monitor again.
4a - If your script is stable and no FPS drop happens > uncomment the next bit again.
OR
4b - If your script lags, you know where it happens. Start checking the code
Your comments and uncomments should be suspected things like: Effects, bullet patterns, Object based things.
Once you found which part lags, you can easier trace down what is happening.
Good luck.
Edit: The same applies to included scripts and such. What ever you're running you need to start from 0 then slowly uncomment things and test with each time. Don't uncomment huge blocks of code or you'll get lost.
Edit 2: I think I've seen you before using the @MainLoop based method for scripting. Yea, that is going to be trickier to comment/uncomment in general.