Oops, I should probably write some documentation for this. Works like a charm on Windows platforms.
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.
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.
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.
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.
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.
- 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.