To tile or not to tile

W

WoodenBastard

Guest
Hey folks, I'm about as "green" as you can get when it comes to GameMaker. I was wondering if I had to tile the background of the game I'm trying to make. It's a side-scrolling Double Dragon/Final Fight style game. I'd rather just have every screen look unique without tiling and I've seen this in Final Fight 2 and 3. In those games, some of the individual scene elements may be repeated, but not the backgrounds as a whole. My original game resolution will be low (320x180). Can I just draw one large level background - for example, 1920x180 without performance issues? Thanks for any insight!
 

Rob

Member
Backgrounds won't affect the performance. If you're green then you might need to learn how to use views.
 

Yal

šŸ§ *penguin noises*
GMC Elder
Also, backgrounds larger than your texture page settings will not be properly loaded and will look ugly. So be careful with graphics 1024 pixels or greater. I think the default texture page size is 1024x1024, but it might be 2048x2048.... but having it too high can make your game less compatible since more VRAM is required. Be aware of this and keep it in the back of your head. Tons of small graphics are OK since you can have as many texture pages as you want, but loading and unloading them takes time. Usually only a problem on mobile devices, though, PC GPUs are pretty good at that kind of stuff.

With tiles, you don't really need to worry about that kind of stuff, not to mention they use less memory.
 

YanBG

Member
In your case with handmade and completely unique/preset levels, backgrounds are ok. The advantage of tiles is that you can reuse a lot of the content and when tiled the rooms can vary in size but still look seamless.
 
W

WoodenBastard

Guest
Also, backgrounds larger than your texture page settings will not be properly loaded and will look ugly. So be careful with graphics 1024 pixels or greater. I think the default texture page size is 1024x1024, but it might be 2048x2048.... but having it too high can make your game less compatible since more VRAM is required. Be aware of this and keep it in the back of your head. Tons of small graphics are OK since you can have as many texture pages as you want, but loading and unloading them takes time. Usually only a problem on mobile devices, though, PC GPUs are pretty good at that kind of stuff.

With tiles, you don't really need to worry about that kind of stuff, not to mention they use less memory.
I'll keep that in mind - Thanks for the info
 
W

WoodenBastard

Guest
In your case with handmade and completely unique/preset levels, backgrounds are ok. The advantage of tiles is that you can reuse a lot of the content and when tiled the rooms can vary in size but still look seamless.
Good deal - thanks!
 

Niels

Member
You could use a tiled backdrop (sky and distant buildings) and draw unique assets/buildings that you place infront of the backdrop. That way you don't have to use huge pictures and you can even make a cool parallax effect.
 

GMWolf

aka fel666
You could use a tiled backdrop (sky and distant buildings) and draw unique assets/buildings that you place infront of the backdrop. That way you don't have to use huge pictures and you can even make a cool parallax effect.
That's probably the best way to go: it offers good artistic control, allows you to reuse assets, and allows you to scale different elements of the background.

It does mean more overdraw but you can largely ignore that
 
W

WoodenBastard

Guest
Ok good folks, so I've decided on a final level resolution of 960x180 (each view screen will be 192x108) So, does it seem safe for me to draw a single 960x180px background image without tiles and not have issues? If so, I would be drawing 8 of these single image level backgrounds to make the whole game. Levels would of course be separated by a text story screen or something enabling the next level's image to load. I know that adding other game elements will add to the load but I'm just asking about the background for now. I'm only asking again because I'm going to be doing a ton of drawing on this since I don't want to use tiles and don't want to not be able to use the art in the game after spending all that time on drawing it. Here's a visual of what I'm asking at the exact dimensions. Thanks again!Level-size.gif
 

GMWolf

aka fel666
draw a single 960x180px background image without tiles and not have issues?
If you want to be safe, draw your sprite, then cut it up into smaller sprites (like 128*128 or 256*256) and place those using asset layers. Depending on the device, it could perform better.

But until you see problems, you just code away :)
 
W

WoodenBastard

Guest
You could use a tiled backdrop (sky and distant buildings) and draw unique assets/buildings that you place infront of the backdrop. That way you don't have to use huge pictures and you can even make a cool parallax effect.
That was actually my next question - many thanks!
 
W

WoodenBastard

Guest
If you want to be safe, draw your sprite, then cut it up into smaller sprites (like 128*128 or 256*256) and place those using asset layers. Depending on the device, it could perform better.

But until you see problems, you just code away :)
Oh gotcha, makes sense - thank you!
 
W

WoodenBastard

Guest
12X12-grid.gif Ok, one last question for the day before someone slaps me. I figured out that a 12X12 grid is good for the tile sets for the game I want to make. But do I have to do the 3X3 configuration that I always see or can I add a few more tiles for options and variations? Like this....
 
Last edited by a moderator:

Jabbers

Member
I've been thinking about this for my current project, too. I'm dealing with a high resolution 2D game, and very large levels, and I'm not sure what the best approach is at the moment.

I don't like the wastefulness of large backgrounds, but breaking them down into tiles is time consuming, and it takes a certain delicacy to avoid making the world look repetitive. I'm targeting PC hardware, so I might just create a series of split elements that make up the world, and use tiles for background elements that appear consistently in the game (light switches, plants, other details). I think this is the best way to avoid wasteful memory use.
 

GMWolf

aka fel666
Again, you can just cut them up, without making tiles. (Just take your large image, and split it up into 8 images for example)
It will help especially if you have a view that moves srouar, as only the sections of the background you are currently viewing has to be loaded. (GMS will deal with memory loading/unloading for you)
 
By the way, 90+ % of steam users support a texture page of size 8192x8192 (OpenGL), although I haven't used GM in a while, I assume it does too. If you're releasing for mobile however, do aim for 2048x2048 or less.
 
W

WoodenBastard

Guest
Here's today's noobie question from me. I'm not clear on this. I'm drawing pixel art that will obviously be sized up to whatever screen later. When I'm uploading images to the texture sheet, am I just uploading the original pixel art size or the size it's meant to be played at later (on a 1080 screen for example)? Or will my pixel art be sized up based on the screen's being viewed on? Sorry if this is an idiotic question.
Untitled-1.gif
 
W

WoodenBastard

Guest
The art for my levels/rooms will be 960x108 px (no tiles, just one large custom drawing). Do the amount of colors matter as far as performance goes? Currently, I'm only using about 18 colors on each level. Is bumping that up to, say, 30 matter at all?
 

GMWolf

aka fel666
The art for my levels/rooms will be 960x108 px (no tiles, just one large custom drawing).
You should be fine there, since only one of those images will be used at a time.
Do the amount of colors matter as far as performance goes?
No, it really doesnt matter.
Currently, I'm only using about 18 colors on each level. Is bumping that up to, say, 30 matter at all?
You could use all 16.8 million colours available and still have the exact same performance.
Each pixel will be stored using 24 bit colour depth either way.

Well, actually, lowering the number of colours may help with VRAM usage if compression is enabled (not sure if GM uses dds compression or not).
Lower VRAM could help if you have a ton of textures all loaded at the same time, etc, but in your case I wouldn't worry about that.

At this point, I would say the best advice for you is:
Make your game, and only worry about optimization if and when you run into issues.

"Premature optimization is the root of all evil"
 
Last edited:
W

WoodenBastard

Guest
You should be fine there, since only one of those images will be used at a time.

No, it really doesnt matter
used if compression is enabled, but).

You could use all 16.8 million colours available and still have the exact same performance.
Each pixel will be stored using 24 bit colour depth either way.

Well, actually, lowering the number of colours may help with VRAM usage if compression is enabled (not sure if GM uses dds compression or not).
Lower VRAM could help if you have a ton of textures all loaded at the same time, etc, but in your case I wouldn't worry about that.

At this point, I would say the best advice for you is:
Make your game, and only worry about optimization if and when you run into issues.

"Premature optimization is the root of all evil"
Good deal, many thanks!
 
Top