Wumpus for PicoSystem v0.0.2 Released

In celebration of Halloween (given the original Wumpus’s place in survival horror game history), the v0.0.2 release of Wumpus for PicoSystem is now available. The GitHub release contains both the source code and the compiled binary UF2 file. This version adds randomized placement of the player and hazards as well as counters to keep track of how many times you’ve gotten the Wumpus… and how many times the Wumpus has gotten you!

The key pieces of infrastructure implemented:

  • Random number generation using the ROSC
  • Bitmap image used in splash screen
  • Moved from structs and function pointers to classes for states

Standard

Compiling for the PicoSystem

I recently purchased a PicoSystem by Pimoroni with the intention of immediately diving in and programming a game; but, I have to admit I got distracted by how much fun Super Square Bros. is to play right out of the box. The overall system feels great as a small portable in the style of the 80s portable LCD based game systems. I’m noticing that the form factor of the system is a bit small for me from a purely functional perspective; but, again, I really like the overall aesthetic and the case is absolutely stellar.

Snake example running on the PicoSystem

As much fun as I’m having playing the shipped game, I decided the weekend was definitely the time to get a small hello world up and running. I’m using Vagrant in order to keep my dev environment consistent and source controlled. Starting from the guide on Pimoroni, I ran into this issue:

CMake Error at examples/snake/CMakeLists.txt:10 (find_package):
  By not providing "FindPICOSYSTEM.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "PICOSYSTEM", but CMake did not find one.

  Could not find a package configuration file provided by "PICOSYSTEM" with
  any of the following names:

    PICOSYSTEMConfig.cmake
    picosystem-config.cmake

  Add the installation prefix of "PICOSYSTEM" to CMAKE_PREFIX_PATH or set
  "PICOSYSTEM_DIR" to a directory containing one of the above files.  If
  "PICOSYSTEM" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!

Which has a workaround listed in issue 4 on the PicoSystem SDK project of providing the path to the PicoSystem SDK via PICOSYSTEM_DIR like so:

git clone https://github.com/pimoroni/picosystem.git ~/picosystem
mkdir ~/picosystem/build
cd picosystem/build
cmake -DPICOSYSTEM_DIR:PATH=~/picosystem ..
make

The next error I hit was:

    default: CMake Error at CMakeLists.txt:2 (project):
    default:   No CMAKE_CXX_COMPILER could be found.
    default: 
    default:   Tell CMake where to find the compiler by setting either the environment
    default:   variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
    default:   to the compiler, or to the compiler name if it is in the PATH.
    default: 
    default: -- Configuring incomplete, errors occurred!

This was addressed by revisiting the initial package installs and adding build-essential like so:

    apt-get -y install build-essential \
                       cmake \
                       gcc-arm-none-eabi \
                       libnewlib-arm-none-eabi \
                       libstdc++-arm-none-eabi-newlib

At this point, the snake example built and I was able to transfer it to my PicoSystem in DFU mode. I’m including the current working version of my Vagrantfile below in case it is useful to others:

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/focal64"

  config.vm.provision "shell", inline: <<-SHELL
    apt-get update
    apt-get upgrade -y

    # pico requirements
    apt-get -y install build-essential \
                       cmake \
                       gcc-arm-none-eabi \
                       libnewlib-arm-none-eabi \
                       libstdc++-arm-none-eabi-newlib
  SHELL

  config.vm.provision "shell", privileged: false, env: {"PICO_SDK_PATH" => "~vagrant/pico-sdk"}, inline: <<-SHELL
    # pico sdk
    git clone https://github.com/raspberrypi/pico-sdk.git ~/pico-sdk
    echo 'export PICO_SDK_PATH="~vagrant/pico-sdk"' >> ~/.bashrc
    cd ~/pico-sdk && \
      git submodule update --init

    # pico system
    git clone https://github.com/pimoroni/picosystem.git ~/picosystem
    mkdir ~/picosystem/build

    cd ~/picosystem/build && \
      cmake -DPICOSYSTEM_DIR:PATH=~/picosystem .. && \
      make

  SHELL
end
Standard

Generating Towns for Townscaper in Processing

I’ve been playing Oskar Stålberg’s Townscaper recently and enjoying seeing how the algorithms react to changes. While looking for information on how garden paths are calculated, I stumbled across Chris Love’s article on the Townscaper file format. Using that as a starting point, I decided to try building up town maps in processing using Perlin noise to determine height, color, and distance above waterline.

My first attempt iterated the map while incrementing a 1D vector in Perlin noise space to determine these attributes. This gave a nice wavy pattern; but, wasn’t quite what I was trying for.

Continue reading
Standard

Classic Computer, Modern IDE

Years ago, I spent a week in the wilderness of Utah.  The night sky was breathtaking; the days were spent in canyons mostly untouched by humans.  It was an amazing experience that I will always be grateful for.  However, by the end of the week, I was happy to return to modern conveniences.

Programming the IIGS on the IIGS feels like experiencing those canyons in Utah and, overall, very authentic. I’ve relived my early attempts in all their glory and frustration. Knowing the convenience of modern development environments, the second part has been bothering me more this time. I am accustomed to syntax highlighting, large screens, fast compile cycles, and all the other conveniences. Thankfully, there’s a solution for this:

With those three packages installed on my Mac, I can develop for the IIGS in Xcode and test in emulation.  This was a very straightforward installation process with one exception.  I did struggle a bit on Step 5 – Install ProFUSE. After some head scratching and overthinking the problem, I realized that from GitLab, I could simply select Repository -> Tags and then filter using the term profuse and a pkg file was provided.

With everything up and running, the function I wrote for the first lesson is formatted and highlighted as I would expect:

Additionally, compile/test cycles are dramatically shortened with this setup. Overall, I feel like this is a reasonable compromise between staying 100% authentic to the original experience and having modern conveniences.

Standard

Revisiting a Past Failure

When I was fifteen, I failed to write a game for the IIGS.  In fact, I failed repeatedly to write any number of games.  I remember the rush of excitement each time I started a new one, followed by the crash of running into the limit of my abilities.  Many hours were spent sitting at that genuine faux wood veneer computer desk (with hutch) that held the machine that was alternately thrilling and frustrating.  Eventually, I moved on to programming other computers without having finished any of those game.

The IIGS, getting ready for the new attempt

Looking back, I question if I was more interested in writing a game or in being the person who had written a game.  I daydreamed about my games being listed in the Big Red Computer Club catalog and how the shareware checks would roll in.  That time could have likely been better spent learning more about programming or the IIGS itself.  At the same time, in hindsight, I was fighting some unnecessary uphill battles.  It took a while for me to realize that I’d need to learn something beyond Applesoft BASIC and then a while longer to save up money for a Pascal compiler.  Some of it was giving up on debugging and playing a little more Neuromancer (which still holds up as one of my favorite games, so I regret nothing on that front).

The monks of Pong asked for fewer years than it has taken me

Having recently unearthed my IIGS, a lot of memories and questions about programming have been slowly resurfacing.  Can I write a game for the IIGS?  How many of the challenges would be addressed by proper tools and books?  Will I instead finish playing Neuromancer?  I’m hoping to find out.

Standard