Games Random or scripted levels for a shoot em up?

Scripted or Random levels for a shooter?

  • Scripted

    Votes: 3 50.0%
  • Random

    Votes: 3 50.0%

  • Total voters
    6

andymc

Well-Known Member
Licensed User
Longtime User
I'm looking for peoples opinions on what you prefer. For my space shooter, I'm trying to decide between scripting the levels so the same attack waves come each time in the same order, allowing the player to remember them and play based on what they know is going to happen. Or to randomise the levels, so the player doesn't know what alien type will attack next, forcing them to use skill rather than memory to play.
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
Hi @andymc
If your intention is to have a global high score table so that players can see their ranking against other people's score then I would opt for scripted. But if your intention is just for a purely stand alone shot em up then I think a random approach would be more addictive. And have more longevity.
Just my two cents though. ;)
 

sorex

Expert
Licensed User
Longtime User
most good retro shooters (Gyruss, 1942, Flying Shark...) are predefined.

and it makes sense too. games would be too hard to for your placed coins if it was all random.
 

wonder

Expert
Licensed User
Longtime User
Where's the "procedurally generated" option (a mix of scripted random)? ;)
 

ilan

Expert
Licensed User
Longtime User
why not both?

i would create groups of waves. each group has 5 waves. each group is a different hardness stage.
if you are in stage 1 you always will show the same group but switch between the waves in that groups randomly.

this is how i do it in my "Space Defender - Ultimate" game.
But to have the also the filling of a scripted level choosing game i always show the same wave (from group 1) at the start of the game.

i use @DonManfred Shuffle List function to create a shuffled list so same waves wont appear after each other and also you go through all waves before they repeat.

lets say:

Group 1: (1,2,3,4,5)
shuffle list: (3,5,4,2,1) and after all waves appeared shuffle again and show until stage changes and the second group of waves will start.

it has both "RANDOM + SCRIPTED"

and i also have waves that put the enemies in a random position with a random path. but most waves have the same path's for the enemies.

so MIXING is the key ;)
 

andymc

Well-Known Member
Licensed User
Longtime User
Okay, so based on the massively overwhelming vote of 3 votes to 1 in favour of scripted levels, I'm deciding how to structure my levels. I'm going to have a number of waves per level, each wave will have a number of attacks, each attack is an enemy type attacking in a set formation comprised of four to six enemies. At the end of each level, after five to seven waves, they'll be a boss enemy, there's two boss graphics, but they will attack in different ways each time you meet them (I may also change their colours and weapons).

For the level files, I want to be able to write them manually using a simple text editor like notepad++, the simplest file to write would be a CSV file, I can then use the string utils library in B4A to read in the level files, one file per level. The level file structure would be like this:
level, num waves
wavenum, num attacks, bosswave(0,1)
attack1 atype,number, position,direction
time before next attack
attack2 atype,number, position,direction
time before next attack
attack3 atype,number, position,direction
...
...
wavenum, num attacks, bosswave (0,1)
attack1 atype,number, position,direction
time before next attack
attack2 atype,number, position,direction
time before next attack
attack3 atype,number, position,direction
...
wavennum, 1, bosswave 1
bosstype, speed, attacktype
...
one level per file, approx five to seven waves per level
one boss per level

To have multiple attacks start at once I set the time before next attack to zero, if the enemy attack is defeated before the time runs out then it starts straight away ignoring the rest of the next attack countdown.

I'll see how much I can get done on this today and post a video later if I manage anything that works.
 

andymc

Well-Known Member
Licensed User
Longtime User
hmm, working on this now, I didn't realise stringutils requires the same number of fields per line in a CSV file, I'll just pack out the other lines ,0,0 where I need to, looks like this will work. It's not the most elegant solution, but it works for what I need.
My level file with two waves looks like this:
1,2,0,0
1,4,0,0
1,4,1,3
0,0,0,0
1,4,3,3
240,0,0,0
2,5,2,1
0,0,0,0
2,5,3,2
2,5,0,0
3,4,1,1
120,0,0,0
3,4,1,1
600,0,0,0
4,6,1,1
0,0,0,0
4,6,1,2
500,0,0,0
1,10,3,3

I think the typical level file will be around 120 lines long, I'm start with 12 levels in the first release, so that's 1440 lines to write in total, oh god that'll be boring, might have to write an editor in BlitzPlus or B4J maybe.

UPDATE: oh god it's hurts my head writing levels like this! :) It is working though, mostly, there's some crazy behavior I need to resolve. Logging is really useful for this sort of thing.
 
Last edited:
Top