Daodan DLL

From OniGalore
Revision as of 12:37, 11 July 2014 by Dekarrin (talk | contribs) (→‎Settings: Rewrote for v3.7, and removed irrelevant sections. Language will be re-added in a separate section)
Jump to navigation Jump to search
Subpages: Daodan DLL change log

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 to help it play the game's opening and ending videos. The Daodan fixes issues such as the famous "Blam!" error that occurs on modern machines. It also adds new features such as support for widescreen resolutions and bonus cheat codes.

C-Daodan

This is the recommended version of the Daodan DLL. Note that you already have this installed if you installed the Anniversary Edition.

Installation instructions (for non-AE users)

1. Download the AE package that contains the Daodan DLL from here. The files you need are in the win_only\ directory.
2. Find where your copy of Oni has been installed to. For most people, it is stored in "C:\Program Files\Oni". This folder should contain a "GameDataFolder" and "Oni" or "Oni.exe". Back up your Oni.exe by renaming it (e.g. "Oni-original.exe").
3. Place the newly-downloaded Oni.exe, binkw32.dll, realbink.dll, and assorted files into the Oni\ folder.
4. To test if you have done everything correctly, run "Oni.exe". Enter the pause (Diary) screen (F1 by default) and type "tellmetheversion"; if you get a result like "Daodan v.x.y", the DLL is working.

Troubleshooting

If the game does not display correctly (for instance, a black window), try the following in any order:

1. Disable the intro movie by renaming GameDataFolder\intro.bik. This often fixes the game window.
2. Open the daodan.ini in Notepad and set either "daodangl" or "windowhack" to true. "windowhack" should at least center the window on the screen.
3. Try launching Oni as Administrator.
4. Make the Oni folder writable by un-checking "Read-only" in the Properties window for the folder.
5. Try both the run_full and run_wind scripts.

You can report problems on the forum in this thread or in a new thread in the Modifications forum.

Feature summary

  • Windows XP patch - Fixed Oni crashing at startup on modern computers.
  • Windowed mode - Oni runs inside a window.
  • Custom screen resolutions - Includes many more default screen resolutions and the ability to add custom resolutions (see below).
  • BGRA32 (ARGB8888) support.
  • Extra cheats - see "Added cheat codes" section below.
  • Cheats always enabled; no need to beat game first.
  • Extra command line options (for advanced users) - For a list, type "Oni -help".
  • DirectInput is used on NT, XP and Vista - Better support for keyboard layouts.
  • AIs have ability to properly dodge projectiles.
  • Stops fly-in character portraits from being stretched when playing in widescreen.

Developer Mode

The DLL enables Developer Mode; go to the pause screen (F1) and type "thedayismine" or simply 'x' to activate it.

Configuration

Creating a file called Daodan.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.

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.

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.

Here is an example Daodan.ini file. This example sets the devmode section items to their defaults and disables the cooldown timer patch:

[Devmode]
highres_console = True
showtriggervolumes = True

[gameplay]
CooldownTimer = False

Daodan.ini may contain the following sections (names are case-insensitive):

  • devmode (Developer Mode Configuration)
  • gameplay (Gameplay Configuration)
  • graphics (Graphics Configuration)
  • language (Language Configuration)
  • modding (Modding Configuration)
  • oni (Original Oni Options Configuration)
  • windows (OS Interaction Options)

For names of all entries, and a brief help, see the "All Configuration Settings" section below for more information.

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:

-<ini section>.<name> <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:

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:

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.

All patches

Below are the names of the patches you can turn on and off in Daodan.ini (names are case-insensitive). Also noted is whether the DLL has this patch turned on or off by default.

INI name Default Description
alttab true Allows user to switch applications while in Oni (Alt-Tab) and use Windows key, however it may enable the screensaver as well.
argb8888 true Textures using ARGB8888 can be used.
binkplay true Fix binkplay calls to use GDI and outro same mode as intro.
cheatsenabled true Enables cheats without having to beat the game first.
cheattable true Replaces Oni's cheat table with table that includes new cheats (see section below).
chinese true Loads chinese font engine if available
clipcursor true Limit cursor to Oni's window
cooldowntimer true Disables weapon cooldown exploit.
d_regen true Enables script command d_regen (query/set regeneration for any character).
daodandisplayenum true Offers more display modes in the Options menu.
directinput true Forces on DirectInput.
disablecmdline true Disables Oni's existing command line parser as Daodan has its own.
fonttexturecache true Doubles size of font texture cache.
hdscreens_lowres true ?
highres_console true Fixes bug where console line becomes invisible at higher resolutions.
kickguns false Unfinished, do not use.
killvtune false Prevent loading of vtuneapi.dll.
largetextures true Textures up to 512x512 can be used.
levelplugins true Allows level files to be loaded from the GDF which do not end in "_Final".
newweap true Picking up a weapon displays a message containing the weapon name and amount of ammo.
nomultibyte true Enables languages which use multibyte coding (such as Chinese).
optionsvisible true Always show options button in main menu, even when pausing from a game
pathfinding true Multiplies size of pathfinding grid cache by eight in order to prevent crashes in large levels.
projaware true Allows AI to dodge incoming gunfire properly.
safeprintf true Replaces Oni's function that prints to startup.txt with a safer one.
showalllasersights false Show all (also enemies') weapon lasersights
showtriggervolumes true Allows BSL variable "show_triggervolumes" to work when set to 1
throwtest false Not recommended for use; experiment with allowing enemies to be thrown over railings.
usedaodanbsl true Adds new BSL commands (see below).
usedaodangl true Provides an improved windowed mode (-noswitch); this patch is known to break the hiding of the Windows taskbar in fullscreen mode.
usegettickcount true Replaces Oni's timing functions with more accurate ones.
widescreenportraits true Prevents fly-in portraits from being stretched when playing in widescreen resolutions.
wpfadetime true Adds working function for existing BSL command wp_fadetime, sets fade time to 4800.

All options

Below are the names of the options you can turn on and off in Daodan.ini (names are case-insensitive). Also noted is whether the DLL has this option turned on or off by default.

INI name Default Description
border true If "windowhack" patch is active, make sure game window has border in windowed mode.
gamma true Enable gamma slider in fullscreen
switch true Always switch screen to resolution on Oni's Options screen, making the game fullscreen; opposite of Oni's built-in argument "noswitch".
topmost false Keep game window on top in windowed mode, even when switching applications.
various -- Oni's built-in arguments; see Customizing#Command-line_arguments. Reenables (as bool): debug, findsounds, ignore_private_data, sound

Added cheat codes

  • bigbadboss
Player takes less weapon damage.
  • buddha
Player is unkillable (will not go below 1HP).
  • bulletproof
Player takes no weapon damage.
  • kangaroo
Player can make super-high jumps.
  • marypoppins
Player can fly by holding down jump key.
  • shinobi
Extra difficulty mode; player always has 1HP, but also is immune to weapons, and the enemy AI cannot hear the player.

Added BSL functions

Any time a function can both get and set a value, and you set the value, the old value should be is returned, barring any programming oversight by Gumby.

Math

  • int int32mul n1:int n2:int
Multiplies two integers
  • float mul [int1:int|float1:float] [int2:int|float2:float]
Multiplies two numbers
  • int int32div n1:int n2:int
Divides two integers
  • float div [int1:int|float1:float] [int2:int|float2:float]
Divides two two numbers
  • int int32rand start:int end:int
Returns a pseudo-random number between two numbers (inclusive).

Characters

  • int d_getkills [ai_name:str | script_id:int]
Gets the number of kills a character has
  • int d_getdamage [ai_name:str | script_id:int]
Gets the amount of damage a character has caused
  • string d_name [ai_name:str | script_id:int] [newname:string]
Gets or sets a character's name
  • string d_regen [ai_name:str | script_id:int] on_off:bool
Gets or sets a character's regeneration (like elderrune for the player)
  • int d_getindex [ai_name:str]
Gets a character's script_id from their name
  • int d_powerup ai_name:str|script_id:int powerup:str [newcount:int]
Gets or sets the amount of powerups a character has
Powerup list the same as with chr_givepowerup with the addition of "bossshield"
  • int d_health [ai_name:str | script_id:int] [newhealth:int]
Gets or sets a character's health
  • int d_maxhealth [ai_name:str | script_id:int] [newmaxhealth:int]
Gets or sets a character's maxhealth
  • int d_holdkey [ai_name:string | script_id:int] keys frames:int
Makes a character hold a key
Possibly broken
  • int d_isheld keys
Checks if player is holding a key
Possibly broken
  • int d_waitforkey keys
Waits for a keypress from the player
  • int d_powerup [ai_name:string | script_id:int] powerup:string
Gets or sets a character's powerups
  • float d_location [ai_name:string | script_id:int] xyz:string
Gets the XYZ coordinate of a character
  • float d_location [ai_name:string | script_id:int] x:float y:float z:float
Sets the XYZ coordinates of a character
  • float d_distance [ai_name:string | script_id:int] [ai_name:string | script_id:int]
Gets the distance between two characters
  • int d_regen [ai_name:string | script_id:int] yesno:int
Gets or sets a character's regeneration abilities

Text

  • void d_dprint text:string [textcolor: r b g] [shadowcolor: r b g]
Prints to console in color
Colors are ints between 0 and 255. Other numbers will be reduced to 255.
Any colors you do not supply will be replaced with the default values: 255, 255, 255 and 63, 63. 63
  • string sprintf str1:format ...
Does a C-style sprintf operation on a string

FASM-Daodan (old)

Note: Unsupported by community. There is also a much older release of Daodan, referred to as FASM-Daodan. This is the original version by SFeLi. Unlike the C-Daodan, FASM-Daodan requires a different DLL to be downloaded depending on which Oni.exe is used. It does not support the newer Daodan features, such as windowed mode and custom resolutions, however it still contains the basic patches such as the Windows XP patch and the custom cheats.

Download a ZIP containing the DLLs for each version.

Download a ZIP containing the DLLs for an experimental (unstable) FASM-Daodan This includes the projectile awareness patch and support for any language (except Chinese and Japanese).