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 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. Nevertheless, the lack of any documentation or tools for modding undeniably slowed the development of mods within the community. Only for the last 6 years has the community's modding capabilities covered nearly all aspects of the 16-year-old 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.
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. Then they produced more original, often epic fight scripts; later, some ambitious modders scripted totally new objectives and mission layouts (e.g., Mariachi Bear's alternate storyline). Some of the most complex scripts are the OTA scripts which were eventually developed to make up for a lack of multiplayer gameplay. 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.
Private knowledge, public results
Fans with some expertise in parsing files with hex editors found that the level data files 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 was a long-term project which took 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.
Perhaps the first place that knowledge of Oni's data was published online was on Oni Master's site, which started as early as 2003 and was based on the knowledge that had gone into OniTools. Then, in 2005, Ssg opened a site with a much more thorough examination of the game data (the site is now hosted at http://ssg.oni2.net). Later that year, this pool of knowledge was painstakingly moved by geyser and Ssg to its current home on the newly-opened wiki, OniGalore. The purpose of creating the Oni Binary Database was to allow collaboration, and soon 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.
- Further reading: History of the Oni community (2005).
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 and offsets of 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 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 "Seventh Anniversary Edition" had major releases in January and July 2008. The tradition continued of using a central modding project to organize a general revision of Oni's content, as seen on pages like AE:Ninja. 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, then downloaded by the player and placed in a certain folder in order to see them 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 due to the retirement 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, 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, making all notable game modifications into optional third-party mods, and ceasing any attempt at centralized game data improvement.
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. 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.
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, but AIs could not navigate the level. Manual PF grid creation was first demonstrated with the creation of the Arena level in November 2010. 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 and Samer's level "Wilderness Preserve" in January 2014.
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 modern computers running a 16-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 Mac OS X (now known as "macOS") 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.
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 more consistently. Fans had originally been surprised to see the AI often run blindly into projectiles while being shot at. With the community's patch in place, previously glitched code now works as intended, allowing the AI to dodge projectiles by taking cover, as Bungie West intended.
The most ambitious use of engine patching has been to fill in for Oni's missing multiplayer mode. This is done in Windows through the Daodan DLL in the form of the Flatline project, and in macOS, the Zukai project operates on a Mac equivalent of the Daodan DLL.
Work continues in all areas of modding Oni, as well as documenting the modding process.
- ↑ 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".