Creativity, Playdate and making things

It was with some delight I opened this month’s Edge magazine which I found on my table this evening. This month they have an exclusive on a nifty new handheld console built by software developers Panic called Playdate.

From the article, Playdate looks awesome. It’s a a cute yellow handheld with a high-quality LCD screen, simple controls and an intriguing crank, designed for fun gaming experiences written by indie developers. It looks like nothing I’ve played before. The concept seems pretty crazy, but that seems to be the point.

Edge #333 - Playdate handheld console

With a series of fun, creative, offbeat games released every Monday over wifi once you boot the Playdate up, the concept seems to be genuinely original and born out of a desire to just have fun and make stuff. I can’t wait to get my hands on one!

If you’re a fan of gaming the Edge article is well worth the price of the magazine. Reading through a few things stuck out for me.

I’ve been aware of Panic for many years. We use their software at Studio 24 (their excellent file transfer tool) and I’ve always been struck by their attention to detail and quality of design. I eagerly played through Firewatch when it was released on the Playstation 4. A fantastic game beautifully designed, full of atmosphere and good storytelling. The sort of game I really enjoy.

From the Edge article, Cabel Sasser (co-founder) explains what he believes was the origin moment for the project. He talks about Panic being a 20-person company with revenue around the two million dollar mark. He woke up one morning with “a bit of an existential crisis”. He had a profitable, independent company without external investors, with a team that could put their hand to a range of things – not just the same sort of work they’ve been focussed on for so long.

I realised we don’t have to keep doing the exact same thing that we’re always doing – this ceaseless develoment-and-support cycle. We can do some weird things too, as long as we’re not betting the farm. If we have this chance, we should probably start doing some things that take us to new places. Maybe they’ll work, maybe they won’t. But if we’re not doing that, we’re just wasting out lives.

Cabel Sasser, Co-founder, Panic

This kinda resonates with me. I run a digital agency, not far off the same size and revenue as Panic. I started as a creator too, hacking together web pages and making software. Making things has always been part of my make-up. But with running an agency that often takes a back seat, and spare time pretty much disappears if you’re not careful. It’s fantastic to see other companies of a similar size spin out internal projects into something so impressive.

Another lovely quote is:

Running this company now, I feel almost like a different person. I feel like a huge part of that is finding again how important it is to me and for everyone here to just make things, and be proud and excited about it.

Cabel Sasser, Co-founder, Panic

It’s a bold and exciting move for Panic, but one that I’m sure will give them new opportunities and rewards. There seems to be a real movement for more interesting, playful gaming at present. I hope Playdate does really well.

I’ve seen this in other companies recently too. Only this week I read that the excellent WordPress agency Human Made released Altis, their own “next generation” CMS platform built on top of WordPress. From my brief review it looks like a really interesting set of content and development tools to make creating engaging websites way easier. It sounds like an interesting venture for Human Made.

It also reminds me of Brendan Dawes’s talk at New Adventures about creating things, hacking together technology and making new things. (if you’re not aware New Adventures is a superb conference on digital creativity, ethics, inclusion and other essential topics)

Digital is so powerful and teams that work in this industry end up with such a variety of skills that can be put to great use. Studio 24 is twenty years old this year and I hope to be able to make more time for creating things with my fantastic team. I’ve started already with a foray into building sites with Headless CMSs and some tools I hope we can spin out into a viable open source project in the near future (which I also hope will spark off some interesting talks I can do at user meetups & conferences).

I’m also trying to blog more these days. Blogging on your own site seems to be coming back into vogue, I think it’s simply a nice way to note down your thoughts to help inspire and motivate. As Field Notes neatly puts it: “I’m not writing it down to remember it later, I’m writing it down to remember it now.”

Adding a Staging environment to Symfony 4

Environments in Symfony

We use Symfony a lot at Studio 24 for building modern web applications. Our normal setup is to have a local development environment, a staging environment for clients to test code, and a production live site.

By default Symfony supports the following environments:

  • dev – (development) intended for development purposes, can be used locally or on a hosting environment to test your application
  • test – (automated tests) intended for use when running automated tests (e.g. phpunit)
  • prod – (production) intended for the live web application

Ideally we would have a third web environment to represent staging, which is what we use to preview functionality before go-live. So that’s what I set out to do.

Adding a custom environment

I want to call my new environment stage to represent staging, since Symfony already uses shortened versions for other environments.

It turns out you can just add any old environment name and Symfony recognises this. So setting the new environment locally is really only a matter of updating your local environment settings file .env.local (you can also set this via actual server environment variables).

# Website environment
APP_ENV=stage

Environment configuration

Symfony loads environment variables from .env files. It uses the .env file for default values, then loads the .env.{environment} file for environment-specific settings. Finally, it loads the .env.local file for sensitive variables (e.g. API keys or database credentials – this file should not be committed to version control).

To help keep track of my staging environment variables I created a file at .env.stage to store these.

Package configuration

Different packages use YAML config files in the config/packages folder. I created the folder config/packages/stage/ which is used to store package configuration for the stage environment. It’s possible to inherit values from another environment via the imports key, which is really handy. Here I’m importing the prod settings for the stage environment.

# config/packages/stage/monolog.yaml
imports:
- { resource: '../prod/' }

Composer packages

One gotcha is your PHP code may depend on a library that is loaded by Composer locally in your dev environment (via require-dev), but does not load on stage or prod.

When I first tested the above code, it crashed since Monolog was not found (this is used for logging). It turns out Monolog was loaded in my local dev environment via symfony/debug-pack which is setup to only install on require-dev in my composer file.

This simple composer require command quickly fixed it!

composer require symfony/monolog-bundle

Debug mode

Debug is enabled by default for dev and test environments, and disabled for prod and any new environments.

Normally I’d recommend not displaying debug mode for a staging site, since it is supposed to be an environment to preview the site and should work in the same was as production.

However, you can enable debug and the Symfony debug bar for your new stage environment. First set APP_DEBUG in your .env.local file:

APP_DEBUG=true

Next, ensure the debug bundles are enabled. Edit config/bundles.php and ensure the WebProfilerBundle and DebugBundle are both enabled for the new stage environment.

    Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'stage' => true],

Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'stage' => true]

Finally, create the following config files:

# config/packages/stage/debug.yaml
imports:
- { resource: '../dev/' }
# config/packages/stage/web_profiler.yaml
imports:
- { resource: '../dev/' }
# config/routes/stage/web_profiler.yaml
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt

web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler

Summary

That’s it! It turns out it’s very easy to setup new environments for Symfony 4, most of the work is in enabling any bundles you require and ensuring the right config files are setup for your new environment.

New Year 2016

As I welcome the new year and type these words my kids are getting dressed upstairs, ready for a refreshing midday walk along Grantchester Meadows to lunch at the tearooms (with promises of scones). It’s been a busy year for me, but a very relaxing Christmas break, spent at home with the family just having fun. Which is my ideal Christmas, quite frankly.
Continue reading “New Year 2016”