<commit_before># DragonberryPi

Dynamic RPG adventure map management for table top gaming 
via a Raspberry Pi based server.

## Backstory

Recently my daughter came across my old AD&D books at her grandma's house, and
she got interested in playing.  I thought it would be fun to GM a game for her,
but I wanted to use a newer rule system with lots of published content
available (I do not have as much time to create worlds nowadays).  I decided on
[Pathfinder][] and we started with the beginner box (along with a geeky friend
of mine and his wife who were both willing to join me on this little
midlife-geek-crisis).  As we moved on to the full rule system, I found that
every book was $50 for print, but like $10 for PDF.  As I like the idea of a
table top map and pawns, but not the idea of paying a lot of money for them I
wrote DragonberryPi.

[Pathfinder]: http://paizo.com

## Introduction

DragonberryPi (along with my flat-screen TV laid down on my table) allows me to
use content I purchased without making it available to anybody else.  This is
different than using some sort of remote table-top RPG service.  My intention
is to just replace the map, pawns, and pawn markers in my game.  DragonberryPi
does that with minimal alteration to the rest of the RPG experience.

DragonberryPi installs on a [Raspberry Pi] where it uses the [Apache]2 web
server and MySQL or MariaDB database to display the maps and pawns.  It is a
fully dynamic AJAX web app, which allows the GM to view the full map, PC, NPC,
and monser pawns, while gradually reveling it to the players.  It
simultaneously allows the players to view and control there pawns and move them
where they want.  It is nothing that a good remote table-top service like
[Roll20] cannot do.  It just runs on your own home network where you control
any access to it.

[Raspberry Pi]: https://www.raspberrypi.org/
[Apache]: http://www.apache.org/
[MySQL]: http://www.mysql.com/
[MariaDB]: https://mariadb.org/
[Roll20]: https://roll20.net/
[donjon]: http://donjon.bin.sh/

## Installation

[Install jessie][pi-install] on the Raspberry Pi.

### raspi-config

in a terminal type

    `sudo rasi-config`

* then in rasi-config do the following:

    * choose *expand filesystem*
    * set you international options based on what you want
    * turn on ssh.  This is useful for access if you want to do your adventure prep from a PC and just copy files over
    * reset your password
    * reboot
    
### Install necessary packages

You will want to make sure everything is up to date and install the packages
DragonberryPi needs

    sudo apt-get update
    sudo apt-get upgrade

Gnome WebKit's Web does not work well for DragonberryPi, better to use
Iceweasel.  Likewise Firefox is the best browser for viewing from a PC.
Mysql-workbench, phpmyadm, and python-sqlalchemy are ways to work with the
database of adventure prep (i.e. adding content).  I do not have custom
browser-apps for that.  I use Gimp for slicing up the map into tiles, but
typically I do it on the PC anyway.
    
    sudo apt-get install iceweasel
    sudo apt-get intstall mariadb-server phpmyadmin mysql-workbench php5 apache2 gimp python-sqlalchemy
    # enter a root password for mariadb
    # point phpmyadmin to use apache
    
### Install DragonberryPi

first clone the code

    `git clone https://github.com/winterstew/DragonberryPi`
    
then create the user for installing the database.  I like mysql-workbench for
this. 

   `mysql-workbench`

* with mysql-workbench do the following:

    * open Local instance 3306
    * ignore error
    * Go to Users and Privileges
    *  new Login => `dragon` password `<PASSWORD>` on localhost
    *  Administrative Roles => DBDesigner
    *  Schema Privileges => DragonberryPi: Everything but GRANT

You can also use mysql-workbench to take a look at the database design layout,
if you like.  

    `mysql-workbench DragonberryPi/share/mysql/DragonberryPi.mwb`
    
Install the database and/or the example dungeon.  If you are using MariaDB on
jesse, you can have higher time resolution on the save states.

    cd DragonberryPi/share/mysql
    # install empty dungeon schema
    mysql -u dragon -p < DragonberryPi.sql
    # install example dungeon schema
    mysql -u dragon -p < ExampleDungeon.sql
    # or to install it with higher timestamp resolution
    sed 's/timestamp/timestamp(3)/' ExampleDungeon.sql | mysql -u dragon -p DragonberryPi
    
Install Apache configuration 

    cd ~/DragonberryPi/share/config
    sudo cp DragonberryPi /etc/apache2/sites-available/DragonberryPi.conf
    sudo a2enmod rewrite
    sudo a2ensite DragonberryPi
    sudo service apache2 reload
    <commit_msg>format fix<commit_after># DragonberryPi

Dynamic RPG adventure map management for table top gaming 
via a Raspberry Pi based server.

## Backstory

Recently my daughter came across my old AD&D books at her grandma's house, and
she got interested in playing.  I thought it would be fun to GM a game for her,
but I wanted to use a newer rule system with lots of published content
available (I do not have as much time to create worlds nowadays).  I decided on
[Pathfinder][] and we started with the beginner box (along with a geeky friend
of mine and his wife who were both willing to join me on this little
midlife-geek-crisis).  As we moved on to the full rule system, I found that
every book was $50 for print, but like $10 for PDF.  As I like the idea of a
table top map and pawns, but not the idea of paying a lot of money for them I
wrote DragonberryPi.

[Pathfinder]: http://paizo.com

## Introduction

DragonberryPi (along with my flat-screen TV laid down on my table) allows me to
use content I purchased without making it available to anybody else.  This is
different than using some sort of remote table-top RPG service.  My intention
is to just replace the map, pawns, and pawn markers in my game.  DragonberryPi
does that with minimal alteration to the rest of the RPG experience.

DragonberryPi installs on a [Raspberry Pi] where it uses the [Apache]2 web
server and MySQL or MariaDB database to display the maps and pawns.  It is a
fully dynamic AJAX web app, which allows the GM to view the full map, PC, NPC,
and monser pawns, while gradually reveling it to the players.  It
simultaneously allows the players to view and control there pawns and move them
where they want.  It is nothing that a good remote table-top service like
[Roll20] cannot do.  It just runs on your own home network where you control
any access to it.

[Raspberry Pi]: https://www.raspberrypi.org/
[Apache]: http://www.apache.org/
[MySQL]: http://www.mysql.com/
[MariaDB]: https://mariadb.org/
[Roll20]: https://roll20.net/
[donjon]: http://donjon.bin.sh/

## Installation

[Install jessie][pi-install] on the Raspberry Pi.

### raspi-config

in a terminal type

    sudo rasi-config

* then in rasi-config do the following:

    * choose *expand filesystem*
    * set you international options based on what you want
    * turn on ssh.  This is useful for access if you want to do your adventure prep from a PC and just copy files over
    * reset your password
    * reboot
    
### Install necessary packages

You will want to make sure everything is up to date and install the packages
DragonberryPi needs

    sudo apt-get update
    sudo apt-get upgrade

Gnome WebKit's Web does not work well for DragonberryPi, better to use
Iceweasel.  Likewise Firefox is the best browser for viewing from a PC.
Mysql-workbench, phpmyadm, and python-sqlalchemy are ways to work with the
database of adventure prep (i.e. adding content).  I do not have custom
browser-apps for that.  I use Gimp for slicing up the map into tiles, but
typically I do it on the PC anyway.
    
    sudo apt-get install iceweasel
    sudo apt-get intstall mariadb-server phpmyadmin mysql-workbench php5 apache2 gimp python-sqlalchemy
    # enter a root password for mariadb
    # point phpmyadmin to use apache
    
### Install DragonberryPi

first clone the code

    git clone https://github.com/winterstew/DragonberryPi
    
then create the user for installing the database.  I like mysql-workbench for
this: 

    mysql-workbench

* with mysql-workbench do the following:

    * open Local instance 3306
    * ignore error
    * Go to Users and Privileges
    *  new Login => `dragon` password `<PASSWORD>` on localhost
    *  Administrative Roles => DBDesigner
    *  Schema Privileges => DragonberryPi: Everything but GRANT

You can also use mysql-workbench to take a look at the database design layout,
if you like.  

    mysql-workbench DragonberryPi/share/mysql/DragonberryPi.mwb
    
Install the database and/or the example dungeon.  If you are using MariaDB on
jesse, you can have higher time resolution on the save states.

    cd DragonberryPi/share/mysql
    # install empty dungeon schema
    mysql -u dragon -p < DragonberryPi.sql
    # install example dungeon schema
    mysql -u dragon -p < ExampleDungeon.sql
    # or to install it with higher timestamp resolution
    sed 's/timestamp/timestamp(3)/' ExampleDungeon.sql | mysql -u dragon -p DragonberryPi
    
Install Apache configuration 

    cd ~/DragonberryPi/share/config
    sudo cp DragonberryPi /etc/apache2/sites-available/DragonberryPi.conf
    sudo a2enmod rewrite
    sudo a2ensite DragonberryPi
    sudo service apache2 reload
    
{'fraction_non_alphanumeric': 0.05494975411588625, 'fraction_numerical': 0.004703870002138123, 'mean_word_length': 3.528073572120039, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 8, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1230626', 'n_tokens_mistral': 2766, 'n_tokens_neox': 2611, 'n_words': 1339}