Giter Site home page Giter Site logo

simonkeyd / bgcar Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 6.56 MB

Baldur's Gate Computer Assisted Reroll for easy character high ability scores roll

License: GNU General Public License v3.0

Python 100.00%
baldurs-gate baldurs-gate-ii bg2ee bgee python

bgcar's Introduction

BGCAR

pypi license: GPLv3 lint release

Baldur's Gate Computer Assisted Reroll (BGCAR) helps one effortlessly reach high ability scores for one's CHARNAME by performing computer assisted reroll. This program performs live roll result analysis and only stores the highest value. This is done by capturing screen area containing the total roll score and analyzing its value with OCR.

Installation

Installing from PyPI:

pip install bgcar

Installing from source:

git clone https://github.com/simonkeyd/bgcar && cd ${_##*/}
pip install -r requirements.txt

Step by step guide

  1. Start Baldur's Gate or Baldur's Gate 2 in windowed mode
  2. Proceed to create your character and stop at ability page
  3. Run bgcar (for first time use add -i parameter)
  4. For first time use follow the initial wizard to provide the different positions that the program needs.
    Click on corresponding buttons when asked to and mark the area of the Total roll score by first clicking on the top left of this score and then on the bottom right.
  5. Let the program perform the rolls and stop it by pressing 't' when done

note: Baldur's Gate game window has to be in the foreground so that bgcar can perform capture and clicks.

Demo

BGCAR demo

Advanced usage

see bgcar -h

usage: bgcar [-h] [-d] [-i] [-t TIME] [-m MAX_ROLL_COUNT] [--gpu]

options:
  -h, --help            show this help message and exit
  -d, --debug           print debug level messages (each roll value, etc)
  -i, --initialize      initialize required settings like button location - mandatory before
                        program use
  -t TIME, --time TIME  time in second to wait between each click (one can use decimal
                        values); a delay too short for your setup might cause the program to
                        misbehave (eg. not store roll correctly) (default: 0.03)
  -m MAX_ROLL_COUNT, --max-roll-count MAX_ROLL_COUNT
                        limit the maximum number of roll that you want the program to perform;
                        by default bgcar will run in infinite mode
  --gpu                 enable GPU mode for OCR and accelerating program

Known issues

Invalid value results (eg. program finding incorrect value for a Total roll) can be caused by the following:

  • Total roll score area too big or too small
  • too poor game resolution
  • too small game window (or both)

To prevent this from happening try re-initializing Total roll area (using -i parameter) or enlarging game window and increasing game resolution.

bgcar's People

Contributors

simonkeyd avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

bgcar's Issues

Hi! I have a problem.

sudo bgcar -i --gpu -d 1 -m 100

Click on Store button
Click on Recall button
Click on Reroll button
Click on Total roll score top left
Click on Total roll score bottom right
Traceback (most recent call last):
File "/usr/local/bin/bgcar", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/dist-packages/bgcar/cli.py", line 226, in main
tr_maximum, roll_count = init_rolls(
File "/usr/local/lib/python3.10/dist-packages/bgcar/cli.py", line 131, in init_rolls
tr_value = tr_maximum = int(read_image(reader, numpy.array(tr_image))[0][1])
IndexError: list index out of range

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.