Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/u8slvn/doggo

🐕 A basic dog AI using Markov chain and pygame.
https://github.com/u8slvn/doggo

Last synced: 9 days ago
JSON representation

🐕 A basic dog AI using Markov chain and pygame.

Awesome Lists containing this project

README

        



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](https://en.wikipedia.org/wiki/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](https://python-poetry.org/) 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:

```bash
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](https://www.pyinstaller.org/) under the hood. Don't hesitate to update the script to fit your needs.

```bash
# Available os options: windows, linux, macos
poetry run python scripts/build.py --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.

```bash
export DOGGO_7_9_SCREEN=1
```


doggo demo 7.9 screen

## Licenses

* Code source under [GPL-3.0 License](https://www.gnu.org/licenses/gpl-3.0.en.html)
* Assets:
* All assets under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
* Excepting dog sprites in `src/doggo/assets/dogs` from [Pixel Dogs](https://benvictus.itch.io/pixel-dogs) by [Benvictus](https://benvictus.itch.io)