Category Archives: News

Syncthing

The latest annoying update from Dropbox made me look around for an alternative.

iCloud, Google Drive and OneDrive might seem like the obvious candidates but I’d rather avoid them. Why? They are too much like Dropbox. Sooner or later they are going to introduce a similarly annoying UI blunder, crippling limitation or an unfriendly plan.

So I decided to try Syncthing instead. Simple, free, self-hosted, with Linux, Mac and Windows clients. Sounds good…

You deleted 9094 files from Dropbox
Yep. Do I want them back? Nah, I’m good.

From a business standpoint it probably makes sense that Dropbox doesn’t offer a pay-for-what-you-use plan but that is exactly what I want. With Syncthing, it’s no problem.

I set up a simple DigitalOcean VPS as a “master” node that’s always online and adding extra storage space is super easy and cheap.

I’ve been using Syncthing for about two weeks now and it seems to be working really well. It is solid software, complete and functional with no extra fluff. Filesystem changes are picked up and synced quickly.

★★★★★ / ★★★★★

Syncthing web UI
The device management & overview of sync status.

The Witness Review

Following the development of the Witness was fun. Jonathan Blow, a very talented game designer, took over 7 years to make it. When the game finally came out, I thought I had seen enough screenshots and read enough blog posts about the process that actually playing it wasn’t necessary.

But one day it went on sale on Steam and I decided to give it a try, just to see if it would run on my iMac at all.

It did. And I got sucked in immediately. From the first minute, it was clear that this was a game for me.

The world of The Witness is vibrant and beautiful. The visual style is perfect. Just the right amount of geometry and texture to make everything clear. Exquisite lighting. I also found it delightful to hear proper footstep sounds for different kinds of surfaces.

The game is designed so that there’s no need for a tutorial, a guide or other hints that would normally be put in a game. In The Witness, those would look out of place. Everything is seamless. No words, no hand holding. You just start playing.

There are several areas on the island, each with a different type of puzzles. The rules are not written anywhere or shown – for each new type of puzzle you need to experiment a little to see what works. Sometimes you get it wrong. The rules you devised worked for the first puzzle or two but not the next one. Go back and think again – same moves, different reasoning.

Generally, the difficulty goes up for each puzzle type as you progress through the area but it is fine to leave and go elsewhere if you get stuck. I was able to finish some areas without much effort, some others I found devilishly difficult. I guess other players could easily have it the other way around because they see and think differently.

Later in the game there are places where you need to combine several puzzle types. This adds more challenge and also acts as a key/lock mechanism to prevent you from going places where you shouldn’t be able to get yet. Find the place to learn what you need and come back later.

Sometimes, after going through a few increasingly difficult puzzles, I’d stumble on one that just made me laugh. A deliberate joke one can only understand knowing the rules and having seen the previous puzzles. This is a nice reminder that the puzzles have been carefuly crafted – not randomly generated.

Running around the island reminded me of orienteering. A person has been there before me, setting up challenges for me to discover and solve.

I was also reminded of OK Go videos. Sometimes it all seems simple and effortless but when you think about it a lot of work has gone into every detail to make it all work. A true sign of a well crafted piece of art.

Excellent game.

I’d love to see a special edition of some sort with developer commentaries in the style of Half-Life 2: walk up to an area, hear a quick clip of Jonathan Blow talking about his intentions and challenges related to that place etc.

★★★★★ / ★★★★★

Trailer

Adam Audio T7V studio monitors review

I do not need everything to sound great. I prefer hearing things the way they were recorded. Good or bad. That’s what studio monitors are for.

With that in mind, I started looking around for entry-level studio monitors to replace my old pair of Edirol MA-15Ds. I decided to get a pair of Adam Audio T7V speakers. It was obviously a big step up.

The speakers look very elegant and clean. It seems a bit like they were deliberately designed to look more simple than some of the higher models – bass port, on/off switch and indicator are all on the back. Nothing wrong with that though, I like the design a lot.

I love the sound. There’s so much detail and depth. I keep revisiting my favourite tracks just to hear all the new things I can discover. The signature “ribbon tweeters” are awesome and I doubt there are any higher frequencies I’d ever be able to hear from any speaker at all.

John Cleese, listening to “Shake Break Bounce” by The Chemical Brothers on T7Vs

There’s more than enough power for my small semi-treated room. My desk was just big enough to let me put them in the proper “triangle” layout.

The Edirol MA-15Ds had an optical input and I had them hooked up directly to my iMac. For the Adams I had to get an external USB sound interface with separate left/right balanced outputs. I got the affordable M-Audio M-Track 2×2 with a nice big volume knob.

I also added a subwoofer. Necessary? No. Would I keep thinking about getting one for the next 6 months after getting the speakers? Yes.

The sub does bring up the lowest frequencies and gives more punch to heavier music. However, this 2.1 configuration brought me some disappointment at first.

My sound interface was plugged into the sub and the speakers were connected to the sub’s output, just like the manual said. I tried to level things out using the sub’s crossover and volume knobs. This turned out to be very hard and frustrating. I couldn’t find a balanced “flat” setting.

I’m sure that pairing the T7Vs with one of Adam Audio’s own subs is more straightforward and could have saved me the trouble but it’s also way over my budget.

Luckily, I figured it out. I plugged the speakers into the sub’s other input! Both the inputs are just soldered together so the T7Vs effectively get untouched source input. Now I can easily tune the sub without affecting what goes into the speakers. Win!

Overall I’m really happy with this new setup. Great sound for a great price.

 

★★★★★ / ★★★★★

Gogs

As I lean towards self-hosted software, I recently switched from Bitbucket to Gogs.

Gogs is one of the best web-apps I have used in a long time. It’s easy to install and maintain, the interface is great and the whole thing is fast.

The issue tracking and wiki are quite minimal but work well. I do miss an equivalent of Github’s “gists” to hold small snippets of code independent of any repository.

Running on a standalone $5 Digital Ocean VPS.

Rant: fman criticisms

Here’s my reaction to a reddit thread where a bunch of people were wrong about something. It was about the fman file manager and how the author had spent over 3000 hours making it.

Some people argued that making a general file manager application was “easy” and the author of fman had spent way too much time making such a simple app.

Wrong! Anyone who goes to make a tool as general and versatile as a file manager deserves huge respect.

Doing a UI prototype for two pane file list that lets you browse files is EASY. Making a file manager that actually helps you manage files is HARD.

Let’s see what needs to be considered when we try to COPY A FILE:

  • Cross-platform
  • All filesystems
  • All OS versions
  • Network volumes
  • Filename length limits
  • Case sensitivity
  • Special character encoding
  • Handle and report errors
  • Detailed progress indicator
  • Estimate remaining time
  • Pause/resume
  • Interactive options to overwrite/skip/ duplicates
  • Symlinks
  • Hard links
  • Correctly copy attributes, even when support varies between src/destination
  • Sparse files
  • Special files such as /dev/zero
  • Block size (20 byte file can use 4KB of disk space)
  • Quotas
  • Channels
  • Compression
  • Encryption
  • Optimize for SSD/HDD
  • Optimize for same-volume and cross-volume, cross-device copies
  • Sandboxing

All this must work 100% of the time, on 100% systems, otherwise someone is going to lose their data.

I don’t even know if fman actually takes care of all that, but my point is that I can imagine one could easily spend a good portion of development making JUST THIS and I would consider it a great achievement if it actually worked.

Alternative music players for Mac

Tiny Player for Mac

  • First and obvious choice
  • Free

Vox

  • Subscription based, from $4.99 / month
  • Cloud storage service

Swinsian

  • $19.95

Tomahawk

  • Hub for online sources

Audio Playr

  • $8.99

Cog

  • Open source

VLC

  • Primarily a video player, but has a playlist and handles audio as well

Bahamut

  • Open source

jmc

  • Open source, media manager

Plexamp

Webamp

Nighthawk

  • Electron based
  • Open source
  • Drag & drop breaks it

foobar2000 for Mac

Development tools 2017

It’s time to do another quick review of the tools I use for game development. Previously:  2006 2012 2014. Here’s the current setup:

Hardware

  • iMac retina 27inch 2015 model with 24GB RAM (upgraded from a 2011 model)
  • iPhone 5 (still alive!)
  • iPad Mini 4

In the hardware section the most important change is definitely the switch to the retina iMac. I got lucky and found a great bargain, had the harddrive replaced with a 1TB SSD and everything is running very smoothly.

My iPhone 5’s battery is dying but I intend to replace it and keep the phone for as long as possible. I only use it for phone calls, playing music & podcasts.

I’d like to replace the iPad Mini 4 with a new model to get a chance to play with ARKit, but there’s no hurry. I’ll probably wait for the next “standard” iPad model that comes out. The Pro models are cool but very expensive and I’m not working on an iOS game at the moment to justify purchasing one.

I borrowed an Apple TV to try porting Superforce but it turned out it would just be too much work because of the completely different aspect ratio. Not worth it. I might try again with Devastro 2 which might work well on the TV if I can get the controls right.

Software

  • Xcode
  • Adobe Photoshop
  • Blender (took some time to learn the basics)
  • Pixelmator
  • Glyph Designer
  • Git

Not much has changed on the software front. Xcode is still fine. I probably have very low expectations from a C++ IDE. It crashes from time to time but otherwise it’s pretty reliable and “good enough”. It’s not what’s holding me back anyway.

Blender is just great. I should practice more.

I pretty much stopped using Pixelmator because Photoshop is so much better and also because it seemed like Pixelmator development had pretty much stalled. Now there’s the Pro version but I don’t see a reason to switch back… two graphic file formats are one too many I guess. Same with keyboard shortcuts.

Still using git, although as a solo developer I’d probably be fine even with Subversion.  Recently I tried to set up a Gogs server to make git usage more friendly but it was too much hassle. Command line and Gitbox is fine, actually. I’d still prefer a self-hosted Gogs over GitHub or Bibucket if I absolutely had to have a web interface & basic task management. It’s a nice piece of software.

Libraries

When it comes to 3rd party libraries, the most important thing is that I started integrating Dear IMGUI into the game. It’s a great library, very well thought out. Apart from a misplaced glFlush() call, the integration was very smooth. The screenshot below shows a IMGUI based property panel in the level editor.

std::chrono vs timer coalescing in macOS

Recently I needed to call a function in the background of a C++ program periodically. I decided to use the STL for the task.

During research, I found a nice article about periodic processing with C++11. The sample code has helped me to quickly put together a solution for my project. However, I noticed that the author was showing average wakeup errors of 20 microseconds on Windows and 96 microseconds on Linux. Running the sample code on macOS yielded errors of up to 2000 microseconds! That is a big margin. I was a little disappointed. My favorite OS is getting worse results… oh no.

But then I remembered that newer versions of macOS employ “timer coalescing“, which tries to save energy by reducing timer accuracy and “bundling” wakeups together to let the CPU sleep for longer periods of time.

Nice, but thankfuly we can turn it off for more accurate testing:

sudo sysctl -w kern.timer.coalescing_enabled=0

After that the errors went down to about 40 microseconds on average. I have yet to look up the proper way to tell the OS that my app needs this, regardless of the global setting, but my curiosity is satisfied for now.

Note: the source code from the article is only provided as a PDF from which it is hard to extract in a usable form, so I took the liberty to publish a plain-text copy here.

Designing a C++ Property System

As I’ve been working on Devastro 2 I thought it would be great to be able to see and adjust properties of the in-game entities in the level editor.

Properties can be generic ones such as position, angle or color but there can also be ones specific only to certain types of objects – for example a “crate” object can have a (bool) property that defines if a pickup item should appear when the crate is broken. An enemy ship can have a property that defines how much damage it can take.

But how does the game know what types of objects have what properties? I guess we’ll need some kind of system for that.

A property system is a way to inspect and modify the properties of objects at runtime.

Implementing this is quite easy to do in languages such as Java or C# because reflection (aka introspection) is part of their runtimes. Also, custom annotations can be used to further describe how we want the properties to be published. But being the stubborn person I am, I’m writing this game in C++, so… how hard could it be? Maximum effort

Use cases:

  • Serialization – read/write properties to a file when saving and loading levels
  • Editing – interactively adjust properties using sliders, checkboxes etc in a GUI.
  • Debugging – inspect objects at runtime

We need to:

  • Get a list of properties for each class in the game
  • For each property, get its type, name and additional info for editing & serialization purposes
  • For a given object instance, get/set the value of each property

I defined several constraints for the system:

  • No custom preprocessing steps (looking at you, Qt)
  • No macros
  • Don’t use C++ RTTI
  • Non-invasive – objects don’t need to register or add getters/setters; this is hard to avoid completely but currently there’s only 1 line of boilerplate declaration to be added to each class
  • No runtime overhead for objects with properties (allow direct access to values when type is known)
  • Simple setup (all properties for all objects defined in single location, DRY for subclasses)

And some compromises:

  • OK to do string lookups but only when editing/loading, not in main game loop
  • Limited set of property types (int/float/bool/string/enum)
  • Limited amount of validation (can set a property to any value, object must deal with it; a value range can be defined as a hint for editor UI but is not enforced internally)

As of now the property system is up and running. Phew! I went through several iterations before settling on a design and it took a lot of effort to flesh it out for all the use cases and integrate it into the game.

Bottom line: Interesting challenge; looking forward to using Jai.