• 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!

What are your GML or Game Maker tricks that make you feel like you're cheating in programing?

Joe

Member
I'm seriously curious. One I can think of that I've yet to see someone use.

The first sprite in every Game Maker project I make is a blank 1x1 pixel. I name this sprite no_sprite, so whenever drawing sprites that are assigned to variables or arrays or such, I can always use an assigned variable with no_sprite to avoid an argument if wanted or needed. I kind of think of it like noone for sprites.

What are some cheaty feeling things you do in game maker?
 

Mercerenies

Member
Nowadays, we have a nice little list to the left of the room menu that lets you control what order objects get initialized in. But it wasn't always that way. Back in the old days, I would often have objects A and B in a room, and B's initialization depended on variables in A. So I would make B's Create event be
Code:
alarm[0] = 1
Then put B's real creation code in the Alarm 0 event, to make sure it runs after A's Create event. So what if an instance spends one frame completely uninitialized? Who's going to notice?
 

Evanski

Raccoon Lord
Forum Staff
Moderator
If my game needs a file or to check something before its able to be played, it will keep the first room loaded (a empty room with a blackground) until its done what it needs to
this is often a few seconds,
but as long as it doesnt take a long time, people wont notice and will think its just its their pc loading the game up
 

woods

Member
fake loading bar
scrolling green bar that has "loading" text drawn across the top of it.. loops a few times while things get loaded in the background.

the dirty part is.. everything was loading fast enough i didnt need that loading bar, but it looked good, so i left it in.. sticking it on a timer and loaded the next room after a couple seconds.
 

Cpaz

Member
fake loading bar
scrolling green bar that has "loading" text drawn across the top of it.. loops a few times while things get loaded in the background.

the dirty part is.. everything was loading fast enough i didnt need that loading bar, but it looked good, so i left it in.. sticking it on a timer and loaded the next room after a couple seconds.
IIRC this is a common trick for a number of games.
Nuclear Throne, for example, has a largely artificial "loading" screen to give the player a breather from the action or something to that effect.
 
Create 1x1 white sprPixel. Use draw_sprite_stretched_ext(spr_pixel, 0, xx, yy, ww, hh, draw_get_color(), draw_get_alpha()); instead of draw_rectangle(x1, y1, x2, y2, false);. Boom, now rectangles are perfectly aligned across all hardware!

Second thing, since everyone is on about loading times:
I had a problem where my game needed do a ton of calculations for the world map to work properly. I did not want any obvious loading screens. I could do it all in one "frame" at game start, but it would freeze the game for about 3 seconds. Not ideal. I instead spread out those calculations so it only does a certain amount per frame. Now there's no lag! A secondary issue arose, however: loading now took around 20 seconds. This could cause a crash if the player skipped past all the intro screens and loaded into the game as quickly as possible. Solution? Wait in the transition screen when it's entirely black until loading is finished. It would only be about 2 seconds max, so it wouldn't look like a loading screen. Problem "solved!"
 
  • Like
Reactions: Joe

Joe

Member
Create 1x1 white sprPixel. Use draw_sprite_stretched_ext(spr_pixel, 0, xx, yy, ww, hh, draw_get_color(), draw_get_alpha()); instead of draw_rectangle(x1, y1, x2, y2, false);. Boom, now rectangles are perfectly aligned across all hardware!
What's really nice about that technique is you're not finding the difference between the x1,y1 and x2,y2 when drawing like in draw_rectangle. Its just the x,y where you want to start the rectangle, and then your width and height in pixels. So less math programmer side or coded variable side. It's also way faster than draw_rectangle. The sprite is also the size of, well, a pixel, so it's not like you won't have room on a texture page. This is an all around, absolutely, awesome technique.
 
Top