Khao
Member
Mostly out of fun, I started importing a complete, non-commercial game I made a couple of years ago from Game Maker 8 to Game Maker Studio. Surprisingly enough, it went pretty smoothly outside of some audio issues and some trigger events here and there that needed to be replaced, at least when it comes to making the game work.
Except the game works incredibly slowly now for some reason (15-20fps out of the needed 60).
After some research and testing, I realized that the problem was in the code that deactivates object outside the view. For some reason I just can't understand, using it slows the game down to a crawl, while turning it off leaves it working perfectly (over 500fps according to the debugger).
I tried deactivating instances every few steps with an alarm, but then the game will noticeably stutter when the alarm's activated.
The only thing I'm doing right now in the code is activating every instance in the room, deactivating the ones outside the view, and finally activating a few objects that absolutely need to be active when outside the view. This used to work back in GM8, but evidently something changed and I guess my code needs to change too if I want it to work properly.
Is there a better way of doing this? It seems a bit counter-productive to use a code that deactivates objects if it's gonna leave the game running slower rather than faster, which is pretty much the biggest reason you'd do such a thing... But the truth is, I still actually need to deactivate a lot of objects outside the view, because leaving them active leads to a ton of unpredictable problems, and I'd rather not have to reprogram all those objects when the actual game was already completed.
Except the game works incredibly slowly now for some reason (15-20fps out of the needed 60).
After some research and testing, I realized that the problem was in the code that deactivates object outside the view. For some reason I just can't understand, using it slows the game down to a crawl, while turning it off leaves it working perfectly (over 500fps according to the debugger).
I tried deactivating instances every few steps with an alarm, but then the game will noticeably stutter when the alarm's activated.
The only thing I'm doing right now in the code is activating every instance in the room, deactivating the ones outside the view, and finally activating a few objects that absolutely need to be active when outside the view. This used to work back in GM8, but evidently something changed and I guess my code needs to change too if I want it to work properly.
Is there a better way of doing this? It seems a bit counter-productive to use a code that deactivates objects if it's gonna leave the game running slower rather than faster, which is pretty much the biggest reason you'd do such a thing... But the truth is, I still actually need to deactivate a lot of objects outside the view, because leaving them active leads to a ton of unpredictable problems, and I'd rather not have to reprogram all those objects when the actual game was already completed.