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

tiles or objects? (platformer level)

F

fxokz

Guest
When making a platformer game what i usually so is make 2 objects for the ground.. obj_grass and obj_dirt. Both of them have a parent called par_wall which is referred to for all collisions with the player.

I recently watched a youtube video in which the whole level is made up of tiles but there are also invisible black boxes which are placed where the player will collide.

What method is better overall in terms of versatility, time efficiency and later wont cause many problems.
 

TheouAegis

Member
How many instances would your project currently use with how you normally do it?
How many instances would your project use if you did the tiles+overlay method?
Use whichever one requires the fewest instances in your rooms.
 
F

fxokz

Guest
How many instances would your project currently use with how you normally do it?
How many instances would your project use if you did the tiles+overlay method?
Use whichever one requires the fewest instances in your rooms.
Well i could have hundreds of instances because obj_dirt and obj_grass alone has to fill up the ground. But with tiles i only have to worry about collison instances?
 

toxigames

Member
If all the dirt images are uniform sizes (for example rectangular) you could definately just make them objects and use rectangular sprite mask. I wouldn't make a seperate grass object especially if the grass is purely graphical. You could in each dirt objects draw event draw the grass image.
 
F

fxokz

Guest
The grass object is basically just a 32x32 block with the bottom half being dirt and the top half being grass.
 

toxigames

Member
The grass object is basically just a 32x32 block with the bottom half being dirt and the top half being grass.
So the grass object includes the "dirt" in it? Im a bit confused, because what then happens in the dirt object that doesnt already take place in the grass object (since dirt is already a part of the grass object)?

If you want the grass to always be at the same position on each platform you can just make one image containing bort dirt and grass and then have just one platform object using that image with a rectangular sprite mask. I don't think tiles would benefit you in this case unless there is some specific reason for it. One reason could be repeating textures to save on texture size and memory use, but that also depends on how you want the game to look. A repeating texture (using tiles) could also be used to make it look more retro for example.
 

toxigames

Member
Another solution that might fit with tiles anyway: Say you want to be able to create modular platform designs (building levels with your 32x32 blocks) then you could make them tiles and paste them in in the room editor. Then you could have wall objects that could have a black 32x32 black sprite (but set visible = false). Then in the room editor you would scale those objects to fit over the tiles placed. Such that if you place for example 16 tiles (for example in a 2x8 pattern) then you could just place one wall object and stretch it over all 16 tiles. Stretching objects in the room editor conforms to the snap x/y setting, so if you set snap x/y it to 32 it will be easy to match each tile. I think this would be performance wise solution for you.
 
Last edited:
F

fxokz

Guest
Another solution that might fit with tiles anyway: Say you want to be able to create modular platform designs (building levels with your 32x32 blocks) then you could make them tiles and paste them in in the room editor. Then you could have wall objects that could have a black 32x32 black sprite (but set visible = false). Then in the room editor you would scale those objects to fit over the tiles placed. Such that if you place for example 16 tiles (for example in a 2x8 pattern) then you could just place one wall object and stretch it over all 16 tiles. Stretching objects in the room editor conforms to the snap x/y setting, so if you set snap x/y it to 32 it will be easy to match each tile. I think this would be performance wise solution for you.
thats my plan, im sure its got to be better than placing individual objects in the room. (tiles + invisible blocks) has got to be better than (using objects as both collision checkers and tiles).
 
A

anomalous

Guest
There is no way to know which is better, and which won't or will cause problems, because its dependent on your game design and your experience level, and your personal choice.

Of the two I would use tiles + invisible objects, its likely if you need to differentiate grass from dirt, using tiles can be done well enough to give you few downsides.
Another method is to use tiles + a collision grid. You can look up info on that, there are countless posts on it, but it is more advanced.
 

Alexx

Member
If I'm making a game with a huge room or refining a prototype, I'd use tiles + invisible objects.

If I'm just making an initial prototype to check game mechanics, or it's a small room I'd use separate objects.
I find using separate objects is quicker when making minor changes to a room. Once I'm happy with the layout, then I'd redo using tiles and visible objects.

Though sometimes I'd use a totally different approach, just depends on my mood at the time
 
Last edited:
C

CoderJoe

Guest
tl;dr but tiles is usually the way to go. Make some kind of invisible platform object and place it where you want platforms. This object can be scaled meaning you can use less instances which will be more efficient. At the same time, graphics quality is maintained because you can use tiles to make it look exactly like you want.
Btw. Don't use physics if possible. Not efficient at all (trust me I did a project and ran into SO many problems). Like TheouAegis said you could also just use tiles and check where certain tiles are. This is the most efficient way since the main resource being used is the image rather than all the variables that go along with object.

@Alexx glad I saw the banner in your signature otherwise I would have missed the jam :p
 
Top