Building a world!

titlePicture2

An ongoing process throughout this project has been to create a world in which our character will explore and exist in. From early stages in development we decided that there will be one large hub filled with a town, various points of interest and treasure. Also, within this hub there will be entrances spread around the map which will teleport our protagonist into randomly generated caverns or dungeons. These entrances are depicted as cave entrances in mountain sides or holes in the ground which our character can climb down. Other types of entrances might be implemented later depending on how the map develops.

So this task was given to me, and ever since we started on this project, I have worked on this every now and then when inspiration strikes. Luckily I am given this freedom on this portion of the project because it isn’t as strongly tied to what everyone else is doing, unlike my other major task, creating our player character. This is due to the fact that everyone has their own test scene. So the majority of the logic based testing and game balance is done in the developers test scene, rather than in the main world where the game will primarily take place.

So how is our world created? I’m glad you asked!

We took some time deciding how this world would be created. Our first attempt at getting started was to use a program called Tiled Map Editor. This is a program designed specifically for making 2D maps for games. To import the maps into Unity we were going to use a plugin called Tiled 2 Unity, which imports maps made in Tiled Map Editor, to Unity. As the name suggests.

Tiled Map Editor: http://www.mapeditor.org/
Tiled 2 Unity: http://www.seanba.com/tiled2unity

At first this method worked great. Tiled Map Editor is an amazing tool and makes map editing very easy and the maps you create look great with minimal effort. Importing to Unity using the plugin was also easy and painless. The problems started when we tried to share our maps with each other over git. When another group member tried viewing the map which was created and imported to Unity and then sent over git, pieces of the map and textures were missing and it just looked terrible. After researching the problem and finding no solution, or solutions which didn’t fix the issue for us. We decided that we may in fact have to use the standard map editing tools in Unity.

The map editing tools in Unity are in fact quite powerful, if you are working with 3D games, which we are not. Unity is known for being quite terrible for working with 2D maps and it feels like all the tools available were implemented by the Unity team as an afterthought. This may be directly linked to the fact that Unity is in fact called “Unity 3D”. But I powered through and eventually got used to using it, and when I got used to it, it wasn’t so painful to work with.

Moving on to how I actually created a map, or world, if you will.

So we first got lots of sprite sheets from the Open Game Art website. These sprite sheets are free for everyone to use, as long as we give the correct recognition. We decided to try and stick to the sprites created for The Liberated Pixel Cup (LPC) since they all had the same art style and worked well together.

Most of the sprite sheets were created so you could slice them up into 32 by 32 pixel squares. Once that was done it was simply a matter of placing the squares which matched next to each other to create what you wanted. If you look at the picture below you can see that it has been cut into squares (32×32 pixels). This sheet is the sheet I used to create some of the paths in our game. The sheet is set up nicely so you have everything you require to make whatever size dirt path or area you wish.

spriteSheet

The sprite editor shown above is the Unity tool for cutting up sprite sheets, and is quick and painless to use. The painful part starts when you have to start positioning them and lining them up besides each other. Unity has a pivot for the sprites, as you can see on the picture above, the pivot is set to the center on this sprite. The pivot is used when you want to snap the sprites together (line up the sprites pixel perfect). This makes it much easier to align sprites and make everything pixel perfect. This sounds amazing in theory, but in practice it wasn’t as easy to use. Each individual sprites needs to be given its own pivot position, and even when clicking apply, the pivot position didn’t always apply. A lot of the time I just relied on zooming in really far and manually placing the sprites so they aligned.

When I have created a collection of sprites which depict something, which I hope looks reasonable. I save it as a prefab in our project. A prefab is basically a finished product which we want to use in our game. A good example of a prefab would be a tree. The idea is that, if we have one hundred trees in this world I have want to create, instead of me making one hundred separate trees, with an ordering layer, and its own box collider. I can instead make one tree, save it as a prefab, and then I can basically click and drag it into our world to add it. Every tree of this type will then have its own ordering layer and box collider so I don’t have to set it one hundred times. Instead, just to add some variation, I can change the scale of each tree, so each tree looks independent from each other and creates a more dynamic world.

treeList

So coming back to creating a world as a whole. The main idea with the world is to give the player a playground to explore in. We decided early on that our world will have a main town where the player can interact with other non-player controlled characters (NPCs), to learn about the world and perhaps buy and sell items. From the town there would be paths leading north, east, south and west which the player can follow to be guided to various points of interest. Out in the world the player will encounter entrances which will teleport the player into randomly generated dungeons filled to the brim with enemies and wonderful loot (If we have time to implement items). This is where the main gameplay will take place and the player will be forced to fight for their lives.

cavernEntrance

As of right now while I’m writing this, our world has a basic layout. There is a town in the middle, a mountainous area off to the west, a river and lake down to the south and a farm area to east. And of course there is The Dark Forest to the north, which I have named such for ominous and adventurous reasons. We still haven’t decided on any name for the world yet, but I’m almost positive that we will come up with something colourful and original like Wondershire, or Fantopia.

Before I am happy with the world I am creating I still have a bit more work to do. I want to have more dungeon entrances spread all around the map. I would also like to fill the map up enough so that you never have your character in a screen which only shows grass. As this gives you little sense of where you are on the map and is just plain boring to look at. I also need to enclose the map so our player doesn’t just wonder off into the abyss that is a world with no textures.

Otherwise the world creation is an ongoing process which can always be worked and improved upon, as well as just generally adding more things to it. Atleast until the final build of the project.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s