Seeking advice for 2D map creation

Hi Community !

I wanted to seek advice on the best way to create a map for my game. But first, I thought I would introduce myself.

I am fairly new to game development and unity, but not to programming as my day job is software developer. I would eventually like to create my own game studio and work full time on it.

I want to create a top-down maze/collector game somewhat similar to the 2D UFO tutorial in the learn section. I would like to ask advice on how to create the map for each level. I see 2 ways of doing it, but not sure about the second one:

  1. Have your map as a background image, and then apply colliders on it where the walls are on your image (basically, the way it’s been done in the tutorial) (So if you have 100 levels, you would have 100 background images)

or

  1. Have a set of tiles and blocks, and create each level using some kind of procedural script. (I would need to take a look at how something like this would be done.)

I wonder if one of these approaches is better than the other, is there some kind of “standard”. Is there better ways of doing this ?

Sorry for the lengthy post.

Any advice, ideas would be really appreciated.

Thanks a lot !

Welcome js_mon407,

I didn’t see your post or I would of replied sooner, number two one is the way to go, I say that with some trepidation.

Now it will depend also how large your maps are going to be.

For example do I generate all the map or only part of it that’s in view(plus some overlap), this might depend on the game which one you decide.

If you have monsters running around the scene the second part might not be possible, as they will not collide with anything(walk though walls), this has always got me also, although my game, only has maps that are 33x33 (from the original game of the 1985), if I want to extent this how best to handle the situation, anyways back to this.

You have options by using TILED for an editor or something similar, I personally, use my own editor for this as I wanted, to make other styles of game with the same editor, so it uses a plugin system.

I hope this helps.

I would also recommend the second alternative. Although, keep in mind that you don’t have to use a procedural approach, you could just create the levels as ordinary scenes in Unity using prefabs of your tiles (complete with the necessary colliders). This is kind of a combination of alternative one and two.

At the moment creating tile levels with plain Unity is a bit of a chore, since it doesn’t have support for proper grid placement/painting with tiles. You will most likely want to get some asset that supports that from from the Asset Store.