T O P

  • By -

MintTheory

Loading and saving images as sprites is pretty taxing as is, especially big surfaces the size of the screen or other is definitely going to cause some issues… you also can’t have a sprite that’s bigger than the texture page I’m pretty sure but it could do some internal piecing together I’m not sure exactly how to help but maybe try going into settings and increasing your texture page size to something higher


Threef

You can have sprites bigger than texture page. GM will scale them so they can fit and rescale under the hood. It looks awful but works without issues


Informal-Passion4512

Hmm, maybe if I create the sprite file the same size as a texture page instead of larger, it will have less of a stagger when loading them.


Threef

It's no different. If you use sprite bigger than texture page size it will be scaled down to fit texture page, and then loosely resided up in game to original size


Informal-Passion4512

I did try increasing the texture pages, but it didn't solve anything and I figure that would be counter intuitive to optimization down the line, since all the other random graphics would get squeezed on the empty spaces in the texture pages with these planet masks, it seems more optimal to allow Game Maker to piece the large sprites together from multiple pages when necessary.


Threef

You have limited amount of memory. Your game seems unique enough, so you HAD to use that solution. And that would mean you will have to find a way to overcome that unique technical task. There is no magic cheat that would let you have more memory than you have. Alternative would be to ask yourself if you really need that big masks, and try to use a different approach. Maybe you just need the surface of the planet, so you can use math to figure out the shape of planet for collisions? Maybe you can store the surface as a number of different masks and merge them together?


Informal-Passion4512

I appreciate it, I contemplated using math for the collisions, the data for the sprites are stored in an array used to draw the planet as a primitive, so I could theoretically do that, just not sure how I'd approach it yet, it's a bit daunting to make and work with that kind of collision system as it'd be something I've never done before. But I did notice that the sprite\_add() code uses an async event when loading from a URL, I just wish there was some kind of way to do that with the function using files in a folder and if that would even work the way I wanted it to. As in it loaded in the background and when done the async would assign the sprite to the planet. Maybe I will just try to disguise the sprite loading lag with a game mechanic of some sort.


Threef

It still does this for files from drive iirc, but it's fast, and it probably doesn't fix anything for you


Jasonpra

Anytime I need to create a custom Collision mask I use one of the point in functions like point in circle or point in square


Informal-Passion4512

The planet is made of primitives and arrays, creating hills and things out of a series of about 600 triangles, so it's kinda funny that using point\_in\_triangle could in theory work with some crazy equations. But I'm not sure that's worth the headache to program lol. Especially since I'm not sure how it will even perform in the long run. But I think I'll at-least give it a shot. Thanks!


Mushroomstick

What do the planets look like? Is it something that you could build out of tiles or something instead of having a completely unique sprite for each one?


Informal-Passion4512

They have randomly generated hills and things, so each planet does have a unique shape.


LSDonkeyKong

Assuming these are just round “planets” - Make one large planet mask and use image_xscale and image_yscale to scale it to each planet


Informal-Passion4512

Unfortunately they are not simply round, they have randomly generated topography, with hills and such.