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

Asset Layer and using MANY sprites question

Zuljaras

Member
Hello everyone!

I just started using GMS2 seriously. Until now I was only making my game on GMS1.4.

There I made my scenery with tiles. However now I discovered that I could use an asset layer and put sprites directly into the ROOM!

I made separate sprites of bricks for example. And the way I use them is build something brick by brick and it is awesome!

HOWEVER I am worried that this might not be intended.

So my question, before I continue forward, is are there any drawbacks of doing this? Can I put as many sprites in the room with the asset layers?

Thanks in advance for any answers!
 

xenoargh

Member
If these are "just scenery" and don't need to deal w/ collisions, etc., it's not a big deal. The overhead of doing this is a little higher than w/ tiles, but not heavy. Of all the things that might impact performance, this really isn't one to lose sleep over.
 

Zuljaras

Member
If these are "just scenery" and don't need to deal w/ collisions, etc., it's not a big deal. The overhead of doing this is a little higher than w/ tiles, but not heavy. Of all the things that might impact performance, this really isn't one to lose sleep over.
Yes they are just sprites (not instances/objects) that are not even animated (only one image). Just bricks (for example).

I will wait for more answers but I thought that the asset layer is exactly for that but I was not sure.

Thanks for the info.
 

CMAllen

Member
GM can handle drawing hundreds of thousands of sprites quite easily. And assets layers are further optimized for speedy drawing, so you can get away with even more of them on an asset layer.
 

Zuljaras

Member
GM can handle drawing hundreds of thousands of sprites quite easily. And assets layers are further optimized for speedy drawing, so you can get away with even more of them on an asset layer.
Well in that case I don't know for what I will ever use tiles. Maybe for menus.
 

kburkhart84

Firehammer Games
I understand that tiles are more optimized than assets this way. They also can handle tile-based collisions if that fits your needs. Many people use tiles where they can, and then use assets for things that need animation and/or don't fit in with tiles.

But tiles don't fit the needs of all games. If they don't properly fit your I would use what does and not try to force their usage where it doesn't make sense.
 

Zuljaras

Member
I understand that tiles are more optimized than assets this way. They also can handle tile-based collisions if that fits your needs. Many people use tiles where they can, and then use assets for things that need animation and/or don't fit in with tiles.

But tiles don't fit the needs of all games. If they don't properly fit your I would use what does and not try to force their usage where it doesn't make sense.
In my game in GMS 1.4 I used tiles for everything in the level except for collisions. For collisions I still use solid objects. That is just how I built my game :)

But now I see so many possibilities with the asset layer.

So there is no chance of memory leaks etc. when building the vision of my rooms with many sprites in 2-3 asset layers?
 
Top