How to make a linear story based game?

I’m making a linear story-based zombie game, and I’m confused on the best way to make the actual system for it.

My game has a system where it progresses in “stages.” For example, for stage 1 it can spawn 1-3 normal zombies, and stage 2 it can spawn 1-3 normal zombies and 1 special zombie, etc. The player will not be able to go past a certain part of the map until they finish killing all the zombies in that stage.

The first way I thought about doing this was making an organizational system for each stage in workspace that uses folders with parts in them, then I can continuously loop through them in the game, for example:

Stages (Folder)
    > 1 (Folder)
        > Boundaries (Folder -> Parts)
        > ZombieSpawns (Folder -> Parts)

Boundaries will be the invisible walls that get deleted after that stage is completed. And the ZombieSpawns will be parts with randomized positions that zombies spawn on.

However, since I have certain special events and cutscenes for certain stages, I wouldn’t know how to implement this with that in mind.

I am sorry for any confusion, I can’t explain this well. Thanks!

Hey there!

It sounds like you have a solid foundation and I appreciate the clarity in your approach.

Regarding your organizational system in Workspace, using folders for each stage is a great start. It allows for clear management of elements like boundaries and spawn points. Here’s a suggestion to streamline your implementation:

  1. Stage Management System: Create a dedicated script that handles the state of each stage. This script can control spawning, boundaries, and trigger events. You could use a table to store information about each stage, including the zombies to spawn, boundaries to activate, and associated cutscenes.

    local stages = {
        [1] = { zombies = {"Normal", "Normal", "Normal"}, cutscene = "IntroCutscene" },
        [2] = { zombies = {"Normal", "Normal", "Special"}, cutscene = "StageTwoCutscene" },
        -- Add more stages as needed
    }
    
  2. Event Triggers: Use events to manage transitions between stages. For example, after the player defeats all zombies in a stage, you can trigger a function to delete boundaries and start a cutscene. Utilizing BindableEvents can help maintain organization while keeping your code modular.

  3. Cutscene Integration: For cutscenes, you can set them up as separate modules. When transitioning to a new stage, call the relevant cutscene function before allowing the player to move on. This way, you can keep your gameplay and narrative intertwined smoothly.

  4. Testing and Iteration: As you implement these systems, iteratively test them to ensure that transitions feel seamless and engaging. Adjust spawn timings and event triggers based on player feedback to enhance the experience.

If you have any questions I’ll happy to help.

1 Like