Shoot 'em up level designing/making

Started by
4 comments, last by BeerNutts 11 years, 9 months ago
Hello guys!

I'm thinking of making a bullet-hell game like Sky Force or Jamestown. My question is how do you create the levels? What I mean is how is the level data structured or how will be the level editor look like for games like this? This is my first time to hit this game genre.
Advertisement
You can do this a few different ways. The simplest (and the way i did it back when I made a shump) is designate the background items by assigning them a time to come onto the screen, with a velocity associated. So, if you're flying in space, and you have a large planet moving in the background, you can set it to come into the level after X mS, and it moves at Y pixels/second (or whatever your units are).
I did the same thing with the enemies (ie, had them come onto the screen at certain times, at certain locations.speeds, etc.). The base idea is your ship doesn't move into the level, the level moves onto your ship by time values.

I did this using a simple text file, and I read the text file before each stage (here's a sample stage1.txt I used):

# The format for the stage is like follows, it must be in order!
# Time enemy (or Background object) should appear since start (in mS)
# Enemy (or BackGround object) Name
# Flags (should be 0)
# Any other enemy attribute you want to change from default
# start music
250
M:stage1.wav

# Back Grounds
2500
B:Moon
0

500
B:Hills
0
65000
B:Moon
0

1500
E:Orb
0

2000
E:Orb
0

2500
E:Orb
0

3000
E:Orb
0

3500
E:Orb
0

5000
E:Special
0

10000
E:Fighter
0

15000
E:Special
0
LocationXY: 640 80
SpeedXY: -134 -134

20000
E:Skimmer
0
LocationXY: 640 10

20000
E:Fighter
0

23500
E:Orb
0

24000
E:Orb
0

25500
E:Orb
0
LocationXY: 640 400

26000
E:Orb
0
LocationXY: 640 400

1st value is time in mS, second is what comes on screen (E = enemy, B = background, M = music)

The other option is to use a level editor and map out the levels using space, and have your ship move through the level via a constant velocity. You might look at gleed2d to design your maps. You can also insert your enemies using the editor, and when they come on screen (meaning, your main ship as progress close to them),they become active.

Good luck!

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

is this the way the jamestown made?
I don't know how Jamestown was made. You certainly have the option of creating your own game editor and tailor it to your game. My suggestions were on the easy side to help speed development of the game.

You might want to look at other tile-based map editors as well (Tiled is one that comes to mind) for tile-based maps.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

that's the position/movement,but when to shoot?

that's the position/movement,but when to shoot?


You've now moved from "creating levels" to "creating Enemy AI." This is a separate issue from designing a level.

There are multiple ways to solve this, but I would suggest having external data define the enemies and their behaviors. This could be via an xml file, or using some scripts (lua, for example).

A simple example, for an enemy that lazily moves down the screen and shoots a single bullet towards the player occasionally could be:

<Enemies>
<SimpleEnemy>
<Behavior type="Default" />
<Velocity x=0, y=10 />
<Bullet>Peashooter</Bullet>
<RefireRate>2000</RefireRate>
<Health>10</Health>
<Images>SimpleEnemyAnimation</Images>
</SimpleEnemy>
</Enemies>

Note, if you did this, you should also define the bullets, behaviors, and Images. So, the Bullets would have the strength, speed, Images, etc. the behaviors would define how the enemies move and shoot. And the Images defines the images used for animation, and the animations the ships go through.

Just an initial thought. Good Luck!

(Edit, FWIW, here's what I used (this was done in 2001, and I should've used xml, but didn't). Realize I had used code to define the behaviors:

# The Enemy attributes must be in this order!
# Name:Enemy Name
# Frames:Number of animation Frames
# Clips:Clip filenames of frames in order with space between
# if (frames != 0) time between changing frames
# Starting X and Y Speed with space
# Strength: Enemy Strength
# Flags: looks in alpha.h for flags
# Weapons: number of weapons, and if not 0 then...
# WeaponType: Weapon Type Numbers (found in defines in alpha.h) with space
# LocationXY: Starting location of enemy
# Direction: Starting direction of enemy (0 = pointing left) Not Required!
# Order: Left, Up, Right, Down, UpLeft, UpRight, DownRight, DownLeft
# Note: Size, pFunc, and ulTimeOn don't have to be set
# make sure the strings have no space between

# Clips:enemy1.nif,enemy2.nif
Name:Orb
Frames: 2
Clips:orb1.bmp,orb2.bmp
FrameTime: 300 300
SpeedXY: -201 0
Strength: 5
Flags: 0
Weapons: 0
WeaponTypes: 0
LocationXY: 640 50
Direction: 0
# Satellite; use on black background levels (Space)
Name:Satellite
Frames: 10
Clips:Sat1.bmp,Sat2.bmp,Sat3.bmp,Sat4.bmp,Sat5.bmp,Sat6.bmp,Sat7.bmp,Sat8.bmp,Sat9.bmp,Sat10.bmp
FrameTime: 45 45 45 45 45 45 45 45 45 45
SpeedXY: -300 0
Strength: 85
Flags: 0
Weapons: 0
WeaponTypes: 0
LocationXY: 640 50
Direction: 0
# Special Ship so set flag to 2 if only upgrade
Name:Special
Frames: 1
Clips:SpecialEnemy.bmp
FrameTime: 0
SpeedXY: -134 134
Strength: 12
Flags: 2
Weapons: 0
WeaponTypes: 0
LocationXY: 640 400
# Upgrade object for upgrading weapons
Name:Upgrade
Frames: 1
Clips:WeapUpgrade.bmp
FrameTime: 0
SpeedXY: 0 -134
Strength: -1
Flags: 2
Weapons: 0
WeaponTypes: 0
LocationXY: 0 0
# NewOption object for upgrading weapons (flag 8 = NEW_OPTION)
Name:NewOption
Frames: 4
Clips:option1.bmp,option2.bmp,option3.bmp,option4.bmp
FrameTime: 45 45 45 45
SpeedXY: -134 0
Strength: -1
Flags: 8
Weapons: 0
WeaponTypes: 0
LocationXY: 0 0
# Homing Weapon object for Homing Missile (flag 65536 + 4 = WEAPON_UPGRADE)
Name:Homing
Frames: 1
Clips:HomingObject.bmp
FrameTime: 0
SpeedXY: -134 0
Strength: -1
Flags: 65540
Weapons: 0
WeaponTypes: 0
LocationXY: 0 0
# Plasma object for Plasma Blaster (flag 131072 + 4 = WEAPON_UPGRADE)
Name:Plasma
Frames: 1
Clips:plasmaobj.bmp
FrameTime: 0
SpeedXY: -134 0
Strength: -1
Flags: 131076
Weapons: 0
WeaponTypes: 0
LocationXY: 0 0
# EMP object for Bomb (flag 262144 + 4 = WEAPON_UPGRADE)
Name:EMP
Frames: 1
Clips:emp.bmp
FrameTime: 0
SpeedXY: -201 0
Strength: -1
Flags: 262148
Weapons: 0
WeaponTypes: 0
LocationXY: 0 0
# Fighter enemy (it looks like a fighter plane or helicopter ;)
Name:Fighter
Frames: 4
Clips:helicopter1.bmp,helicopter2.bmp,helicopter3.bmp,helicopter4.bmp
FrameTime: 30 30 30 30
SpeedXY: -268 0
Strength: 32
Flags: 0
Weapons: 1
WeaponTypes: 6
Refire: 3000
LocationXY: 640 120
# Skimmer enemy
Name:Skimmer
Frames: 1
Clips:skimmer.bmp
FrameTime: 0
SpeedXY: -268 0
Strength: 19
Flags: 0
Weapons: 1
WeaponTypes: 0
Refire: 1200
LocationXY: 640 450
# GunTower (it moves along slowly, only shooting bullets)
# Clips:expe1.nif
Name:GunTower
Frames: 1
Clips:guntower.bmp
FrameTime: 0
SpeedXY: -134 0
Strength: 36
Flags: 0
Weapons: 1
WeaponTypes: 0
Refire: 2600
LocationXY: 640 10
# EndBoss1
# flags = 128 (2^BOSS)
# no refire; setup in function
Name:EndBoss1
Weapons: 7
WeaponTypes:0,0,0,0,0,4,4
Frames: 1
Clips:boss.bmp
FrameTime: 0
SpeedXY: -536 0
Strength: 1200
Flags: 128
LocationXY: 640 10
# BigRock (big rock, bounces around on screen, moving left slowly)
Name:BigRock
Frames: 4
Clips:bigrock1.bmp,bigrock2.bmp,bigrock3.bmp,bigrock4.bmp
FrameTime: 400 400 400 400
SpeedXY: -134 0
Strength: 120
Flags: 0
Weapons: 0
WeaponTypes: 0
LocationXY: 640 24
# LilRock (little rock, bounces around on screen, moving left quicker)
# NOTE: location doesn't matter (this spawns from BigRock)
Name:LilRock
Frames: 4
Clips:lilrock1.bmp,lilrock2.bmp,lilrock3.bmp,lilrock4.bmp
FrameTime: 300 300 300 300
SpeedXY: -201 0
Strength: 72
Flags: 0
Weapons: 0
WeaponTypes: 0
LocationXY: 640 24
# Falcon (millenum Falcon! Frames are tricky. Not animated, depends on Direction)
Name:Falcon
Frames: 4
Clips:FalconU.bmp,FalconL.bmp,FalconD.bmp,FalconR.bmp
FrameTime: 0 0 0 0
SpeedXY: 201 0
Strength: 56
Flags: 0
Weapons: 1
WeaponTypes: 0
Refire: 3000
LocationXY: -15 420
Direction: 0
# Spread Weapon: Spread Gun (flag (2^19)524288 + 4 = WEAPON_UPGRADE)
Name:Spread
Frames: 1
Clips:SpreadObject.bmp
FrameTime: 0
SpeedXY: -134 0
Strength: -1
Flags: 524292
Weapons: 0
WeaponTypes: 0
LocationXY: 0 0
# Shooter: Shoots bullets all around
Name:Shooter
Weapons: 8
WeaponTypes:0,0,0,0,0,0,0,0
Frames: 1
Clips:shooter.bmp
FrameTime: 0
SpeedXY: 134 -134
Strength: 80
Flags: 0
LocationXY: -10 100
# Small Bat, flies straight, then dives towards player
Name:Bat
Frames: 8
Clips:bat1.bmp,bat2.bmp,bat3.bmp,bat4.bmp,bat5.bmp,bat6.bmp,bat7.bmp,bat8.bmp
FrameTime: 180 30 30 30 30 30 30 30
SpeedXY: -200 0
Strength: 60
Flags: 0
Weapons: 0
WeaponTypes: 0
LocationXY: 640 50
Direction: 0
# end guy, pretty tough!
Name:BigBat
Frames: 8
Clips:bigbat1.bmp,bigbat2.bmp,bigbat3.bmp,bigbat4.bmp,bigbat5.bmp,bigbat6.bmp,bigbat7.bmp,bigbat8.bmp
FrameTime: 300 100 100 100 100 100 100 100
SpeedXY: -40 0
Strength: 3000
Flags: 0
Weapons: 7
WeaponTypes:0,0,0,0,0,0,0
LocationXY: 640 100
Direction: 0

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

This topic is closed to new replies.

Advertisement