EDIT: I’ve made a more refined post. This one is just for referencing some stats below, otherwise I may be looking to get this one locked.
I’ve been brewing up ideas for a multiplayer-online campaign story game and I’m not too sure of what proper approaches I should be taking as per crafting the main game code.
I’ve seen a couple of multiplayer online games that work close to or exactly how I envision one would; being able to start at specific chapters or the beginning of the game, stopping the game and starting over with a game over and having conditions to be met before the story progresses. The thing is, I’m not too sure how I should approach it all. The ability to loop the game when its over or finished, stopping the game if all players are dead, checking conditions or any of that.
I was wondering if anyone had any tips for how I could approach this best? I know of some methods I could apply (might take a while since I’m not good with making actual games, just assets for a game) but I’m concerned with a couple of factors, such as
- How the code looks
- If players will be kept waiting
- If I can get the game to advance only if conditions are met and with an anchored timeline
- How to end the game if it is finished or a game over is reached, then restart that over
Some examples of multiplayer online campaign games I have encountered before (funny that they’re mostly all zombie games) (I know how some work and some I don’t):
Contamination
Function (direct or from what I observe):
- Uses nested if statements and waits to advance the stages and check if people have died or not
- Waits some seconds before advancing to the next stage
Problems:
- Nested if statements, not a good thing to do
- Game continues advancing until a certain point where it checks the number of players alive; check performed every “chapter” or so
^ Doing it so often means mass nesting and keeping players waiting for a while
- Can’t begin at a specific point of the campaign if I want chapters to save and for them to restart the whole chapter or a part of it upon game over
- To restart the game, an archived game script is cloned, pasted into the workspace and has its disabled property turned off, while the current running script ends all its processes and deletes itself
Reason 4 Life 1
Function (direct or from what I observe):
- Puts while and for loops inside while and for loops for various stages
- Time value counting up; every “benchmark”, game progresses
- Value inside main script called “Running”; determines if the game is up or not
- If running value set to (2?), while loop for progressing the game stops and prompts the “failed” screen
^ Running script in a while loop allows it to be stopped at any time if all players have died and it can reset itself over
Problems:
- Relatively messy with many if statements checking the time of the game and progressing based on that value. Personal nitpick when I want to read the code (no one else will see it)
- Becomes a mess when I want to integrate conditions that must be met before the game progresses as opposed to based on time
- Time anchors the gameplay to a specific timeline and not based on if players can solve puzzles or clear areas of enemies
- Can’t begin at a specific point of the campaign if I want chapters to save and for them to restart the whole chapter or a part of it upon game over
Undead Nation
Function (direct or from what I observe):
- Players select chapters, get teleported to a specific area of the map for that chapter
- Conditions can be met before the game progresses (i.e. zombie boss must be killed before opening an area and announcing that chapter x has begun)
- Gameplay is not anchored to a timeline; depends on how quickly players solve puzzles or clear conditions
- Game ends immediately if all players die as it should
Problems:
- Exploiters
- Poor management of the game can result in misplaced events (clicking a button in Chapter 2 of map while others are in Chapter 1)
^ Results in lots of checks, variables/value objects
- Game advances via ClickDetector MouseClick, Part.Touched, Humanoid.Died, EnemiesInArea(.Value) = 0 (ties in with Humanoid.Died) and other flags
- Prone to becoming messy
Mission, Series! → Campaign Mode(s)
Function (direct or from what I observe):
- Advances story based on time line; dedicates some time to getting the intro moving and such
- Reaching a part of the story, no new dialog is spoken until all enemies are cleared from the area or everyone reaches a certain area
- Game ends immediately if all players die as it should; restarts itself
- Has mostly everything I’m looking for
Problems:
- Can’t begin at a specific point of the campaign if I want chapters to save and for them to restart the whole chapter or a part of it upon game over
Boss Fighting Stages
Function (direct or from what I observe):
- Refer to “Mission, Series!” (since that’s more or less exactly how it works)
Problems:
- Can’t begin at a specific part of a chapter; not important as it can begin the whole chapter again and I can split the game into multiple chapters as an ugly and long workaround
also can we get more campaign games on roblox and not round-based ones plz