SOLVED My room's animation is skipping frames

Just like the title said, my room's animation is skipping frames. On multiple levels. Even the cursor sticks. Frame rate is reported to be normal. This is the first room loaded so it's probably not a memory issue and all the other rooms don't have this problem.

So, update. I tried taking a working room and swapped out the graphics and I am experiencing the same problem.

(edit)

Ran the debugger. DoAStep is taking roughly 33% processing time and Finish_Frame roughly 65%. Anybody know what they are associated with?
 
Ran the debugger. DoAStep is taking roughly 33% processing time and Finish_Frame roughly 65%. Anybody know what they are associated with?
This means the code takes 33% of a step tick to complete, and you still have 65% "free time".
Rooms don't have "frames", nor "animations", they have a size, creation code, cameras and some other stuff...
Do you mean the game lags on certain rooms and not others?
You mention cursor lag, do you use your own, or use the Windows cursor?
 
Well, the objects within my room are slow to animate. That is, they are slow to move objects and fade in and out (changes in image_alpha). The cursor is my own. So, to sum it up as animation I think is correct. But individually,
it is movement of objects, changes in alpha values of objects, and cursor movement. As I said, the fps seems to be normal (reports 1,000 fps), it is the second room loaded, and no other rooms in the game feature this "lagging" on animation at all. As I said, I swapped out all the objects in the room with a duplicate of another working room and it still has the same problems with "animation." So I isolated the problem to the objects that were swapped into the room that are somehow slowing the room. I removed these objects entirely from the room one by one but to no avail. Any help would be appreciated!

(edit)

I do have to disagree on one thing. Room's do have frames. They have a frames per second rating and the sprites within them have frames.
 
I do have to disagree on one thing. Room's do have frames. They have a frames per second rating and the sprites within them have frames.
Well, disagree or not, you're wrong. Frames per second is not frames just like meters per second is not a distance, but a speed. You can't skip a speed.
Anyway! Let's start troubleshooting!
- You say you get 1000 fps, but what does the fps_real say? Does it stays at 60 and the animations still lags?
- Use the debugger, click the pause button, and go under graphics -> surfaces and textures, and click the reload wheel. Try to take a screenshot of what's in there (you can drag the window to expand it).
- What GPU do you have on your machine?
 
I still disagree with you. :p But as far as troubleshooting....

My fps real value is to the right of the decimal point at the start of the level. See attached image.
Mid-Level my fps real value (when paused) is in the 1,000s. See attached image.

Nothing showed up when i went under graphics->surfaces and textures before and after I hit the reload wheel. Image is attached.

GPU information in image attached.
 

Attachments

I still disagree with you. :p But as far as troubleshooting....

My fps real value is to the right of the decimal point at the start of the level. See attached image.
Mid-Level my fps real value (when paused) is in the 1,000s. See attached image.

Nothing showed up when i went under graphics->surfaces and textures before and after I hit the reload wheel. Image is attached.

GPU information in image attached.
If you disagree on facts, you're going to have a hard time in computer science, man.
Two things pops right away to me
1- Quote from the manual about room_speed->
IMPORTANT! This variable is maintained for Legacy Support only, and should not be used as it no longer sets the speed for a single room, but for ALL rooms in the game. To change game speed you should instead be using the function game_set_speed(), and game_get_speed(gamespeed_type).
2- You look like you have dozens of texture pages, which is not a good thing at all. I fear to ask, but do have you got your sprites organized in texture groups, and only load what you actually need in memory?
The game has to be paused (the pause button in the debugger window). Click the refresh wheel, and wait. I'm guessing it takes a while to load in your case. If you have like 50 texture pages loaded, at possibly 64mb each, that's 3+GB of memory just for texture pages. A texture swap is very costly performance-wise. I would start by looking into this first.
 
Fact. Frames per second in general is the number of frames drawn per second. From the manual:
In GameMaker Studio 2 there are two main ways that can be used to tell the speed at which your game runs. The game speed (as specified in the Game Options) and the fps (frames per second). These values are often confused, but basically one is the number of game steps that GameMaker Studio 2 is supposed to be completing in a second, while the other (the fps) is the number of CPU steps that GameMaker Studio 2 is actually completing in a second up to a maximum value of the room speed itself. To get the true fps, ie. the actual number of cpu steps per game step, use the fps_real variable.
Got my Master's in Computer Science man from Drexel University in Philadelphia five years ago, been programming for over twenty. Have been working with GML for two years.

Anyway,

Some of the textures are in groups, not all. Many are in the default texture group. Many in the twelfth level, the room in question, are not. If you really think this will make a difference, and it seems you do, I will put all available in a texture group.

I don't understand the reference to room_speed. Was something captured in the screenshot that I'm not aware of?

(Edit)

Let's just forget about this disagreement and focus on the task at hand. :)
 
Last edited:
So, I put everything in the room into two texture groups. The common system controls like the save menu icon, the achievement menu icon, the icons to create bats to use, etc. are in one group. The level specific graphics are in another texture group. I've seen no improvement.
 
You obviously don't need my help to know how to use a debugger, check memory allocation, and use basic troubleshooting principles, then.
And yes, it will make a difference, as I'm sure you are aware. I don't get how the principle of "load only things you need when you need them" seems so alien.
texture_prefetch(), texture_flush(), texture_is_ready(tex_id) are all your friends...
Just putting sprites in groups will do nothing.

Now...I'll not go as far as calling this whole thing B.S on record...but... this does not look neither like the code from someone who has a Master's, and your website is...well...not showing your HTML skills, to say the least.
I don't get the vibe of someone who wants to learn, but of someone who wants to get things fixed and is either bragging or lying, so I'm sorry, I'm out of here. This is not my jam, and I'm sorry if I misjudged the whole thing, but hey, I feel what I feel, right?
I do suggest you do organize all things in VRAM super neatly, load and flush textures as needed. Make it a habit. It will make a world of difference, especially if you ever go mobile, and/or target lower-end systems.
The manual has everything else you need.
 
Thanks for your help, it is much appreciated. I'll look into texture_prefetch, etc. I wasn't aware that putting sprites in groups does nothing. I expected some automatic flushing of textures.

As far as my Master's , it was a concentration in Artificial Intelligence, not game making. Some aspects of GML and Game Maker are still foreign to me. It's not B.S. and the problem is real and unique to this room. As far as my website goes, I haven't had the time to spend much time on it. My HTML skills are good, and I've coded websites for major companies. Just defending myself, not bragging. I'm not sure how you misjudged the thing, and you've been helpful although you haven't been able to solve the problem with me. As I said, I'll reference the manual as far as texture groups groups go and thank you for your time. I still don't understand why this room and graphics set in particular is so troublesome compared to the other 11 rooms in the game that work perfectly fine. Again thanks and I'll talk to you some other time hopefully.
 
I get that you're not familiar with GML and such, and I don't mean to pile on top of you, but this is not the first time you've flaunted your Master's, and considering there are kids here starting high school who only have the two years of GML experience and don't make the kinds of amateurish logic mistakes that you do, it makes you come across as disingenuous. I understand wanting to defend yourself, but having a Master's doesn't add any legitimacy to your argument, so even if you would be right, I would be humble when challenged, especially for a person your supposed age.
 
Agreed BattleRifle. I only discuss my Master's degree as a part of defense of my competence. It made sense in this context. He said that I would have a hard time studying computer science, so I simply stated that I have already studiedf computer science. Albeit, unlike some disciplines, Computer Science is rapidly evolving and changing and nobody ever finishes studying it, I am just on that journey.

Note: The issue must be something outside the level.. I duplicated a working level and put it in the "Twelfth Level's slot" and it experiences the same problems. I don't think texture groups are the issue.

(edit)

I was right. It is something outside the level, loaded before the level, that's causing the slowdown. Possibly the video shown beforehand isn't being properly destroyed. I skipped directly to the Twelfth Level room (that's using the working map) and there was no slowdown.
 
Ok. I give up. I have no idea how to fix this. There is a video that plays before loading the Twelfth Level. The player can click on a location and load the Twelfth Level. The video map is obviously causing the slowdown. I tried destroying it in the TwelfthLevel's creation event but there is still the slowdown. Without playing the video there is no slowdown.

(edit)

So I removed the video and everything is working fine. I would still like to use the video but it seems that instance_destroy() has no effect on the video. I have the following code in my transition function, which runs right before loading level twelve:

GML:
case 110: target = TwelfthLevel;
        
                instance_destroy(SciFiVideo);
                break;
        case 111: target = TwelfthLevelB;break;
        case 112: target = TwelfthLevelC;break;
        case 113: target = TwelfthLevelD;break;
        case 114: target = TwelfthLevelBOSS;break;
        case 115: target = LastMap;break;
        //case 116: target = OutsideTime;break;
        //default: show_debug_message("Target is not being assigned a value as global.game_map was not set to one of the cases in the switch");
        //default: target = GrasslandToForestMap;break;
    }

    room_goto(target);
 
Last edited:

kburkhart84

Firehammer Games
So use your CS Degree thinking and consider that if the video playing is what is causing it, that maybe something with whatever code you are using to play the video is the cause, or maybe the specific video?!?! Logical, right?!?!
 
Ok. I won't bring up the CS degree again. I forgot that I mentioned it before. Give me a break. There is nothing wrong with the code that is playing it, already checked it, its boilerplate. There may be a problem with the video. I think there is an issue going on with the IDE, as it won't display the instances available in the map. even though they are added.
 
Sorry, I guess I'm just having some rough day, man.
Just to be sure, did you replace all occurences of room_speed with game_get_speed(gamespeed_fps).
I've had some issues in the past with room_speed, and you use your game speed to set some stuff.
I'm pretty sure it's not the room per-se, but something either in the room, or something set before going into it.
At that point in your game, I would just do a backup, and then work on massively refactoring everything, so everything is neat, organized, readable, no shady code, nothing. Like you read a book, almost.
This will give you some time to clear your head of this problem and come back fresh, plus all the little crooked things straightened out is going to make it a hell of a lot easier overall to track current and futur bugs.

Also, if you have some sort of video playback extension you use right before that, I would definitely look into that first. Check this thing in and out like your life depends on it, since you can't post paid assets code here without getting crucified (and I'd probably supply the nails, lol).
 
LOL. It's ok. Yeah the problem is twofold. One, GMS 2.3 doesn't want to allow me to look at my instance properties in the room view. Tried reinstalling, same problem. Second, get your nails ready, I use an extension for video. The entire problem is related to a video I play in the map before the level. When I go directly to the level and don't play the video it runs fine. When I remove the video from the map the level plays fine. Not sure why it is this video in particular that's causing problems when I use multiple videos for rooms in a similar fashion. Can't recreate the video and there is no backups of it. Not sure what to do. Contacting the extension maker in the past hasn't been exactly fruitful.
 
Top