Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've been working in my free time on a vertical shooter similar to Xenon 2 Megablast. It's a tribute of sorts to the game that destroyed a considerable part of my childhood.

I've got the basic stuff in place - weapons, enemies, collision detection and a scrolling background. Now, I want to design the levels.

I want to create some kind of an engine which can render a level based on some kind of (say) textual description so that I can easily create levels. Are there any articles or links to how platformer/vertical shooter levels can be stored as files and loaded by the game engine? I'm not looking for completely solutions but ideas and starting points so that I can try to do it myself.

Specifically, how would you store the level of a platformer game like Prince of Persia or a shooter like Xenon 2?

share|improve this question
1  
I'm not sure what exactly you are looking for. Are you interested in the aesthetic design aspects, in the gameplay aspects (how to place objects for interesting gameplay), do you need help with the technical implementation (how to store and load the level design) or do you need a map editor? –  Philipp Jun 11 '13 at 7:29
    
Technical implementation. Thanks for your comment that clarifies all the aspects of this. –  Noufal Ibrahim Jun 11 '13 at 13:04
1  
whathaveyoutried.com –  Tetrad Jun 11 '13 at 15:38
1  
Tetrad - Nothing since I haven't a clue how to start. Like I've already mentioned in my question, I've got everything except the level background/design/engine working and I don't know where to start. –  Noufal Ibrahim Jun 11 '13 at 16:02

1 Answer 1

I don't know if you can find any valuable resources or articles about the topic, but I think that the idea of the textual description is good. Personally, I have some experience with vertical-scroller shmups, and I have always followed this approach.

Roughly speaking, you can have a series of text files (or other kind of file...); each file corresponds to a level of your game. Every row of a file contains the essential informations that you need to generate the enemies (or other objects, such as background elements - like planets, stars,...). These informations, obviously, vary accordingly with your specific game but, in general, they could be:

  • The spawn time: this is the time that you have to wait between a "row" and another. Basically, you control the frequency of spawning, with this "parameter";

  • The enemy type: this could be an index, or a string, that represents the specific enemy type. As an example, if you have 20 types of enemies in your game, this can be a numerical index, from 1 to 20, that represents the type of object to be instantiated: a particular function in your code will bind the index with the specific asset of the enemy. As I said, you could also use the string that represents the asset's name in your project: It will just be a unique identifier for the object to be instantiated.

  • The x and y coordinates that define the spawn point (y-coordinate could be avoided, and defined as a constant, if all the enemies come from the top of the screen).

So, your txt file can be structured in a similar fashion:

4.0 little_enemy_1 200 150
0.0 little enemy_1 240 150
0.0 little_enemy_1 280 150
3.5 mothership 140 170

In Unity (sorry, but I'm familiar with that...) these lines correspond to:

yield WaitForSeconds(4);
Instantiate (little_enemy_1, Vector3.Position(200, 150, 0), Quaternion.identity); 
Instantiate (little_enemy_1, Vector3.Position(240, 150, 0), Quaternion.identity); 
Instantiate (little_enemy_1, Vector3.Position(280, 150, 0), Quaternion.identity); 
yield WaitForSeconds(3.5);
Instantiate (mothership, Vector3.Position(140, 170, 0), Quaternion.identity); 

If you're not familiar with Unity, those lines say: "wait 4 seconds, generate 3 little enemies in a row, wait 3.5 seconds, and generate a mothership (all in the proper coordinates)". In my example I have not considered the particular rotation of the objects that have to be spawned, but, obviously, you can also add that.

I know that it was just a quick tip, but I hope that it could represent a good start point for you, as you asked. Any feedback will be appreciated, of course.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.