Software Engineering in Age of Mythology

Age of Mythology (also known as AoM), is a mythology-based real-time strategy computer game produced by Ensemble Studios and distributed by Microsoft Game Studios. In general, it involves managing resources and fighting, a structure very similar to the Age of Empires franchise. But then, where does Software Engineering come in?

Software Engineering is an area of ​​engineering and computing focused on the specification, development, maintenance and creation of software, with the application of technologies and project management practices and other disciplines, aiming at organization, productivity and quality. One of the fronts in this area is the software test, which seeks to provide information about its quality in relation to the context in which it must operate, is related to the concept of verification and validation. This includes the process of using the product to find its defects. In this sense, we go to the following narrative:

I was playing while waiting for my civilization to advance from the Heroic Age to the Mythic Age, evolution brought a cost to civilization (1000 food points and 1000 gold points) which was paid beforehand at the beginning of the process.

Almost to evolution, I regretted a decision and ran to interrupt it, but it was too late, its progress was at 100%, even so I clicked to interrupt and then my civilization evolved into the Mythological Age, and I received the reversal of evolution (action that occurs when you interrupt it).

In the confusion of the match I noticed that my food and gold points increased by 1000 each, but it was not possible to reflect on it much (we were literally in the middle of a war).

After the end of the game I went to reflect on what happened, now thinking about how the system was programmed (this is where Software Engineering comes in):

  1. When you post to evolve, the game code must subtract from your resources the cost of evolution (in this case 1000 food points and 1000 gold points), and keep in a “box” until the evolution is finished;
  2. If at any time you interrupt the evolution, that cash value goes back to you;
  3. However, after the evolution is completed, this cash value is discarded;
  4. Although this should happen along with the evolution, who programmed the code may have created a kind of trigger, which after completing the evolution, sends a message advising to remove the option to cancel the evolution and to eliminate the value in “cash”;
  5. Thus, the trigger for this message would only occur after the evolution, this means that the evolution happens first, to then prevent it from being interrupted and the value reversed;
  6. So, if in the interval between the evolution and the sending of the message to cancel the possibility of interrupting the evolution, you activate the interruption of the evolution, then the game will interrupt something that has already occurred and return you the amount that was in the box.

Of course, that until then was my theory based on how I imagined that mistake occurred. Time to test:

My civilization created in a controlled environment, currently in the Heroic Age with 1584 food points and 1062 gold points.
Evolution process to the Mythic Age at 99% completion, my civilization has 584 food points and 62 gold points.
When the evolution of civilization is not interrupted in the interval of messages from the source code.
When the evolution of civilization is interrupted in the interval of the messages of the source code.

I tested it on several evolutions too, and in fact the system seems to work with this trigger, allowing the bug to occur. Although, interrupting the evolution in this interval is very difficult, because even in a controlled environment, I managed to perform the bug more or less once every ten attempts. That is, in terms of the game this bug is unfeasible to use and even harmful to those who try, and may take more time (canceling the evolution before it actually occurs) or not yielding any benefit (canceling the evolution after the value of box be discarded).

In Software Engineering, we see some techniques to “swing” a program in an attempt to have it present some bugs at points considered critical for those who programmed. In the case of Age of Mythology, this bug was found in the communication time between two parts of the source code.

Cover Image Credits to Free-Photos from Pixabay

Deixe um comentário

O seu endereço de e-mail não será publicado.

Skip to content