History of Oni modding: Difference between revisions

→‎Finding Dev Mode: expanding on Daodan DLL's history, correcting some Mac language (not sure why the Bink lib wasn't replaced)
m (→‎Bug fixes: -redundancy)
(→‎Finding Dev Mode: expanding on Daodan DLL's history, correcting some Mac language (not sure why the Bink lib wasn't replaced))
Line 62: Line 62:
===Finding Dev Mode===
===Finding Dev Mode===
[[Image:Sfeli Finds Dev Mode.jpg|thumb|225px|right|[[User_talk:SFeLi|SFeLi]] documents his discovery in 2006; in examining the binary, he noticed that the list of cheat codes had a gap in it where one cheat had been deactivated; that code was for Developer Mode. For more history, see [[History of Oni modding/The tale of Dev Mode|The tale of Dev Mode]].]]
[[Image:Sfeli Finds Dev Mode.jpg|thumb|225px|right|[[User_talk:SFeLi|SFeLi]] documents his discovery in 2006; in examining the binary, he noticed that the list of cheat codes had a gap in it where one cheat had been deactivated; that code was for Developer Mode. For more history, see [[History of Oni modding/The tale of Dev Mode|The tale of 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 {{Age|2001|1|28}}<!--Give or take a day....-->-year-old game), as well as the adding of new features.
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.


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 [[Mac beta|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 [[AE:OMNI|PPC game application]] in hex-edit form. Later, these changes were made in source for Feral Interactive's [[AE:FERAL|Mac Intel port]].
The most foolproof method of altering the engine turned out to be replacing a library that Oni loads at runtime. Originally this was done by placing a library next to Oni.exe called vtuneapi.dll, which contained code written by SFeLi that would replace or patch functions in Oni. This library came to be known as the [[Daodan DLL]]. The code for it was ported from assembly language to C by RossyMiles. Eventually the decision was made to instead replace binkw32.dll (the library for playing Oni's intro and outro movies) because it loaded earlier in Oni's launch sequence. The DLL was later developed by Gumby and then Alloc, fixing more bugs (some of which result from modern computers running a {{Age|2001|1|29}}-year-old game), as well as adding new features. The DLL's features and settings are documented on the page for the DLL linked above.
 
Not long after the Daodan DLL was released for Windows Oni, it was discovered that the Mac versions of Oni still had Dev Mode in them, too. Instead of replacing the Bink Carbon Library that came with Mac Oni, the Omni Group port of the game application to Mac OS X was patched directly with a hex editor. 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 [[Mac beta|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 [[AE:OMNI|PPC game application]] in hex-edit form with Neo's assistance. Later, these changes were made in source for Feral Interactive's [[AE:FERAL|Mac Intel port]].


===Bug fixes===
===Bug fixes===