Giter VIP home page Giter VIP logo

dd2-bot's Introduction

dd2-bot

Oops, I should probably write some documentation for this. Works like a charm on Windows platforms.

Requirements

For the bot to work for new releases of the game, some memory pointers in this file must be updated. These references are chained offsets to the base address for the running process, pointing to a specific memory struct, block or variable. The easiest way to update memory references is by running an instance of the game, using memory scans to narrow down the set of possible pointers by cross-joining pointer maps.

How it works

Ability to run multiple game clients

As Steam limits the number of instances of a game to 1 per host (computer/account), game clients must be run in isolated operating environments using a sandbox (e.g. using Sandboxie). Upon launch, the bot scans running process signatures to create one bot client for each running instance of the game.

Reading state from the game clients

The bot relies on the PyWin32 API to execute low-level calls to ReadProcessMemory. As all client variables are wrapped in MemoryData instances, the underlying memory location can be conveniently read from and written to using MemoryData.read() and .write() respectively.

Recording maps

The bot implements a builder which can be controlled using hotkeys defined in run.py. The builder records all relevant game state as events are added to a timeline. The timeline is stored as discrete actions in this format.

Playback of maps

Recorded timelines in .json format is parsed by the map executor, which uses weighted spline interpolation to create a continuous trajectory from the discrete events in the timeline.

Todo

  • Write some documentation and add screencasts.
  • Implement support for MacOS, will require finding an interface for reading/writing to processes on MacOS. Will also require disabling SIP.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.