Programming logic error: Difference between revisions

From Glitch City Wiki
Jump to navigation Jump to search
Content added Content deleted
>Torchickens
No edit summary
>Bbbbbbbbba
(Since English-speaking people aren't using the word "bug" anyway, may as well change to a more accurate definition.)
Line 1: Line 1:
A '''programming logic error''' or '''bug''' (however, 'bug' may also be used to refer to a [[glitch]] in a wider context) in terms of video games is a programming blunder in the game code that prevents the game from doing what it was supposed to do.
A '''programming logic error''' or '''bug''' in terms of video games is a programming blunder in the game code that prevents the game from doing what it was supposed to do (i.e. the '''intended behavior''' by the developers). The word "bug" is widely used in the context of programming in general, but not used as much in the context of the Pokémon series, partly due to the possible confusion with the [[bp:Bug (type)|Pokémon type]].


In many cases, when a bug is initially "found", it isn't actually located in the game code. Instead, what is actually found is a series of steps that allow reliable reproduction of an unintended behavior (i.e. a [[natural glitch]]), which indicates that at least one bug must be triggered during the steps. In the absence of knowledge regarding the actual underlying bug, the entire procedure may be referred to as a "bug"; however, this is inaccurate, and might be changed when the underlying bug is pinpointed.
An example is the [[Coin Case glitch]] in English versions of {{GS}}, where an improper terminator character causes the game program to jump to memory address E112 in echo RAM.


Note that sometimes a bug can manifest in different enough ways, such that they are considered multiple natural glitches. For example, [[2x2 block encounter glitches|the same bug in the wild encounter checking code]] causes both the [[Viridian Forest no encounter grass tiles glitch]] and the [[left-facing shore tile glitch]] (including its more well-known variant, the [[old man glitch]]).
Another example is the [[Focus Energy glitch]] in {{RBY}}, which effectively quarters the player's chances of getting a critical hit, but was changed to increase the chances of a critical hit in other games, such as {{Stadium}} and {{GSC}}.

==Ambiguity==
Sometimes, it can be difficult to infer the actual intended behavior by the developers. For example, in {{RBY}}, the [[Focus Energy glitch]] causes the critical hit rate of a Pokémon that has used Focus Energy to be <code>BaseSpeed / 2048</code>, lower than the unmodified value <code>BaseSpeed / 512</code>. This is most likely unintended behavior, because the move Focus Energy increases the critical hit rate in all other games. However, it is unclear whether the intended critical hit rates are:
* <code>BaseSpeed / 512</code> without Focus Energy, and <code>BaseSpeed / 128</code> with Focus Energy;
* <code>BaseSpeed / 2048</code> without Focus Energy, and <code>BaseSpeed / 512</code> with Focus Energy.
In the former case, the bug affects damaging moves used under the effect of Focus Energy; in the latter case, the bug affects ''all'' damaging moves used. The situation is further complicated by {{Stadium}} (which is usually a good indication of intended battle mechanics in Generation I) using a completely different critical hit rate formula instead.

As such, the exact scope of bugs, or even whether an unintuitive behavior is a bug, may not be completely clear-cut. Sometimes community consensus may be needed to decide on those points.


==External links==
==External links==
*[[wikipedia:Software bug|Software bug]] on Wikipedia
*[http://msdn.microsoft.com/en-us/library/s9ek7a19(v=vs.90).aspx Microsoft - three types of programming errors].
[[Category:Terminology]]
[[Category:Terminology]]

Revision as of 02:53, 20 September 2019

A programming logic error or bug in terms of video games is a programming blunder in the game code that prevents the game from doing what it was supposed to do (i.e. the intended behavior by the developers). The word "bug" is widely used in the context of programming in general, but not used as much in the context of the Pokémon series, partly due to the possible confusion with the Pokémon type.

In many cases, when a bug is initially "found", it isn't actually located in the game code. Instead, what is actually found is a series of steps that allow reliable reproduction of an unintended behavior (i.e. a natural glitch), which indicates that at least one bug must be triggered during the steps. In the absence of knowledge regarding the actual underlying bug, the entire procedure may be referred to as a "bug"; however, this is inaccurate, and might be changed when the underlying bug is pinpointed.

Note that sometimes a bug can manifest in different enough ways, such that they are considered multiple natural glitches. For example, the same bug in the wild encounter checking code causes both the Viridian Forest no encounter grass tiles glitch and the left-facing shore tile glitch (including its more well-known variant, the old man glitch).

Ambiguity

Sometimes, it can be difficult to infer the actual intended behavior by the developers. For example, in Pokémon Red, Blue, and Yellow, the Focus Energy glitch causes the critical hit rate of a Pokémon that has used Focus Energy to be BaseSpeed / 2048, lower than the unmodified value BaseSpeed / 512. This is most likely unintended behavior, because the move Focus Energy increases the critical hit rate in all other games. However, it is unclear whether the intended critical hit rates are:

  • BaseSpeed / 512 without Focus Energy, and BaseSpeed / 128 with Focus Energy;
  • BaseSpeed / 2048 without Focus Energy, and BaseSpeed / 512 with Focus Energy.

In the former case, the bug affects damaging moves used under the effect of Focus Energy; in the latter case, the bug affects all damaging moves used. The situation is further complicated by Pokémon Stadium (which is usually a good indication of intended battle mechanics in Generation I) using a completely different critical hit rate formula instead.

As such, the exact scope of bugs, or even whether an unintuitive behavior is a bug, may not be completely clear-cut. Sometimes community consensus may be needed to decide on those points.

External links