Skip to content
/ doggo Public

🐕 A basic dog AI using Markov chain and pygame.

License

Notifications You must be signed in to change notification settings

u8slvn/doggo

Repository files navigation

doggo logo

GitHub tag (with filter) Pypthon version CI Build Coverage Status Code Quality Project license

Doggo is a basic dog AI developed in Python and using pygame as a rendering engine. The dog just walks around the screen, changing states and direction randomly and dog's fur color is also picked randomly at start. State changes are based on a Markov chain, which is a simple model to represent a sequence of possible events in which the probability of each event depends only on the state attained in the previous event.

Here is a list of the dog states: idle, idle and bark, walk, walk and bark, sit, sit and bark, lie down, lie down and bark, run, run and bark, stand, stand and bark, sleep.

Project context: A colleague of mine wanted to have a dog, but he couldn't because of lots of reasons. So I decided to make him a virtual dog and it was the opportunity for me to play with Markov chains.

doggo demo

📦 ⇩ Download latest release ⇩📦
NOTE: release binaries are generated from the release workflow and are unsigned.
You may need to allow the execution of the binary in your system settings.

Controls

The project is designed as a simple pet widget to keep on your desktop. It's an always-on-top borderless window, so you need to click on it to get the focus before interacting with it.

  • ESC to quit.
  • Left Click to move the window around.

Install and run

Make sure you have Python 3.12 installed on your machine. Doggo use poetry to manage dependencies and virtual environment, so you need to install it too. Then, you can run the following commands at the root of the project:

poetry install
poetry run python -m doggo

Build locally

If you want to build the project locally, you can use the script in scripts/build.py. It uses PyInstaller under the hood. Don't hesitate to update the script to fit your needs.

# Available os options: windows, linux, macos
poetry run python scripts/build.py --os <os>

The script will generate a dist folder at the root of the project with the executable inside.

Development

For now, only one biome (mountain) is available. The feature to pick a biome randomly at start is already implemented, so I wish to add more in the future. Otherwise, I don't plan to add more features, like weathers or interactions, but the project is open to contributions. Just open a discussion before to make sure your idea fits the project.

7.9" screen option

Doggo use a weird ratio of 16:5, which is not common but fits well on a 7.9" screen. If you want to use it on a 7.9 inch screen, activating the following environment variable makes the window fit the 1280x400 resolution of 7.9" screens.

export DOGGO_7_9_SCREEN=1

doggo demo 7.9 screen

Licenses