• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
mypel16000

Adding a storyline

9 posts in this topic

Hi there,

 

I am developing a 2D top-down post-apocalyptic shooter and would like there to be a storyline. I have no experience with this and have no clue how to do it...

 

I would like there to be a primary storyline and then some secondary missions, but how do I keep track of where the player is in the story. What functions do I have to add to my code...? Should I have a different class for the storyline and have a bunch of IFs to see if the player meets the required standards to start the mission? and an int for the mission he is currently in?

0

Share this post


Link to post
Share on other sites

Sounds like you need to think of some sort of quest system, and mark some of them as [Story] Quests. this will allow you to have requirments too, so you cant do quest B untill Quest A has been completed, or Quest C requires Quest B to have been completed using The Good Choice. etc.

0

Share this post


Link to post
Share on other sites

How about you spend some time thinking about it what i said?

 

 

Sounds like you need to think of some sort of quest system

 

ok, Quest class.

 

mark some of them as [Story] Quests

 

Ok, lets have a field IsStoryMission;

 

this will allow you to have requirments too

 

ok, so lets store some Quest Pointers vector<Quest*> _Requirements;

 

boom, quest system started.

was that hard? did it hurt your brain to read my post?

 

Ok, lets go deeper, well a quest is given by an NPC or some sort, ok, well lets give that NPC a Pointer to a quest object. Oh, wow, That was hard to think of wasnt it?

How does my NPC give that to the player?

Well,

void SomeFunctionCalledWhenPlayerTalksToNPC()
{
     if(NPCQuest->RequirmentsMet(this)
          this->CurrentQuest = Quest;
}

bool RequirmentsMet(Player *player)
{
     return player->HasCompletedQuest(MyRequiredQuest);
}

hmmm well thats about as far as I can go without having access to your code, and look. that took me 10m to figure out.

0

Share this post


Link to post
Share on other sites

A story is a sequence of events happening in the view (to be understood in a wider sense) of the player. To ensure that the player notices the events, they are usually not running detached but being enabled by requirements on the world state, and perhaps being triggered by the player. During happening and at its end, an event often alters the world state, so being able to enable or disable other (not yet happened) events. This way a sequence or even branches can be defined.

 

The world state is the entirety of variables describing, err, the state in which the game world is. E.g. a boolean flag for the life/death of an opponent belonging to the story, a counter for how often the player has hit a target, a flag whether or not a specific NPC has told the player about the hidden secret, ... whatever.

 
Events are enabled when their requirements on the world state are satisfied. E.g. if the flag meaning "opponent A is shot to death" is cleared and the counter for "rings of the bell" has reached 12 and the flag for "colliding with the proximity volume close to opponent A" is set, then let opponent A throw an offense against the player.
 

Triggers can be any action a player is able to perform. Colliding with a collision volume can be used as a location based trigger, or the death by shot of an NPC can be a trigger. On the other hand, the expiration of a timer can be a trigger, too, e.g. allowing for deferred events. Triggers can be implemented as a mechanism which alters the world state.

 

The player usually needs be hinted at how to trigger enabled events, or else s/he may not realize what to do next. How to do this depends on the type and style of the game. Briefings, books, journals, gossip, talks, ... by NPCs, a companion, the HUD, ... and so on. This can also be implemented as events in the way described above.

 

There isn't necessarily the need to explicitly track the current chapter in the story. The world state already reflects this.

1

Share this post


Link to post
Share on other sites

@andy474: I think you are forgetting that this forum is the "for begginers forum". Yes it is hard to interpret such a poorly elaborated answer.

 

@Bcullis: I know, I'ts just that I'm making the framework of my game still as my graphic designer hasn't caught up to me. I can't carry on the basics and I don't have a map yet. I'll try some methods, but I was just asking if there was a good accepted method to do this. Thanks for the advice though :)

 

@haegarr: Very good explanation, it kind of gives me an idea of what I need to implement into my game. I ill start having a class "World" with all these flags and simply have another class for the storyline that takes in a reference to the world and has a series of if statements an an int to keep track of the mission the player's in. Kind of like:

 

- IF( mission == 4 && 6700 < playerX > 6650 && 8700 < playerY > 8650 && playerAbilityConversation > 50) bla bla bla

You think thats OK?

0

Share this post


Link to post
Share on other sites

but I was just asking if there was a good accepted method to do this

There's a difference between implementing someone else's design, and designing something yourself.  The former still relies on programming ability, but the latter is where you will really GROW as a programmer.  This is why a lot of "where do I begin" guides give people a suggested progression of certain game types, with the caveat that you should try and make it work yourself before looking at other people's solutions.  Project Euler does this brilliantly: you can't see the solutions thread until you post a correct answer.  And man can those be enlightening.

 

Also:

IF( mission == 4 && 6700 < playerX > 6650 && 8700 < playerY > 8650 && playerAbilityConversation > 50) bla bla bla

I don't think the emphasized conditionals will work like you expect.  You need explicit comparisons, as otherwise you'll end up trying to determine if "6700 is less than true".

2

Share this post


Link to post
Share on other sites

There are few problems in programming that can be solved with one standard answer. Programming is all about solving problems, and the solutions vary from problem to problem. Implementing story into your game is really probably one of the easier things to do. There is little advanced math or logic, the main issue is not really the implementation of your ideas, but coming up with what you want your story to be about. How in depth you want to go into story telling is up to you, and there are many different ways to go about it, which is why it is hard to pin point a logical standard solution.

Here are some examples that I can come up with for story implementations, just to get your mental juices flowing about how you may want to go about this:

 

Your story is about a zombie survivor out in the woods alone, moving from abandoned cabin to cabin, scrounging for food and ammunition. The zombies could strike at any minute, so you must work fast to be ready for an attack.

 

How do you do this in programming? Perhaps you have a list of the cabins(probably stored in an array, list, or in some sort of "level file"). The game interprets this data and virtually assembles the level around you. When you walk in the houses and you collect the items, it would remove from the inventory of the house in you "level file". Everything stored has an X and Y position and in your class that handles rendering it would recognize data from the file and interpret that to draw the objects in the house.

 

Perhaps if you want a story with less player determination, you could play a short animation at the beginning of the game that shows them their fate of eternal zombie battle unless they find the mad scientist that is controlling the minds of the poor undead. You could pick up clues scattered around the game that when touched, would pause your main loop and display an image file associated with that clue. Throughout the game, the player may have to make decisions that will either lead them to the scientist, or keep them battling the zombies. At the end of each "level" of battle, the decision would have to made (either physically in game or maybe in a GUI or something...) and the decision would either put them off track on  some random level or bring them closer to the mad scientists lair. Think about how the levels are connected as a tree or a web, not the normal sequential approach.

 

I'm not expecting you to use either one of these stories, but I hope that gives some idea of how you might plan about things.

For both of these implementations, or anything you come up with, your going to want to use Object Oriented Programming(OOP).

This answer is probably more of the story writing side of things than the technical examples than you wanted, but in reality, it's important to think about what you want something to be, before you're already half way done with it and just sloppily piecing other people's code snips together. What you really need is not a technical answer from us, but a good cup of you favourite warm beverage, a lot of paper and pens, and some time to think about each system in your game, what it does, and how it interacts with the other systems to form a nice, well organized piece of computer art.

 

As my 8th grade wood shop teacher always said: "Proper planning prevents poor projects".

2

Share this post


Link to post
Share on other sites

@haegarr: Very good explanation, it kind of gives me an idea of what I need to implement into my game. I ill start having a class "World" with all these flags and simply have another class for the storyline that takes in a reference to the world and has a series of if statements an an int to keep track of the mission the player's in. Kind of like:
 
- IF( mission == 4 && 6700 < playerX > 6650 && 8700 < playerY > 8650 && playerAbilityConversation > 50) bla bla bla

You think thats OK?

That is a question of experience and of personal preference. Although it is a valid way (until reaching some complexity), I would not implement it that way. I prefer a data driven way with concentrated responsibility (a.k.a. sub-systems, or "services" as they are generally called in my engine).

 

A way in-between would be where the individual events of the story are stored each one into an own object. The (base) class of that objects would support handling the requirements (probably data driven), and the effects of the event onto the world state (probably data driven, too). They could be separated, combined, or shared in different structures where meaningful (e.g. list of past events, list of running events, list of deferred/pending events, lists of listeners, a spatial structure when depending on locations, ...).

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0