Netdex/twinject

Game Abstraction Project

Closed this issue · 0 comments

Goal

Support as many games as possible. Currently, twinject is written to solely support th08. Some abstractions need to be made in order to support multiple games.

General Behaviour

The way the games have worked has changed a lot in the last 20 years. Thus, in order to make abstractions, we must use what is common between all the games.

  • Injection (Detours)
  • Graphical control for overlays (Direct3D)
  • Input control for player control (DirectInput)
  • Frame timing information (Direct3D)
  • Entity/relevant data (game-specific)

Abstractions Required

The following concepts must be abstracted:

  • Hooking Direct3D and DirectInput
  • Hooking frame end event and injecting tick code
  • Game specific entity processor (this is a difficult one)
  • Game specific code patches to correct unintended behaviour
  • Game specific player logic, to adapt to game mechanics (UFOs, time orbs etc.)
  • Game specific bot parameters (deathbomb threshold, safety threshold, aggressiveness)

Process Change

An overhaul needs to be made to the general flow of the bot's workings.

The following steps will describe the new process the bot will operate in per frame:

  1. Information Gathering - Update data table with gathered information regarding game state
  2. Processing - Use data table to calculate frame action
  3. Action - Execute frame action