033 - May 12, 2019

Hey!

As we mentioned last week, our goal for this passed week was to continue to polish the first quest in the game.

We made a lot of progress on some of the underlying code that powers quests, but we fell short on our goal of finishing up the art for the quest.

We'll have to pick back up on the art work during a future week.

Talk to Pookie Talking to Pookie will start the first quest in the game.

Working with the database

We were previously using a Postgres installation on our local host machine for our database - which led to inevitable issues and annoyances whenever we'd change version or switch computers.

This week we moved to running Postgres from a Docker container.

We also extended the Akigi CLI (ak) (powered by StructOpt) with a new subcommand, ak db.

Here's a quick look at the new ak db interface.

$ ak db -h
ak-db 0.0.1
Chinedu Francis Nwafili <frankie.nwafili@gmail.com>
Work with our database

USAGE:
    ak db <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    create-migration    CreateMigration
    help                Prints this message or the help of the given subcommand(s)
    migrate             Run migrations against one of our environments
    seed                Seed one of our databases
    start               Start a postgres database docker container

And here's an example of the ak db migrate CLI. We used to use knex for migrations, but we've migrated our local and production database to use dbmigrate instead.

$ ak db migrate -h
ak-db-migrate 0.0.1
Chinedu Francis Nwafili <frankie.nwafili@gmail.com>
Run migrations against one of our environments

USAGE:
    ak db migrate --command <command> --env <env>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -c, --command <command>     [possible values: Up, Down, Redo, Revert, Status]
    -e, --env <env>             [possible values: Dev, Int, Prod]

Being able to quickly and easily start our local database, run migrations and seed data has made for a much smoother dev experience!

Persisting Items / Quests

When a player connects to the game we'll now load up their inventory and quests from the database.

When they disconnect we'll now persist their inventory and quests to the database.

Some elbow grease went into getting this set up and adding tests to our test suite since we didn't have much persistance prior to this - but now it's looking like everything is working correctly.

Next Week

Next week is our second Investment Week. We'll be automating the deploy process for the game server.

This is trickier than the previous deployment processes that we automated because they were all stateless. Our game server is stateful and at any point tens or hundreds or thousands of players can be connected via WebSocket.

We have a plan to execute on - so we just need to dive in.

I'll be traveling a bit later in the week so I'll try and get as much done as I can before then.


Cya next time!

- CFN