History of Oni modding
- This article is a historical perspective on Oni modding; for an introduction to how to actually mod Oni, see here. To download mods, you can start 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 support[1] 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 or tools for modding undeniably slowed the development of mods within the community. Only for the last 13 or 14 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: scripting, binary resources, and the engine itself. 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. Later, they produced more original, often epic fight scripts (e.g. 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
Private knowledge, public results
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, OniTools. 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 count 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 dozens of resource types were inter-related.
This did not stop one intrepid programmer named Pierre Terdiman from deciding to import data from Oni into the game engine that he was writing from scratch. Called Konoko Payne, it is a long-term project which currently takes the form of (1) an underlying engine, and (2) a short scenario for it that resembles a sequel to Oni. In order to extract models and animations from Oni and recreate them precisely in his project, Pierre became one of the early pioneers in "reverse engineering" the game's resources, although his acquired knowledge remained largely private, as his work predated the community's organized public attempts at gathering this information.
Hackers unite
Perhaps the earliest place that knowledge of Oni's data was published online was on Oni Master's site. Then, in the fall of 2004, Ssg started a site on the newly-opened Oni2.net, a domain run by Alloc, carrying over and translating information that Ssg had originally placed on another site in his native German. A year later, this pool of knowledge was painstakingly moved by geyser and Ssg to its current home on the wiki, the Oni Binary Database, to allow collaboration; at this point, Neo appeared on the scene, adding his own knowledge that he had been acquiring independently until then, and collaborating on further investigations into the resource formats. Today at least 95% of the binary resource formats are documented byte for byte thanks to their hard work.
Modding by candlelight
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 released in 2005 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; in 2006 it was replaced by a smarter alternative to supplying whole levels, 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.
Modular modding
The advent of Neo's OniSplit in late 2007 marked a radical improvement to our modding methods. A command-line tool that runs on Windows and Macs, OniSplit breaks Oni's resources into standalone files, making mods truly portable across different retail versions of Oni. These resources can be exported to standard formats as text, images, sounds and 3D models, edited, and recombined into the level data files that Oni expects, and new resources can also be created from scratch. To take advantage of this revolution in modding, geyser began preparing an OniSplit-based port of some of the work done on BIP and ONK, which he hoped would be ready for the seventh anniversary of Oni's release in January 2008.
This so-called "Seventh Anniversary Edition" had major releases in January and July 2008. The project then changed hands to Gumby, who designed a framework and a GUI-based installer that allowed players to selectively install only the modifications that they wanted. Since Oni's seventh anniversary had come and gone, the mod collection was renamed simply the "Anniversary Edition", also known as the "Edition", or the "AE". Released in July 2009, the new AE's framework allowed modders to create their own "packages". These could be stored on the Oni Mod Depot, and if downloaded by the player and placed in a subdirectory of the AE, they would then appear as a choice in the Installer. Another release was made in May 2010 with more bundled mods and an improved framework.
Nothing new took place on this front until 2013, by which time the project had fallen into Iritscen's hands in the absence of geyser and Gumby. At this time, the release of the new AE included a brand-new Installer written by Alloc which could connect to the Mod Depot automatically, offer all mod packages for download, and update the mods and patches already installed. The AE's bundled content was stripped down to only non-controversial fixes for the first time since the release of its grandfather, BIP, in 2005, making all notable game modifications into optional third-party mods.
New content
Certain game resources were easy enough to reverse-engineer that the community was able to mod them almost from the time of Oni's release, such as textual resources and textures. Some game resources, however, were complex and involved multiple data types, such as character models, and, most obviously, levels themselves. These took a number of years to decipher.
OniSplit first gained the ability to import new character models in April 2008[3]. At first, since the focus was on the technical side of things, pre-existing models were used, either by modifying Oni's models, or by finding royalty-free models on web sites and converting them to Oni's 19-bone system. A more dramatic use of the character-importing ability came with the creation of a high-detail Konoko model from scratch in October 2010[4].
A major obstacle with levels was the question of how to generate pathfinding (PF) grids for the AI. Level geometry could be imported fairly easily as of November 2008[5], but AIs could not navigate the level. Manual PF grid creation was first demonstrated with the creation of the Arena level in November 2010[6]. Automatic PF grid generation was introduced to OniSplit around June 2011. More comprehensive demonstrations of the community's level creation abilities came with EdT's level "Muro's Lair" in August 2011[7] and Samer's level "Wilderness Preserve" in January 2014[8].
Engine patching
Finding Dev Mode
Engine patching is needed when modders want to do things the game's scripts and data do not currently allow for, 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 Windows Oni executable directly, but a revolution in this type of modding occurred in 2006 when Developer Mode was finally discovered in retail Oni's code, and a means for unlocking it was needed. The most foolproof method of altering the engine turned out to be replacing 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.
Not long after the 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 Omni Group port to OS X did not seem to have any libraries that could 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 which allowed Macs to run (almost) all scripts written for Windows Oni were "unlocked" by EdT using hex edits. Certain changes made by the Daodan DLL for the Windows version were also carried over to the Mac's PPC game application in hex-edit form. Later, these changes were made in source for Feral Interactive's Mac Intel port.
Bug fixes and beyond
One of the most visible changes to the game that the Daodan DLL (and equivalent hex edits on the Mac side) made possible came about in July '07, when an error in Oni's AI routines was corrected, allowing the AI to dodge incoming fire consistently. Fans had originally expected to see at least basic dodging abilities in the AI, so when Oni was released, they were surprised to see the AI usually run blindly at Konoko while being shot at. With the community's patch in place, previously glitched code now works as intended, allowing the AI to intelligently take cover from gunfire.
The most ambitious use of the Daodan DLL so far has been to add rudimentary multiplayer to Oni in the form of the Flatline project. Work continues in all areas of modding Oni, as well as documenting the modding process.
Footnotes
- ↑ In Harry's interview, Brent Pease, the Project Lead, 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 eventually left the project before its completion. Hardy LeBel, his replacement, 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."
- ↑ Fans 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.
- ↑ See User_talk:Neo/Archive2.
- ↑ OCF thread, "Konoko HD".
- ↑ See User_talk:Neo/Archive5.
- ↑ OCF thread, "Arena Level".
- ↑ OCF thread, "Muro's Lair - Preview".
- ↑ OCF thread, "NEW LEVEL : Chapter 17: Wilderness Preserve - Hasegawa Adventure".