Skip to content

Game

The game Wraith’s in: which one, its files, and its engine. Kinds are names like steam or unity. Any thread.

Get it with Api.game().

gameInfo(): Wraith.Game.Info
listedGame(): Wraith.Game.Listed
sha512(): Promise<string>
speed(): number
setSpeed(speed: number): void
claimSpeed(handler: Wraith.Game.SpeedHandler, changed: Wraith.Lease.Changed | null): Wraith.Lease
setSpeedControl(on: boolean): void
speedControl(): boolean
setWorld(world: import("salamander").Given<Wraith.Game.World>): void

Cheap. Fixed once taken, apart from the graphics API and window early on.

Uses Game.Info.

Which of the calling plugin’s wraith.json games Wraith’s in, to pick its code by.

Uses Game.Listed.

The exe’s SHA-512 in hex, as a manifest’s hashes lists it. Worked out in the background at startup.

Async. Fails with GameError.

1 is normal, 2 twice as fast.

Up to 100. Goes through the speed lease holder, else hooks the game’s clocks (down to 0.01). 0 pauses, with a holder. Back to 1 when the setting plugin goes. Some games don’t follow it.

Fails with GameError.

A lease on the game’s speed, see Lease. While held, handler gets the speed, straight away with the current one, and 1 when it’s lost or released.

Fails with GameError. Uses Game.SpeedHandler, Lease.Changed, Lease.

Whether the speed can be changed at all. On by default; turning it off resets the speed. A game plugin’s say beats an engine’s, which beats the rest, then the newest, till that plugin goes.

How the game’s world is laid out. Once’s enough; the last set counts till its plugin goes.

Uses Game.World.

What can go wrong, besides Cancelled, Unsupported and Gone.

Code Error
1 Failed
2 SpeedOff A plugin has speed control off, see setSpeedControl

Which of the plugin’s wraith.json games Wraith’s in. Empty if none.

A struct, 0x20 bytes, aligned to 8.

Offset Field Type
0x0 name string Like cs3
0x10 schema string Its namespace in the plugin’s schema family, like Cs3
name: string
schema: string

A struct, 0x20 bytes, aligned to 8.

Offset Field Type
0x0 id string Like easy_anti_cheat
0x10 name string Like Easy Anti-Cheat
id: string
name: string

A struct, 0xe8 bytes, aligned to 8.

Offset Field Type
0x0 id string Like steam-1245620, or Wraith’s own name for games it knows, like ffxiv. unknown if the exe wasn’t found.
0x10 store string steam, gog, epic, xbox, itch, or local
0x20 title string The store’s name for it, or empty
0x30 build string The store’s build, like steam:18234455, as a manifest’s builds lists them. Empty if unknown; only Steam so far.
0x40 exe string The exe’s full path
0x50 dir string
0x60 file_version string From the exe’s version resource, like 1.2.0.0. Often empty.
0x70 product_version string
0x80 game_engine string Like unity, unreal, godot or rpg_maker, from the files beside the exe. Empty if unknown.
0x90 game_engine_variant string Like IL2CPP or Mono for Unity, or MV for RPG Maker. Can be empty.
0xa0 game_engine_version string Like 2021.3.16. Can be empty.
0xb0 anticheat []Game.AntiCheat Found beside the game or loaded in it. Wraith doesn’t stop for it.
0xc0 graphics_api string Like d3d11 or vulkan. Empty till the first frame.
0xd0 window usize The game’s HWND on Windows. 0 till it’s found.
0xd8 wraith_version string Like 0.4.0
id: string
store: string
title: string
build: string
exe: string
dir: string
file_version: string
product_version: string
game_engine: string
game_engine_variant: string
game_engine_version: string
anticheat: Array<Wraith.Game.AntiCheat>
graphics_api: string
window: number
wraith_version: string

An enum of u8.

Value Name
0 pos_y
1 neg_y
2 pos_z
3 neg_z
4 pos_x
5 neg_x

How the game’s world is laid out, for the free camera and sizing distances like a drag’s.

A struct, 0x8 bytes, aligned to 4.

Offset Field Type
0x0 up Game.Axis
0x1 look Game.Axis Ahead
0x2 left_handed bool
0x4 metre f32 Game units per metre, like 100 in Unreal
up: Wraith.Game.Axis | Wraith.Game.AxisName
look: Wraith.Game.Axis | Wraith.Game.AxisName
left_handed: boolean
metre: number

Sets the game’s speed the plugin’s own way, like an engine time scale. False falls back to hooking the clocks. Any thread; keep it quick and don’t set the speed from it.

Wraith.Game.SpeedHandler

Made with ♥ by Asgard