History of Oni modding
- This article is a historical perspective on Oni modding; for an introduction to how to actually mod Oni, see here.
As has been documented on the page about Oni's overall development, time ran out for Bungie West to do everything they wanted with this very ambitious game. Just as some features had to be omitted, the promise of modding support1 also failed to come true. However, even before Oni fans really knew that there would never be official modding tools from Bungie, they were already eagerly diving into the game data to see how they could mod it.2 Nevertheless, the lack of any documentation of tools for modding undeniably slowed the development of mods within the community. Only for the last 17 years has the community's modding capabilities covered nearly all aspects of the game.
There are three basic areas in which the game can be modded. In order of difficulty they are: scripting, binary resources, and the engine code. Along the way, we'll look at some key discoveries the community made in more detail.
BSL scripting
Since the .bsl files were plain-text, and in plain sight within the folders that held Oni's game data, it's not surprising that fans quickly learned some basic commands by seeing what Bungie had written, and making their own scripts. Further commands were discovered by dumping readable text from the engine, although not everything worked as it seemed it should.
As scripters were learning BSL, they produced scripts that at first merely modified the original level logic in minor ways (e.g. Titan Mode). Later, they produced more original, often epic fight scripts (e.g. "Multiple Mukades" and "OTA"); finally, some ambitious modders scripted totally new objectives and mission layouts (e.g., Mariachi Bear's alternate storyline). However, fully original scripts are all the more prone to bugs. The first two are easier to set up, but extreme situations tend to overload the engine (as in Blam!) in ways that the scripters have trouble preventing.
Testing the scripts required large numbers of attempts in launching Oni and running the scripts to see how they worked. This process became much faster when the Developer Mode console was unlocked (see below) and individual commands could be tested easily. While this is the easiest way to mod Oni, it's also the most limited; partly because of the lack of full documentation for BSL (which this wiki hopes to provide at some point), and partly because scripts are limited to the resources that an original level has to offer.
Binary resources
Fans with some expertise in parsing files with hex editors found that the binary data (i.e., the files ending in .dat and .raw, not to be confused with "binary" as a term for an application) held four-letter codes, indicating the start of each resource within that file. Within a week of the street date for Oni, the community had its first resource modding tool. While the author did not yet know how all the data worked, his program could at least parse it, and allow the modder to more easily edit each resource without having to think in hexadecimal. It also supported user-friendly replacement of texture maps and allowed in-line viewing of the game's 3D models.
There seems to be little evidence that this knowledge was put to use in modding the game resources beyond simple mods such as texture replacements, no doubt due to the lack of a complete understanding of how Oni's 65 resource types were inter-related. As time went on, though, modders increasingly yearned for more control over the game than BSL could afford them. Serious efforts in "hacking" the binary data began, as far as the modern community is concerned, in the fall of 2004 when ssg started a site on the newly-opened oni2.net. A year later, this pool of knowledge was painstakingly moved by geyser and ssg to its current home on the wiki to allow collaboration; at this point, Neo appeared on the scene, adding his own knowledge that he had been acquiring independently until then. Today at least 90% of the binary resources are documented byte for byte thanks to their hard work.
Originally, modders had to alter these binary resources manually with hex editors to adapt them to their scripts. Loser was the first modder to manually edit the game data to go along with his scripting, with a massively reshuffled Warehouse. Loser's Warehouse mod included a global component (modified level0_Final), level-specific binary modifications, and a set of customized scripts that took full advantage of the modified binaries.
Minor binary modding had already occurred before Loser's Warehouse (thus, while compiling the OBD database, ssg had released a version of level0_Final in which all of Konoko's combos were unlocked). Still, it was the Warehouse mod which first showed the "full" potential of binary modding. It inspired a short-lived initiative called the Binary Improvement Project, aimed at providing upgraded binaries for all levels, not just level0_Final and level1_Final. BIP was hindered by large upload/download sizes as well as by the potential legal issues involved in distributing entire files from the game, and was promptly put on standby.
An equally short-lived alternative to supplying whole levels was developed in the form of OniUnPacker-based patches and was termed Oni ni Kanabô. The modder would edit his DAT/RAW files in OUP, and then release a single binary resource patch. This was both bandwidth-efficient and more legal-friendly, but suffered from one major limitation: the indexation of DAT resources and the offsets of RAW data vary a lot across the available versions of Oni. Thus, resources exported with OUP were not truly standalone or portable. Also, OUP still lacked the ability to import new resources alongside existing ones.
The advent of Neo's OniSplit in late 2007 marked a radical improvement. OniSplit breaks Oni's resources into truly standalone and portable modules. These modules can be edited and recombined to create the level data files that Oni reads, but new modules can also be created easily from scratch; image files can be made into texture resources, 3D models into new character modules, etc.
The modified game data contained in .oni files is usually well below any legal standard for copyright violation, but to avoid even distributing these files freely, an alternative is to distribute delta patches; these patches require the existing Oni data files to be present, then modify that data to get it to the final state, thus not actually giving players any original game content they don't own.
OniSplit and delta patches allow the efficient packaging of the comprehensive mod known as the Anniversary Edition, a project currently in beta.
Engine patching
This ultimate form of modding becomes necessary for modders who want to do things the game's code does not currently allow, as well as to fix bugs. Bug fixes were the earliest notable achievement in engine patching, originally performed by a patching application that altered the PC Oni executable directly, but a revolution in this type of modding occurred in 2006 when Developer Mode was finally discovered in Oni's code, and a means for unlocking it was needed. The most foolproof method of altering the engine turned out to be a library that Oni loads at runtime. Now known as the Daodan DLL, this library-as-patch can alter many aspects of Oni's behavior. This allows the fixing of bugs (some of which result from new computers running a 23 year old game), as well as the adding of new features, and is a massive help for modders using Windows.
Not long after Daodan DLL was released for Windows, it was discovered that the Mac versions of Oni still had Dev Mode in them, too. Unlike Windows, the Mac version does not seem to have any libraries that can be exploited for runtime patching, so the changes were simply made with a hex editor, directly modifying the executable. In the fall of 2008, it was discovered that numerous BSL functions and variables that were thought to be removed from Oni for the Mac before release were still present in the code, and the ones that were needed to allow Macs to run (almost) all scripts written for the PC version were also "unlocked" by EdT using hex edits. This patched executable is freely downloadable in its altered form, which also corrects various age-related bugs and makes some improvements to the game that mirror what the Daodan DLL does for the Windows version.
Work continues in all areas of modding Oni. You can add to the effort by looking at Modding brainstorming and seeing if you have any skills that can help us out. Even if you don't know how to make something possible, your ideas are welcome!
1In Harry's interview with Brent Pease, who was the project coordinator at the time, Pease said: "what we will do is, I'm about 90 percent sure of this, is give away the file format." He also promises with equal certainty that the tools for converting 3D Studio Max models into Oni models will be given away. Pease would later leave the project before its completion. Hardy LeBel, essentially his replacement as Project Lead, would later say that, due to the time crunch, "our primary focus had to be on completing the content and features of the game rather than building in support for the mod community."
2Fans wasted no time in dumping the readable text from the executable and trying to figure out how to enable Developer Mode, as this thread from before the game's official release date attests. Little did they know it would take another five years before this particular goal would be reached.