Month: December 2014

I always loved the building aspect of RTS and strategy games, but while you can build cities or regions, they don’t really have to work. Factorio is a game that puts logistics in the center stage, with a story line based on a geek’s fantasy: build a full civilisation from scratch. Your character starts with a ship-wreck and has to build everything. I’m at the stage where I’m trying to build a car. Basically, the goal of the game is build an automatic supply chain management to provide your character with stuff.

I tried the demo version and was instantly hooked and bought the alpha version. Despite the alpha label, the game plays nicely for the level I tried. As it is written in Lua, the game is available for most desktop platforms. There is a free demo with the introduction stage, be warned, though, the game is addictive. If you want to play on OS X Yosemite, download the experiment releases (0.11.8).

I a previous post I explained how to run the Alpha Centauri game from Good Old Games in windowed mode. This works fine when I played directly on the laptop, but when I connected an external multi-sync screen, the game would still try to the set the game’s resolution and the display would be a mess.

The solution? Tell Wine to disable the XRandR extension. To do this, open the Wineskin app within the Alpha Centauri package, and launch it. The click advanced and, tools and select Registry Editor, there find the X11 namespace under wine and add the key UseXRandR with value N. You can find the list of registry keys and values on the Useful Registry Keys page from the wine wiki.

One subject that pops up often in computer science discussions is design, in particular the idea of a good design and proper abstractions. The idea that can you build an abstraction that will be usable in multiple cases and in the future is very pleasing.

Conversely operating system and libraries are littered with broken designs so that the resulting system are overly complex and brittle. How comes so many people thrive for good designs and so many bad designs see the light of the day? Are there so many incompetent designers? Some evil conspiracy maybe? From my experiences bad designs are mostly the result of two things: premature designing and changes of scale.

Premature designing is what you learn at the university, i.e. writing code that is generic and reusable. Problem is, many people do this before they have concrete plans to reuse their abstraction in another application, often the code ends up being reusable in ways that are not needed, but the abstraction is made needlessly complex to support these use cases.

Unix sockets are a typical example of complexity introduced by generality: they kind of reuse the Unix file abstraction, while at the same time supporting multiple network protocols, multiple messaging semantics. It works for the main protocols (internet and Unix domain), but it is not nice to use, and many older networking protocols have been dropped, you can’t open an Appletalk socket anymore (I doubt this ever worked, but I remember the options being there at some point).

The second problem is that designs, even the most beautiful ones, typically don’t scale more that two orders of magnitude. Consider one of the oldest tools: the knife. A typical knife’s blade is around 20 cm in the length, swords are big knifes, but beyond 200 cm, the design becomes unwieldy. There are small knifes, but below 1cm of blades, the whole design changes. There are many different designs for the same task of cutting stuff, axes, saws, lasers. There is no perfect design.

The protocols that underlie the internet all have scale problems: IPv4 has reached the limit of its 32 bits address space, the retransmission window of TCP cannot cope with fast, long links. TCP also assumes that devices generally have one IP address, which is typically false on all mobile phones.

It took thousands of years to get to the design of Japanese swords, by the time that shape got perfected, the whole sword idea was getting obsolete. Computer designs have by far not reached the beautiful stage. As long as things keep growing exponentially and people keep on reinventing wheels (preferably without the radial symmetry), designs will probably stay clunky and ad-hoc…