Jump to content

Daodan DLL: Difference between revisions

872 bytes added ,  11 October 2023
finally documented the locale feature, thanks to a combined effort on Discord to figure out how the heck it works; various other wording tweaks
m (link fix)
(finally documented the locale feature, thanks to a combined effort on Discord to figure out how the heck it works; various other wording tweaks)
Line 1: Line 1:
{{Hatnote|This is about a Windows-only patch for the game engine. For the entity within the game's story, see [[Daodan]]. For information on the patches to Mac versions of Oni and historical patching of Windows Oni, see the [[:Category:Patches|Patches category]]. Also see [[OniX]], a rebuild of the Oni application for modern Windows systems.}}
{{Hatnote|This is about a Windows-only patch for the game engine. For the entity within the game's story, see [[Daodan]]. For information on the patches to Mac versions of Oni and historical patching of Windows Oni, see the [[:Category:Patches|Patches category]]. Also see [[OniX]], a rebuild of the Oni application for modern Windows systems.}}
The '''Daodan DLL''' is a patch for Oni for Windows that hooks into the game engine to fix bugs and add features. It does this by posing as '''binkw32.dll''', the library that Oni loads so that it can play the game's opening and ending videos. The Daodan fixes issues such as the famous "[[Blam|Blam!]]" error that occurs on modern machines. It also adds new features such as support for widescreen resolutions and bonus cheat codes. The Daodan DLL was created by [[User:SFeLi|SFeLi]] and then developed further by [[User:Admin|Alloc]], [[User:Gumby|Gumby]] and [[User:RossyMiles|RossyMiles]].
The '''Daodan DLL''' is a patch for Oni for Windows that hooks into the game engine to fix bugs and add features. It does this by posing as '''binkw32.dll''', the library that Oni loads so that it can play the game's opening and ending videos. The Daodan fixes issues such as the famous "[[Blam|Blam!]]" error that occurs on modern machines. It also adds new features such as support for widescreen resolutions and bonus cheat codes. The Daodan DLL was created by [[User:SFeLi|SFeLi]] and then developed further by [[User:RossyMiles|RossyMiles]], [[User:Gumby|Gumby]] and [[User:Admin|Alloc]].
:''Subpages:'' [[/Change_log|Change log]]
:''Subpages:'' [[/Change_log|Change log]]
{{TOCfloat}}
{{TOCfloat}}


Note that you '''already have this installed''' if you installed the [[Anniversary Edition]].
Note that you '''already have the Daodan DLL installed''' if you installed the [[Anniversary Edition]].


===Manual installation instructions===
===Manual installation instructions===
Line 23: Line 23:
5. Try both the run_full and run_wind scripts.
5. Try both the run_full and run_wind scripts.


You can report problems on the forum in [http://oni.bungie.org/forum/viewtopic.php?id=1686 this thread] or in a new thread in the Modifications forum.
You can report problems with the Daodan DLL on [[Discord|our Discord server]].


===Feature summary===
===Feature summary===
*Windows XP patch - Fixed Oni crashing at startup on modern computers.
*Buffer overflow patch – Fixes Oni crashing at startup on modern computers.
*Windowed mode - Oni can run inside a window properly.
*Windowed mode Oni can run inside a window properly.
*Custom screen resolutions - Includes many more default screen resolutions.
*Custom screen resolutions Includes many more possible screen resolutions.
*BGRA32 (ARGB8888) support.
*BGRA32 (ARGB8888) texture support.
*Extra cheats - see "Added cheat codes" section below.
*Extra cheats – See "Added cheat codes" section below.
*Cheats always enabled; no need to beat game first.
*Cheats always enabled – No need to beat game first.
*Extra command line options (for advanced users) - For a list, type "Oni -help".
*Extra command-line options (for advanced users) For a list, type "Oni -help".
*A new input system based on Raw Input, which should fix mouse lag and judder, as well as disabling mouse acceleration.
*A new input system based on Raw Input, which should fix mouse lag and judder, as well as disabling mouse acceleration.
*AIs have ability to properly dodge projectiles.
*AIs have ability to properly dodge projectiles.
*Stops fly-in character portraits from being stretched when playing in widescreen.
*Stops fly-in character portraits from being stretched when playing in widescreen resolutions.
*Enables [[Developer Mode]] – Enter the Data Comlink (F1) and type "thedayismine" or simply 'x' to activate it.


===Developer Mode===
===Languages===
The DLL enables [[Developer Mode]]; enter the Data Comlink (F1) and type "thedayismine" or simply 'x' to activate it.
The Daodan DLL offers support for the Chinese version of the game as well as multibyte languages in general (see "multibyte" under "Patches" section). It also adds some basic localization support by allowing cheat code names and two hardcoded strings in Oni to be translated.


===Languages===
The Daodan DLL offers support for the Chinese version of the game as well as multibyte languages in general (see "multibyte" under "Patches" section). It also has the beginnings of some basic localization support, by allowing cheat code names and other strings to be translated. To add an option, look for the options section or type
[Language]
To enable Chinese support, type:
To enable Chinese support, type:
  [Language]
  [language]
  Chinese = True
  Chinese = True
This will load a DLL called xfhsm_oni.dll (apparently provided with Chinese copies of Oni).
This will load a DLL called xfhsm_oni.dll (provided with a Chinese copy of Oni in order to load the Chinese font that also comes with it).


Here are the strings that you can replace using the .ini file:
Here are the strings that you can replace using the .ini file:
Line 54: Line 52:
|-
|-
|blam
|blam
|Replaces body text of the [[:Image:Blam!.png|blam window]].
|Replaces body text of the [[:Image:Blam!.png|Blam window]].
|-
|-
|damn
|damn
|Replaces title of the [[:Image:Blam!.png|blam window]].
|Replaces title of the Blam window.
|-
|-
|savepoint
|savepoint
|Replaces string "Save Point" in Load Game menu (not working?).
|Replaces string "Save Point" in Load Game menu (see "Locales" below).
|-
|-
|syndicatewarehouse
|syndicatewarehouse
|Replaces string "Syndicate Warehouse" in Load Game menu (not working?).
|Replaces string "Syndicate Warehouse" in Load Game menu (see "Locales" below).
|-
|-
|''nameofcheat''_on/_off
|''nameofcheat''_on/_off
|Replaces name of the built-in cheat code as it appears on the Data Comlink screen when code is entered. E.g., "behemoth_on=Gojira Desu!".
|Replaces name of the built-in cheat code as it appears on the Data Comlink screen when code is entered. E.g., "behemoth_on=Gojira Desu!".
|}
|}
====Locales====
In order to use the "savepoint" and "syndicatewarehouse" settings above, you must create a locale:
:1. Add a setting called "language" under the daodan.ini's [language] section with the name of your locale, e.g.:
[language]
language = xx
:You can call the locale whatever you want and it need not be an official ISO locale code, but [[wp:List of ISO 639-1 codes|here's the list of language codes]] if you want it.
:2. Create a folder alongside the Daodan DLL called "daodan_locales".
:3. Create an INI file inside called xx.ini (or whatever you called your locale in step 1).
:4. The contents of the INI should be:
savepoint = ''translation''
syndicatewarehouse = ''translation''
The next time Oni runs, you should see your translated strings in the Load Game screen. This approach allows you to create/download as many locale INIs as you want, place them in daodan_locales, and switch between them by changing the "language" setting in daodan.ini.


===Configuration===
===Configuration===
Creating a file called Daodan.[[wikipedia:INI_file|ini]] in the same directory as the Daodan DLL will allow you to configure which patches are enabled, as well as to store configuration settings and language items.
Creating a plain-text file called "daodan.[[wp:INI file|ini]]" in the same directory as the Daodan DLL will allow you to configure which patches are enabled, as well as to store configuration settings and language items. This file is typically created by the Daodan DLL the first time it loads.
 
On modern versions of Windows (starting with Windows Vista), Oni does not properly request write access to the directory containing Oni.exe (i.e. C:\Program Files (x86)\Oni in typical installs). Windows detects this, and creates a dedicated directory for Oni.exe (and thus Daodan.DLL) to write its files to, located in C:\Users\<Your Username>\AppData\Local\VirtualStore. The directory for Oni will reflect its relative path on disk, so in a typical install, it will be at VirtualStore\Program Files (x86)\Oni. This is where all files output by the program (startup.txt, persist.dat, key_config.txt, etc.) will be located when Oni is not run as an administrator. '''This is the location where Daodan.ini must be placed if Oni is to be run as a non-administrator.'''


Inside of the Daodan.ini file, each configuration setting is stored inside a section as a name and value pair. To temporarily disable a setting in the INI, add a '#' to the beginning of the line and the Daodan will ignore it.
On modern versions of Windows (starting with Windows Vista), Oni does not properly request write access to the directory containing Oni.exe (i.e. C:\Program Files (x86)\Oni in typical installs). Windows detects this, and creates a dedicated directory for Oni.exe (and thus the Daodan DLL) to write its files to, located in C:\Users\<Your Username>\AppData\Local\VirtualStore. The directory for Oni will mirror its relative path on disk, so in a typical install it will be at VirtualStore\Program Files (x86)\Oni. This is where all files output by the program (startup.txt, persist.dat, key_config.txt, etc.) will be located when Oni is not run as an administrator. '''This is the location where daodan.ini must be placed if Oni is to be run as a non-administrator.''' Note that you can create your own folder for Oni, e.g. C:\Games\, to avoid this permissions issue.


As of Daodan v3.7, configuration entries in Daodan.ini are stored in several different sections. To change an entry, add it to the relevant section. If the section does not yet exist, add it to the end of the file and add relevant entries under it. If any entry is omitted, it is set to its default value. Entries are case-insensitive, and spacing does not matter.
Inside of the daodan.ini file, each configuration setting is stored inside a section as a name-value pair. To temporarily disable a setting in the INI, add a '#' to the beginning of the line and the Daodan will ignore it. Any settings not listed in the INI will use their default values which are listed in {{SectionLink||All configuration settings}}. To change a setting away from its default, add the setting to the relevant section. If the section does not yet exist, add it to the end of the file and add relevant entries under it. Entries are case-<u>in</u>sensitive and spacing does not matter.


Here is an example Daodan.ini file. This example sets the devmode section items to their defaults and disables the cooldown timer patch:
Here is a simple example of a daodan.ini file:
  [Devmode]
  [devmode]
  highres_console = True
  highres_console = True
  showtriggervolumes = True
  showtriggervolumes = True
   
   
  [gameplay]
  [gameplay]
  CooldownTimer = False
  cooldowntimer = False


Daodan.ini may contain the following sections (names are case-insensitive):
daodan.ini may contain the following sections:
* devmode ''(Developer Mode Configuration)''
* devmode ''(Developer Mode Configuration)''
* gameplay ''(Gameplay Configuration)''
* gameplay ''(Gameplay Configuration)''
Line 98: Line 107:


===Command-line arguments===
===Command-line arguments===
[[Customizing#Command-line_arguments|Command line options]] are still present in the beta Daodan although the syntax is a little different (and a bit more powerful.) The basic syntax for a command line option is this:
[[Customizing#Command-line arguments|Command line options]] for the Daodan DLL can also be used when launching Oni, although the syntax is a little different (and a bit more powerful). The basic syntax for a command line option is this:
  -<ini section>.<name> <value>
  -<ini section>.<option> <value>
Where <ini section> is the Daodan.ini section (usually '''Patch''' or '''Options''',) <name> is the option and <value> is the value to set it to (usually '''True''' or '''False'''.) Therefore, to disable sound, start Oni with this:
For example, to disable sound start Oni with this:
  oni -options.sound false
  oni -options.sound false
When <ini section> is omitted, it is assumed to be '''options'''. When <value> is omitted, it is assumed to be '''true''' unless <name> starts with '''no''' (eg. '''nosound''') in which case it is assumed to be '''false'''. So an easier way to write the above command would be:
When <ini section> is omitted, it is assumed to be '''options'''. When <value> is omitted, it is assumed to be '''true''' unless <option> starts with '''no''' (eg. '''nosound''') in which case it is assumed to be '''false'''. So an easier way to write the above command would be:
  oni -nosound
  oni -nosound
Options or patches specified on the command line take precedence over options specified in Daodan.ini. Currently Oni's command line parser isn't powerful enough to parse language elements (no support for quoting arguments); this will be fixed in a later release.
Options or patches specified on the command line take precedence over options specified in daodan.ini so that you can temporarily override the usual settings. Currently Oni's command line parser isn't powerful enough to parse Language settings (no support for quoting arguments); this will be fixed in a later release.


===All configuration settings===
===All configuration settings===
Below are the names of the configuration settings you can turn on and off in Daodan.ini (names and sections are case-insensitive). Also noted is whether the DLL has this patch turned on or off by default.
Below are the names of the configuration settings you can turn on and off in daodan.ini (names and sections are case-insensitive). Also noted is whether the DLL has this patch turned on or off by default.
{| class="wikitable"
{| class="wikitable"
!INI Section
!INI Section
Line 232: Line 241:
|language
|language
|en
|en
|Sets localization for hardcoded strings (e.g. "Savepoints").
|Sets locale name for hardcoded strings (see {{SectionLink||Locales}}).
|-
|-
|[language]
|[language]