Megalo: Introduction to Megalo & RVT

  • Views Views: 385
  • Last updated Last updated:

  • This article is part of a series on


    Introduction to Megalo & RVTCoding in RVT

    Common Practices • Optimization

    Common Practices • Optimization

    Megalo is a gametype coding/scripting language that has been used for Halo gametypes since Halo Reach. This page primarily deals with Reach-Megalo and the tools used to script Reach gametypes, since the versions of Megalo for Halo 4 and Halo 2 Anniversary are different in some ways.

    MegaloEdit vs ReachVariantTool

    MegaloEdit is the officially supported tool for scripting Halo Reach gametypes, which became available in September 2022. The ReachVariantTool (RVT) is a tool created by a member of the community, and is not officially supported, but it has been out since 2020. So the question is, which tool should be used; and for most purposes, that answer is RVT.

    Differences between Tools

    RVT has many differences from MegaloEdit. It features a custom UI, and a custom coding language, both of which are meant to make it easier to use for editing gametypes. MegaloEdit features a more basic UI, akin to what you'd expect in a typical coding tool. It's very important to note this difference; RVT was designed to be a gametyping tool, while MegaloEdit was designed to be a coding tool. This makes RVT easier to get started with, especially for those who are not accustomed to coding. RVT's custom UI makes it easy to change even scripted features such as the string table, HUD widget locations, and scripted traits. The widgets section even comes with a helpful graphic that shows the HUD with the widget in whichever place is chosen.

    However, MegaloEdit does have some advantages over RVT. For one, the coding language is Megalo itself, so for now, MegaloEdit gives valuable practice in using the language for when the Halo 4 and Halo 2 Anniversary versions of the tool come out. While they aren't the same as Reach-Megalo, the bedrock of the language is the same. MegaloEdit also features a help tab with many convenient lists, though this is mostly useful for those who are already familiar with it. Regardless, because it's the official tool, the lists are almost guaranteed to be complete and correct. The tool can also import .mglo files into other files, meaning that a single .mglo file (raw Megalo code) can have the code for a specific feature, and that code can be implemented into many gametypes with ease. Compare this to RVT, where you have to copy-paste code into each gametype manually. Since MegaloEdit is the officially supported tool, playing custom games in MCC Reach gives you the option to update your gametype ingame by injecting a .mglo file, which can be created from MegaloEdit. RVT does not let you save .mglo files, but players are able to store gametypes in the built-in gametypes folder for Halo Reach, which will refresh when exiting a match, or when going into the main menu and back.

    MegaloEdit Restrictions

    Even with these advantages, RVT is still the superior tool for most purposes. One huge disadvantage of MegaloEdit is the inability to decompile or compile gametypes directly. MegaloEdit saves code as basic text files, and will only compile (Build) when connected to MCC, with no option to decompile at all. By comparison, RVT supports both compiling and decompiling in the tool alone. The reason for this discrepancy is simple; the developers never had a reason to decompile a gametype, because they always have the source code, and that source code is fully commented and well organized and formatted, which is lost after compiling and decompiling. As such, the developers only did as much work as necessary on MegaloEdit so it could function for them. MegaloEdit was not designed for users to edit existing gametypes. By comparison, RVT was designed exactly for this purpose.

    MegaloEdit has some restrictions in what can be done with the language when compared to what RVT allows with its language (Bolt). One of the biggest differences is that RVT allows the execution of all actions directly for clients ("on local"), even if it's not supposed to. MegaloEdit, being the official tool, will prevent users from executing certain actions for clients. The most prominent example of this is with the scale action. MegaloEdit only allows scaling on the host side, and any scale above 1000% will appear to be 1000% for the clients. Scaling directly for clients "on local" will allow them to see scaling above 1000%, but Megalo is not supposed to do this.

    MegaloEdit also does not support functions, despite the Megalo language understanding them. Functions are basically user-defined blocks of code that can be referenced elsewhere in the script, which allows for the same block of code to be used multiple times without having to copy it each time. Bolt does support functions, and since functions can be used to optimize space, some user-made gametypes cannot be opened with MegaloEdit due to their heavy use of functions. It's worth noting that MegaloEdit's import feature mentioned above can serve a similar purpose to functions in some cases. However, functions are good for repeating the same code in a single gametype, while the import feature is best used when adding the same code to multiple gametypes.

    Overview of RVT

    RVT is a very simple tool to use, featuring a custom UI that tries to mirror the ingame settings. You can open an existing gametype, or create a new, blank gametype. RVT supports opening and creating gametypes using the standard multiplayer container, the firefight container, and the forge container. The unused campaign container is not supported, despite there being a campaign variant in the built-in gametypes. When opening an existing gametype, RVT can auto-detect a directory to open from based on the setting in the options menu (located under tools). RVT can accurately auto-detect the local saved files folder, built in game variants folder, and the matchmaking "hopper" game variants folder; you can also set a custom directory.

    • RVT when first opening the tool RVT when first opening the tool
    • Options for file directory, theme, etc Options for file directory, theme, etc
    • General Gametype Options General Gametype Options

    When going into the "tools" section of a multiplayer (or forge) gametype, you have the option to edit the script. This opens up a number of settings where the user can manage different aspects of the script. These include scripted options, the string table, forge labels, map permissions, and other settings. At the very bottom is the gametype code setting itself, which is a more typical coding window, featuring compile/decompile buttons, a console that gives off warnings/errors when compiling, and the window itself for coding. However, most gametype coders would recommend opening an external text editor that supports the Lua language, such as Notepad++, and saving a "source code copy" of the code. It's much easier to edit the code this way too, and you can simply copy-paste it into RVT's coding window. RVT decomplies gametypes into its own coding language called Bolt. Bolt is different enough from Megalo to warrant its own pages and documentation. Documentation for RVT and Bolt can be found at David J. Cobb's Github.

    • The string table The string table
    • The HUD Widget Window The HUD Widget Window
    • The script coding window The script coding window

    Bolt Language

    As mentioned above, Bolt is derived from Lua, making it an easier langauge to learn. The reason for this is simple; you can read basic code line-by-line and roughly understand what it does, even if you have no coding experience. There are nuances to this concept, of course, but as you learn the basics of the language, it becomes easier to read more complex code and figure out what it does. Bolt is also a higher level language than Megalo itself, which means that certain conventions are done automatically, either by the way the language is written, or during compilation.

    As mentioned above, documentation on the Bolt language (though it's not officially called that) can be found on David J. Cobb's Github. Addtiionally, it's included when you download RVT as a set of local HTML files. Both of these are accessible in the tool via the help tab. The Bolt Language is further covered in its own wiki page here.