Games Random or scripted levels for a shoot em up?

Discussion in 'Game Development' started by andymc, Nov 15, 2017.


Scripted or Random levels for a shooter?

  1. Scripted

    3 vote(s)
  2. Random

    3 vote(s)
  1. andymc

    andymc Well-Known Member Licensed 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.
  2. RandomCoder

    RandomCoder Well-Known Member Licensed 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. ;)
  3. MaFu

    MaFu Well-Known Member Licensed User

    Scripted with a few random parameters!
    wonder and Star-Dust like this.
  4. sorex

    sorex Expert Licensed User

    if you go retro you go predefined (scripted). also random ain't fair as @RandomCoder mentioned when using scoring/highscores.
    inakigarm likes this.
  5. inakigarm

    inakigarm Well-Known Member Licensed User

    Random -> retro feel
  6. sorex

    sorex Expert Licensed 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.
  7. wonder

    wonder Expert Licensed User

    Where's the "procedurally generated" option (a mix of scripted random)? ;)
  8. ilan

    ilan Expert Licensed 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 and wonder like this.
  9. andymc

    andymc Well-Known Member Licensed 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.
  10. andymc

    andymc Well-Known Member Licensed 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:

    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: Nov 21, 2017
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice