Why my game run so poorly

my games runs poorly and i am unable to find reason as to why, is someone able to help me achieve better frame times?

The game's code contains many elements that are "actively waiting". They use an awful lot of the available time. Try to rewrite them such that they pause, if only for 0.1 seconds, after each cycle.


3.5 video game script pic could be changed to: 3.5 video game script pic (1)

3.5 video game script pic (2) could be changed to:

3.5 video game script pic (3)

... or something like that (of course I don't know exactly what everything is supposed to do).

In general, waiting for some random condition to be satisfied takes a lot of "active waiting", try to avoid it! Instead of testing for a stagenumber in 10 places or so you could test it in 1 place and activate other scripts from there, perhaps using BROADCAST and RECEIVE, or LAUNCHING a script that makes a call.

BTW Welcome to the forum!

And @dardoro has an important point, too!

3.5 video game script pic (1)

Touching color has a detrimental effect on performance and should be avoided at all costs.
I made a project to calculate frame time :link:.
The original version is 120 ms, while the modified 25–50 ms.

thank you dardoro and qw23 for helping me with this, the game now runs better and i thank you for giving me this advice

You’re welcome!

It's a bit sad that what was apparently @gurkland's 1st post, was flagged. I don't know what the post said, but welcome to the forum, anyway!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.