• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Game maker Studio 2 high score system glitching

H1ghPuR

Member
Hey, I am currently creating a game on the latest version of Gamemaker studio 2. I am using the built in high score system for my game and for some of the numbers, the numbers look a little glitchy. The number on the picture is supposed to be 107 but it looks a bit weird. The font is a downloaded font but other fonts seem to do the same glitchy thing. Is there a fix to the problem or does it just do that?

Image:
 

TsukaYuriko

☄️
Forum Staff
Moderator
Here's a solution to one of your problems. ;)

About your other problem... if every font exhibits this issue, the problem is probably not with the fonts, but with the way you're rendering them. How are you drawing them? How are you processing what you draw after it has been drawn (e.g. viewport scaling)?
 

H1ghPuR

Member
First off, I can't take a screenshot cuz as I said "some of the numbers" are glitchy so I can't tell when to take a screenshot

Anyways, here is the code on how I put the score on the screen.

Score Object:
//Create
1626650140749.png
//Step
1626650198622.png
//Draw GUI
1626650222344.png

Player Object:
//Alarm 0
1626650350276.png
 

TsukaYuriko

☄️
Forum Staff
Moderator
I was referring to the inclusion of a photo rather than a screenshot of the same. If a camera can capture it, so can a screenshot - without image quality distortion.

When I asked for a screenshot, I certainly wasn't referring to screenshots of code. :p Here's how to post code properly:
Anyway, there's no scaling going on in your code.

Please post your room's viewport settings. A screenshot is acceptable in this case.
 

TsukaYuriko

☄️
Forum Staff
Moderator
Does this issue occur if you make the Viewport Properties match the Camera Properties? That's a form of scaling and can therefore introduce distortion.

This is one of the ways of handling scaling that leaves a lot up to the end user's hardware to decide, so you'll get different results on different devices. If this is the cause, you'll have to manually handle scaling.
 

Japster

Member
...just to add to @TsukaYuriko 's tips - have you actually tried a different font / font scaling setting, for comparison / elimination? - maybe a clear built-in font, or even one lower down on this page:-

FREE Dafont Pixel Fonts to test...

I've found that picking the right font, or generating at the right size setting (sometimes larger, and displaying at say, 0.5 scale), can fix graphical inconsistencies (and more often, blurriness too!) with fonts...
 

H1ghPuR

Member
1626740748649.png
Here is a picture with a different font.
The number on the left is the score that keeps going up in which the font looks fine but the high score on the left looks weird.

@TsukaYuriko The issue still occurs when the camera properties match the viewport properties.

Here is the code for the Score object

//Create
GML:
x = Camera_o.x;
y = Camera_o.y;

scoreRem = false;
//Step
GML:
x = Camera_o.x;
y = Camera_o.y;

with (Player_o)
{
    if (php <= 0)
    {
        scoreRem = true;
    }
}

if (scoreRem == true)
{
    instance_destroy();
}
//Draw GUI
GML:
//Score
draw_set_font(fontSmall);
draw_set_halign(fa_left);
draw_text(5, 1, score);
draw_highscore(505, 1, 635, 0);
highscore_add("HighScore", score);
 
Last edited:

TsukaYuriko

☄️
Forum Staff
Moderator
I missed this when you posted screenshots of the code, but just to clarify: Are you intending to draw ALL highscores or ONE highscore? Because draw_highscore will, and as you can see, does, draw ALL highscores. Drawing all highscores in a rectangle with a (negative) 1 pixel height = a mess.
 

FoxyOfJungle

Kazan Games
Apparently there might be one text on top of the other in the same place, or you need to enable alpha blend, maybe you've accidentally disabled it in some code?

Just out of curiosity, did you leave this option checked?

 

H1ghPuR

Member
I do have the Clear Display Buffer option turned on for all of my rooms
@TsukaYuriko how do I make it so that I only draw one highscore because I feel like that might have been the issue.
 

H1ghPuR

Member
Yep I think that solved the issue.
New Code:
GML:
draw_set_font(fontSmall);
draw_set_halign(fa_left);
draw_text(5, 1, score);
highscore_add("HighScore", score);
draw_set_halign(fa_right);
draw_text(585, 0, "Highscore");
draw_text(638, 0, highscore_value(2));
Also, I don't know how I am supposed to do this but is there a way to make it so that the text "Highscore" moves to the left a little bit if the score is bigger cuz I don't want the score to be big enough so that the highscore value collides with the text "Highscore". I could make a variable for the x value of the text "Highscore" that changes if the highscore is big enough, but is there a less complicated way to do it.
 
Last edited:

H1ghPuR

Member
True. Ye idk how I didn't even think of that. I appreciate the help though. Thanks a lot
 
Last edited:
Top