In Computer Programming, What is Marshalling?

FLAG is originally a programming instruction, often used in computer languages, such as C or D, often used to record a parameter of a variable. The latter refers to the choices made in the game or film when there are divergent plots, which affects the development of subsequent plots. It comes from programming terms. The original meaning in English is a signal or a banner.

FLAG

(Words for variables in computer programming)

Flag (Chinese name: flag ) is a single-bit size flag used in computer programs to record program status. Flag has only 1 (upright) and 0 (downward) values, which are usually stored in a fixed area in memory. The program changes the value of the flag at the same time that a certain state changes, and understands the state through the flag in other operations and determines the next operation. In other words, flags can be used to help programs make judgments about complex conditions.
This feature of Flag is widely used in games. In almost all games with plots, there are options, and the games that affect the plot have the use of the Flag variable. They can all be said to have Flags and set Flags, such as "The Legend of Jin Yong", "The Legend of Fairy Sword", "Silent" Ridge "" Apocalyptic America "and so on. Note: FLAG plays an important role in almost all computer programming, such as system programming, network programming, software programming, NC programming, etc., and it is often used in computer-related production and life, not just in game programming.
The Pokemon series (and almost all RPG games) makes heavy use of flags.
For example, in the capture of the Pokémon Red / Blue / Emerald Three God Pillars, if the player comes to the inner room of the apocalyptic stone room and investigates the middle stone wall, a braille will be displayed first, and the braille will disappear after pressing the button. A flag (0xE4: whether the gate of the Three Gods Pillars Cave is open). If this flag is erected, the event ends directly. Then a special event is executed to check the monsters carried by the player. If the conditions are not met, the event ends directly; otherwise ( The flag falling down and the monsters they carry meet the conditions) will play the picture of the earthquake, and then display the dialog box "The door opened somewhere in the distance ...", the dialog box disappears after pressing the button, and the 0xE4 flag is raised.
The cave entrance where the god column is located in Watercourse 105 / Road 111 / Road 120 is opened by default. Each time you enter these three maps, the map will first check the flag of 0xE4 when it is loaded. If it falls, the image of the cave entrance where the god column is located in the map will be changed to closed rocks and set as inaccessible; otherwise (Flag stands) Do nothing (open the hole).
For another example, the completion of a task in the Monster Hunter series also uses the flag.
Use Golden Finger to check the memory in the PSP monster hunter game, find the memory address where the task completion flag is stored, and you can see a large number of hexadecimal values. If the player has completed all the tasks, then in this area will see continuous FF (complete 8 consecutive tasks). When a task is completed, the flag corresponding to the task will be erected. The emergence of urgent tasks is determined by reading the flags that must be completed.
In text adventure games, the player determines the value of the flag when choosing an option. When the story divergence point is reached later, the game will decide the next story based on the value of the flag.

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?