All posts by Tomáš Andrle

D2 log 014 – Video player

The main menu of the game is going to have an animated background. Currently I’m thinking it could be the end of the original trailer put on loop:

As a temporary playback solution I used a series of JPEG files. Not very efficient. When looking for a decent video playback library, I found this one:

A brand new “single-header” library for decoding MPEG1 video, by Dominic Szablewski. Simple API, easy to integrate. It’s great!

In fact, I spent more time looking for my .blend source file than writing code to use the library. In Blender, I switched render output from image to video and set the codec to MPEG1. It all worked the first time I ran the game.

D2 log 012 – Blender pipeline

The new Blender 2.8 is great. Unfortunately it broke my batch render script.

Fixing the script and the rendering setup were quite a challenge due to the major UI changes in 2.8, but eventually I figured it out. Even learned a few new tricks along the way. How did I manage to write the original script without the built-in scripting console? So helpful!

My Blender export pipeline looks like this:

  1. master.blend file with fixed camera & lighting setup
  2. extra .blend file for each asset
  3. link assets into master
  4. for each asset, render object & shadow into separate PNG

First draft of the new script for 2.8:

import bpy
import os
import subprocess

# Requires Blender 2.8
#
# /Applications/blender.app/Contents/MacOS/Blender -b -P render28.py
#
# Notes:
# 
# Node setup: see master.blend -> Compositing
# Render menu -> Film -> transparent
# Shadow catcher plane -> Object menu -> Visibility -> Shadow catcher
# Adding more objects: File -> Link... -> "Collection" from ext. file -> Move to Assets collection in master

basepath = os.path.normpath(os.path.dirname(os.path.abspath(__file__)))
master_blend = "blender28-batch-render-test-master.blend"

src = os.path.join(basepath, master_blend)

bpy.ops.wm.open_mainfile(filepath=src)

bpy.context.scene.render.resolution_percentage = 50
bpy.context.scene.render.resolution_x = 1280
bpy.context.scene.render.resolution_y = 960
bpy.context.scene.cycles.samples = 20

assets_name = "Assets" # name of collection in master.blend
assets_collection = None

for collection in bpy.data.collections:
	if collection.name == assets_name:
		assets_collection = collection
		break

if assets_collection is None:
	print( "Error: %s collection not found in master" % assets_name )
	quit()

# Save original filenames for output nodes
output_nodes = []
for node in bpy.context.scene.node_tree.nodes:
	if ( node.type == "OUTPUT_FILE" ):
		output_nodes.append( ( node, node.file_slots[0].path ) )

for target in assets_collection.objects:
	# Show only the current object
	for obj in assets_collection.objects:
		obj.hide_render = obj.name != target.name

	# Set output filename
	for node, path in output_nodes:
		node.file_slots[0].path = target.name + "_" + path

	bpy.ops.render.render(animation=False)

Master & test .blend files here: blender28-batch-render-test.zip

Example output:

Object
Object

Shadow
Shadow

Composite
Composite

Additionally, I created a simple pipeline for rendering weapon silhouettes for the HUD. With a single click, it pulls in each weapon model, renders it from a side-view, then uses just the alpha to write a single-color transparent PNG.

And similar setup for pickup icons, with a subtle “glow” pass.

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.

D2 log 010 – IMGUI

After experimenting with Cocoa-based editors, I’ve gone back to IMGUI. The panels I had built with Cocoa were beautiful (and I love native Mac apps), but it was too much work.

Building functional interfaces is a lot faster with IMGUI.

Luckily enough I get to use IMGUI at my day job now and I’ve learned a lot since my last attempt to integrate it into the game.

Turns out the problem of IMGUI and my own UI elements fighting for input events can be solved quite easily. I just need to process things in the right order and honor the “IMGUI wants focus” flags.

Superforce temporarily removed from App Store

I just got a notice from Apple that Superforce has been removed from the App Store. Oh no!

Luckily, it was not due to violation of any of the intricate compatibility or privacy rules… it just had not been updated for a while. Not fresh enough!

I’m going to prepare a new build, test it on as many recent devices as I can get my hands on and submit it for review. Superforce is coming back to the App Store soon.

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.

 

★★★★★ / ★★★★★