Fairly recently I found out about Ludum Dare, the 48-76 hour game making challenge. Since I had just begun learning the basics of Unity, I decided I wanted to join the thousands of others who compete to get positive votes on their games.
For the December competition, the theme was “one room,” but during the theme voting phase, one of the potential themes was “you are the projectile.” This stuck with me, and I thought it would be cool to make a VR game where you are the projectile. So I made the game, and put it in a single room scene.
I’m pretty proud of what I was able to accomplish in a long weekend. Out of 2390 games submitted, mine ranked #340 for the “fun” category, which puts it in the top 80% of all games in the competition. I’ve also had friends play the game, and the feedback has been pretty positive.
The premise is simple: you are in a room with lava on the floor and several blocks set up on a table. In VR, you use your head to aim a cannonball, and then press the button to launch your ball to knock as many blocks as possible into the lava. Here are some gameplay gifs:
I love watching time lapses. I’ve even made some of my own in the past, for work and for fun. So, when I moved into a new apartment with construction going on right outside my window, I knew I had an opportunity to capture its progress using time lapse photography.
This is the guide I have been using to construct time lapses from a collection of photos.
Unlike some of the time lapses I’ve done in the past, this one is expected to go on for at least a year (or more depending on how long I stay in this apartment). That means that the system I set up has to be robust and reliable so I don’t miss large chunks of time. However, I’m also very frugal, so I wanted to be able to do all this with a $20 android phone.
In order to store thousands of photos reliably, I decided to FTP them to a server, rather than trying to store them all on the phone’s SD card. I found that the impressively featured MobileWebCam app for android could save straight to an FTP server.
Originally I set up my ZTE Maven on my windowsill. Unfortunately, the charging port is on the side of this budget phone, so it had to be “upside-down” as far as MobileWebCam is concerned. This meant for a little more post-processing in VirtualDubMod to flip the image.
A sample upside-down image of the construction
Once I was happy with the phone’s capabilities, I decided to spend a few more bucks and mount the phone properly. I got a goose-neck mount and attached it near my window. Now my phone could have a clearer view, and it isn’t upside-down!
Phone in goose-neck mount
Making it Reliable
I wanted this system to take photos ad infinitum without me having to worry about the phone crashing or the connection to the FTP server breaking. Initially I had a calendar event every week to manually check the FTP folder and see if any new files came in. After a time, this got to be quite annoying, although I did catch the phone freezing a few times during this period.
There had to be a better way, so I thought of a reason to dust off the old raspberry pi: a python script to automatically check on the time lapse every day. I wrote the script (you can find it on my GitHub), and set up my pi to run it daily as a cron job. Basically, the script sees how many files are in the FTP folder, compares this value to what it found last time, and then sends me an email with the status. Much better than having to do it myself! Here’s an example email I would get:
Timelapse is working! We got 150 more files since last time for a total of 8234
Creating the Video – Challenges
Every so often, I will compile the photos taken into a time lapse video. Per the guide referenced earlier, VirtualDubMod is an excellent free choice for creating such a time lapse. Though VirtualDubMod is pretty picky, and it requires all image filenames to be contiguously numbered (such as 1.jpg, 2.jpg, 3.jpg, etc rather than 1.jpg, 4.jpg, 5.jpg, 8.jpg).
Generally this problem is solved using a bit of software called Ant Renamer, which can enumerate files with ease. The tricky part is that once the files are transferred from the FTP folder, the “created date” becomes the time the file was transferred. So the only way to sort the files is by name. This soon becomes a problem when you have files named something like: