Metroid Learning – The Core

The core script can be metaphorically described as the brain of the AI. It utilizes all the other scripts and is therefore considered the most important element of the project. It is also the most overwhelming, since it consists of over 1100 lines of code (in comparison: the game script boils down to 170 lines). Quite some time ago, I analyzed the functionality of this very script. Today, I want to bring structure into it.

In this blog, I try to structure the code of MarI/O’s core script so that I can salvage re-usable parts and determine the next steps of the project.

Metroid Learning – Player data in the cartridge

An analysis of Super Metroid’s user interface revealed that the AI would perform best when it tried to keep the values of available energy and  ammunition as high as possible at all times. To make the AI focus on these values, it needs to know them. To get to that point, the pointer addresses of these values are needed – in short: more ROM hacking.

In this blog, I will dig into the game cartrigde to find pointers that are needed for the game script.

Metroid Learning – Player Data on the screen

The game.lua script consists of three parts – player, graphic and input data. Input data depends on the console, and needs no major changes in this project. Graphic data depends on the sprite list, which has already been dealt with separatly. Player data is the main focus of this and the next blog – changing this part will require knowledge about the game as well as some hacking. Knowledge in this case means things to look out for when playing – which should always be displayed on the user interface.

In this blog, I will go over the essential elements of the UI of Super Metroid.

Metroid Learning – The structure of the game script

The game.lua script serves the purpose of keeping track of every piece of data in the game that the player can directly affect or interact with. Metaphorically, it can be seen as the screen that the AI looks into as well as the controller that the AI is holding. The next step of this project is to adapt this script from Super Mario World logic to Super Metroid logic – which takes more effort than it seems at first sight.

In this blog, I will explain go over the essentials of the game script (by example of MarI/O).