• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - GML Visual Too large sprite?

R

Redbow

Guest
Hi. Can you help me please?

I have sprite 10000x10000 pixels. I used it as bacground. Everything is fine but if I try to run game it has error:

GameMaker:Studio AssetCompiler has encountered a problem.
Parameter is not valid.

If I lowered sprite to 5000x5000 it works great without error. But lowering sprite is not an option for me.
So, dont you know please what is wrong? Is here any sprite size limit??
Thank you
 
T

Treecase86

Guest
Hi. Can you help me please?

I have sprite 10000x10000 pixels. I used it as bacground. Everything is fine but if I try to run game it has error:

GameMaker:Studio AssetCompiler has encountered a problem.
Parameter is not valid.

If I lowered sprite to 5000x5000 it works great without error. But lowering sprite is not an option for me.
So, dont you know please what is wrong? Is here any sprite size limit??
Thank you
Yes, there's a limit on how large a sprite can be. If too large, it'll downscale it to, say, 5000x5000.
 
R

Redbow

Guest
in my case it allowed me to use 7500x7500 sprite. (8000x8000 was error)
I would like to know if this is definitely largest what I can use, or is there some magic how to use larger sprite :p :p
 
T

Treecase86

Guest
in my case it allowed me to use 7500x7500 sprite. (8000x8000 was error)
I would like to know if this is definitely largest what I can use, or is there some magic how to use larger sprite :p :p
Hmm... There must be some cap on size. Possibly numbers that are easy to divide, such as 7500 are fine, as it resized my image of 1420x3294. Odd indeed.
 

GMWolf

aka fel666
What do you need a 10,000 by 10,000 sprite for? I suspect you are doing something horribly wrong!
The image alone would use 3 GB of vram!
 
A

Ampersand

Guest
Am I missing something, or is this just a not good idea? Giving one whole texture swap to one sprite at a lower quality than you actually desire seems like a massive waste of resources unless this single sprite is mechanically necessary to the gameplay :(
 

rIKmAN

Member
Am I missing something, or is this just a not good idea? Giving one whole texture swap to one sprite at a lower quality than you actually desire seems like a massive waste of resources unless this single sprite is mechanically necessary to the gameplay :(
I think the general consensus in the posts before yours are basically saying that it's a very bad, unworkable idea.
 
A

Ampersand

Guest
I think the general consensus in the posts before yours are basically saying that it's a very bad, unworkable idea.
That's what I saw, but it seems he may be curious as to the physical limits rather are than the recommended limits.
 

GMWolf

aka fel666
Am I missing something, or is this just a not good idea? Giving one whole texture swap to one sprite at a lower quality than you actually desire seems like a massive waste of resources unless this single sprite is mechanically necessary to the gameplay :(
here is the thing: Massive textures do not fit in graphics memory. That is all.
oh, and there is probably some limits to the size of texture units, would have to look into that one.
 
A

Ampersand

Guest
@GMWolf exactly, there's good reason that even wildly detailed modern 3D games still max textures at 1024 most of the time, and usually most HD textures are more in the 256-512 range.

I'm still just trying to imagine not only an instance where I need a graphics resource that is that large but also where a sprite is the most desirable choice...
 
R

Redbow

Guest
Okey. Maybe you will have better idea. I created 500 000x500 000 room. Just very big world. And this sprite 10000x10000 (my own created) tiled verticaly and horizontaly on background (no object). I know, maybe its too much, but everything works fine. 60fps with interpolate colours betwen pixels. I am adding still new objects there and it works fine. What do you think? Any better idea how to create background? I cant use smaller sprite because it will repeat to much than. you know
 
Last edited by a moderator:

Slyddar

Member
What is your sprite? If it's something like an image of grass for a background, with different spots of grass clumps for variety, or similar, you could achieve the same thing other ways. Maybe show us the sprite and we can recommend some alternative options.
 
R

Redbow

Guest
no, its a space. Just black with white dots (stars). I just flying from planet to planet. I like space. :p
But if I will use 200-300 objects (planets) it can be problem in future?
If you have better idea how to make it better, I would appreciate it, and I will be thankfull :)
 
L

Lonewolff

Guest
10000 x 10000 won't even work.

You think it does, but GMS is resizing it to whatever the texture page size is. Which is a maximum of 8192 x 8292 in GM.

If you aren't aware of this setting, your Sprite is actually being resized to the default of 2048 x 2048.

You can even see it is being resized when you compile, it will tell you this in the output window.
 

Slyddar

Member
If you have better idea how to make it better, I would appreciate it, and I will be thankfull
One way is to use individual sprites for the planets, you only need a handful, and a few stars too of different sizes. Then at the start of the game, use a random function to place them in the room and store the coords in a ds_grid. You can then use an object to control the drawing of them, but only drawing the ones that are around the players view. Doing it like this saves drawing hundreds of objects that are not even being seen. You might even be able to use a surface in a bigger area around the player, to save on draws.

I'm sure there are lots of ways though, others might have some ideas for you.
 
R

Redbow

Guest
Then why not just set the room background to black and draw small star sprites on top of it!?
Ou man, I thought about this too ... but its too large, I would do this half of the year to sprite stars everywhere

One way is to use individual sprites for the planets, you only need a handful, and a few stars too of different sizes. Then at the start of the game, use a random function to place them in the room and store the coords in a ds_grid. You can then use an object to control the drawing of them, but only drawing the ones that are around the players view. Doing it like this saves drawing hundreds of objects that are not even being seen. You might even be able to use a surface in a bigger area around the player, to save on draws.

I'm sure there are lots of ways though, others might have some ideas for you.
Yeah, this could work. Good idea. But, could you be so nice and try to tell me, how to set ,drawing objects, in ,,players view,,? I tried it, but I do something wrong because nothing works.
 

rIKmAN

Member
Ou man, I thought about this too ... but its too large, I would do this half of the year to sprite stars everywhere
This sounds like you are thinking about manually placing star sprites in the room editor.
You could write a loop in about 5 lines of code that would place any number of star sprites you wanted all over the room, and also checking that it isn't on top of another star before placing it.
 
Top