GMS 2 No Error, No Memory Leak, But Getting Visual Issues (video included)

Chris Smith

Member
Hey all,
I have a room set up, to randomly generate blocks, then when you exit out the left of the room, the blocks delete, and fill the room again, and you get teleported to the other side of the room so simulate entry into another room.
However, this works up to the point of loading the blocks for the next room, then everything glitches out. There is no error to help me out though. So I don't know what I'm looking for.
I have a video that will probably do a better job showing the issue, (it runs a little longer than I wanted, as I review some of my code at the end to assure it is not a memory leak).

I understand that you'd need to see the code to see whats wrong, but I can't very well post all the code here. So If you have any idea what it might be, and can point me in the right direction, I can show the relevant code or something.
Thanks so much!

 

Rob

Member
Hey all,
I have a room set up, to randomly generate blocks, then when you exit out the left of the room, the blocks delete, and fill the room again, and you get teleported to the other side of the room so simulate entry into another room.
However, this works up to the point of loading the blocks for the next room, then everything glitches out. There is no error to help me out though. So I don't know what I'm looking for.
I have a video that will probably do a better job showing the issue, (it runs a little longer than I wanted, as I review some of my code at the end to assure it is not a memory leak).

I understand that you'd need to see the code to see whats wrong, but I can't very well post all the code here. So If you have any idea what it might be, and can point me in the right direction, I can show the relevant code or something.
Thanks so much!

The only thing I can think of (and where I've had a similar graphical glitch) is not setting the room background colour
 

CloseRange

Member
I know it couldn't be the room background but it is hard to actually know what's going on without being able to see the whole project and examine.
This is a weird problem and for sure wouldn't be a memory leak as that causes lag and not graphical errors.
Test to see if the draw event is working propery, go into the player object and do draw_text(x, y, random(100));
that should draw a bunch of random numbers and test to see if the numbers keep changing when frozen.
if they are drawing randomly you know the draw event works and it has to do with your custom draw functions and how the player deals with drawing itself or how the player deals with position.
 

jonjons

Member
have you tried using clear display buffer after the level finishes drawing/generating
there is an option in the room settings, you can also set it in code
 

Chris Smith

Member
A guy in the facebook group knew what it was super quick!
I was using view_xport[0] to move the camera to where the player got teleported to. I don't know why this did exactly that. I guess I fail to understand that value properly.....

But this code worked:
Code:
camera_set_view_pos(view_camera[0],obj_player.x , obj_player.y)
 
Top