PDA

View Full Version : What are "flags" in videogame? (May just RPGs I'm not sure).



MJN SEIFER
11-06-2010, 02:42 AM
I've heard the term "flag" get used in Videogames, so far only in RPGs like the Final Fantasy games (actually on the FF games, but I assume it's on others, so I'm asking on General Gaming).

I often see it in Debug Menus such as "Resset all Flags". Anyone know what they are?

Mirage
11-06-2010, 03:02 AM
Maybe variables :(

like "player done with x cutscene"

Jessweeee♪
11-06-2010, 03:03 AM
Uhhhh think of it as kind of like a checklist.

Like say, when you view that first Jecht sphere in FFX. Before then you can't find any, but after Auron shows you the first one the game raises it's "okay Jecht spheres should be available" flag, and they're all in their respective locations.

That's my own very basic understanding of it anyway.

Roto13
11-06-2010, 03:04 AM
^^ Yeah, pretty much. Like a flag will tell the game whether the player has opened a specific chest or not.

Wolf Kanno
11-06-2010, 07:44 PM
What Jessweee said but it also does things like... say for example:

You enter a village and a cutscene where the elder runs up to you and screams about the monster attacking, this a is a flag that is raised that tells the program that when you enter the village this cutscene has to play. There is another flag that goes up as well that tells the program not to play the scene again after it has played so that way, whenever you enter the village again the same cutscene doesn't play cause you've already beaten that scenario. This I learned the hard way with RPG Maker...

Mirage
11-09-2010, 04:25 AM
also if you want to do a quest that has a prerequisite, flags will be used to keep track of whether or not you have the right prerequisites.

key items are more or less flags that are visible to the player

if you did a "reset all flags" in FF7 while on disc 3, and then walked back into the church in midgar where you met aeris, you might get the CSes from disc 1 and sort of restart the storyline from that point.

Skyblade
11-14-2010, 05:21 AM
A flag is a simple switch in programming. The most basic are binary, either on or off, and they get flipped when the fitting bit of code is triggered by in-game progress. They can be used to mark or differentiate almost anything.

An Event Flag marks an event in progress. For example, the pre-expansion events going on in World of Warcraft right now are being controlled by an event flag. To start the event, a simple toggle is activated in the server, which is why we don't need a patch for each new update.

A Statistic Flag is used to keep track of most binary stats. For example, in Pokemon, there is a flag that determines whether a Pokemon is shiny or not (though, oddly, there is no flag for gender in that game, male/female is handled in a more complicated fashion). These can also be used as IFFs.

A Completion Flag is used to determine when something has been done. Loot a chest, complete a quest, and it flips a flag, preventing you from doing it over and over and over again.

These are the simplest forms. But not all are binary. Mass Effect's decisions, for example, are tracked with flags, but many have multiple possible solutions.


Flags are a common tool because they are incredibly useful for programmers and debuggers. They can be used to isolate errors, and track a great deal of variables throughout the game. They are also extremely simple, allowing compact storage and access of complex data. Rather than keeping track of everything throughout the entire game, you can just keep track of a few flags.