How are levels ACTUALLY made?

Started by
6 comments, last by L. Spiro 11 years ago

This might seem like a stupid question, but I've always wondered how different game levels are actually created?

Are they made through a simple level editor? Or are they individually coded?

For example a side scroller game has different levels with each one being remotely unique in terms of platforming.. Is this through an editor or is each level actually programmed individually?

Advertisement

Typically, an editor of some sort is made. This will create some sort of data inside of itself which is then saved in a known ordering (also called a format). The game would then load the information in that file when the game program is told to do so.

It would be the editor program that details what information is stored. A simple tile based editor could allow the user to define the level's width and height, the image file that would be used to get the tile images from. It would then allow the user to assign each tile in the level a number that represents what portion of the spritesheet that is suppose to be put in that tile's space on the screen. It would then save this information in an external file that the game would then later load and get the data for the level from.

For example, for a simple tile based map, the file could store the height and width of the level in tiles, the name of the image file that the level is going to get it's tiles from, and a number that says what image that tile should be.

So for a 4x4 the file could look something like this:

4

4

leveltiles.png

0

0

1

2

3

4

0

0

1

2

3

4

0

1

4

5

It could also look like

4 4

leveltiles.png

0 2 4 5

1 2 2 0

1 1 1 1

2 3 2 3

When the level is loaded, it would open the file and get the height and width. Then, it would set up some sort of storage container, such as a vector of vectors. It would set one vector's size to the height, and the the size of each vector inside of it to the width, or vice versa. It would then load the image data from the file specified and save that.
Then it would go through and fill the earlier created vectors within vectors with the number of the tile it is suppose to represent.

The portion of code would then use this information and information about tile width and height (which could also be stored in the level file) to draw the appropriate tile image.

That's how a level is made. You COULD write it all by code, but that is really super inefficient.

If you want to see an (incomplete but operable) example, I would be willing to give out the source code for a level editor that I created.

Combination of both? The level at-large is usually done up in some kinda editor. At my last job we used our 3d modeling program (Maya) with some custom "node" objects that were our game objects + instance data. But that only sets up the where and what of a level. A level will have 1 or more flow controllers for that level that controls the when and how. These controllers could be all common items that are fully data-driven in how they affect each level (types of cameras, death-timers that have a trigger on and off zone, key-door or puzzle-door pairs). They could also be level-specific one-offs that could be but aren't used in multiple levels (rising lava floor, or a mini-game). And they could be very specific one-off controllers like a end-stage Boss who controls the events of the whole battlefield while he's active.

The Guide to Implementing 2D Platformers

I have a real time wargame that has map, mission, and campaign editors. the mission editor includes an order of battle editor.

the map editor lets you place terrain on the map used for a mission. it works like a paint program.

the mission editor lets you sepecify the map used, and edit the order of battle and the mission conditions. editing mission conditions is like filling in fields in a database app or cells in a spreadsheet.

the campaign editor lets you specify the missions in a campaign, and the mission flow (which mission follows which on success and failure), along with text files containing pre-and post-mission briefings, and pre- and post-campaign briefings. its like a database or spreadsheet editor too.

the order of battle editor displays the map for a mission, and lets you place units and buildings. it works like a paint program.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

My Multiplayer RPG game has A Massive Tool which I call the world Editor. But in reality it does everything for my RPG.

This world editor allows me to edit The terrain, enemies, quests, items.

-Terrain. The World editor allows me to shape the terrain by raising, lowering, smoothing terrain at different radius amounts where I click the mouse. You can probably youtube World Editor and see others that do the same thing. Additionaly, my World Editor allows me to paint the terrain like you would with brushes in a paint program. I can paint roads or sides of cliff to look like stones, or dirt, etc. Even blend between tile types and set sizes of brushes. This is probably what you would consider making the Level.

But every game is different. My RPG needs enemies, items that drop off enemies and that you get from quests. Static objects such as trees and buildings, Moving objects like Enemies, NPCs. Shops, Graveyards to bind and respawn when you die……

And for this, I added more functionality to my World Editor. For Example, you can enter a mode and place static objects anywhere you point on the terrain. So I have a list of objects like Trees, Building, Rock, and when you click on the terrain, it will add an object to the scene and place it where you clicked. Additionally, you can click on an object and move it around and rotate it, etc…

Then I have A quest list and a quest window. It looks something like a Mad Lib, with a bunch of Text Box fields you can enter. Things like:
Previous Quest Required Id:
Quest Name:
Starting Text:
End Text:
Item Reward:
Quest type: (Kill X_OF_Y, COLLECT_X_OF_Y, TRAVEL_TO_X).
Exp Reward:
…etc

Then I have an Item Editor where you can select Icon images, select the level, the stats for an item. You can create new items or edit old items. Much like quests an item will have lots of drop downs and text boxes.

I also have an NPC tab in my world editor. Much like static objects, you can place NPCs, and move them after placed. NPCs are vague in my Game Description. ANything that you can communicate by clicking on (that is not hostile) is an NPC. (A merchant, A bindstone, a Quest giver, a Barrel). That way you can assign NPCs to quests or quest objectives (Rescue Luke from the orc camp).

Finally, The same as NPCs i have an Enemy mode where you can place, move enemies, and adjust their stats. Things like their hostile radius, and hp, attack values, etc…..


The point on why I explained everything is to give you some insight on why. The game Editor allows me to customize the world to look how i want it to look, very easily and visually. And the beauty is every subsystem has a way to export its results.

My terrain exports a custom .map file. My items, quests, and enemy stats are all saved in various database files easy to drop into the main game. And to give you some idea of time. It took me about a year and a half to design and program this monolithic world editor. But in 1.5 years it all paid off, because I was able to construct, paint, design, my seamless world, to how I envisioned it would look, in 3 days.

Yep, all that work, so I could use the tool for 3 days. I had about another half a year to actually program the RPG (combat, spells, networking, GUI, etc..), but when it came time to finally design the game, just a mere 3 days.
And this was after writing the lore, designing class concepts, world map 1.5 years prior. I guess the plus side is, I could design a new continent in under a week for an expansion :)

But to be fair, 85% of the World Editor Tool's code was used directory in the game.

Thank you all for the responses, cleared up most of the questions I had :)

If you want to make 2D maps you will certainly want to look into Mappy.

It allows exporting the maps you create in many formats, from text to binary to raw C/C++ code.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

This topic is closed to new replies.

Advertisement