Moments of Inertia by Rachel Crawford

About     Archive     Categories     Tags     Feed     Projects     Magewinds     Warcry Card Creator    

2017 in Reading

One of my goals for 2018 is to ready 20 books. That’s about 2 books per month! So far I’m enjoying doing more reading, because over the last few years the amount of books I’ve managed to get through has really dropped off.

Time to reflect on some of what I read last year.

The Economics of Enough

A book by Diane Coyle (who incidentally was on Planet Money’s The Indicator podcast this week). I read this towards the end of 2016 and finished it in January 2017, so I don’t remember the details very well, but I do remember finding it interesting. Being a book about the future of civilisation, it has its share of gloomy forecasts, but it has a positive message, too. We can, in fact, solve (or at least handle) these problems that face us in the 21st century: climate change, the financial meltdown cycles of capitalism, overcompetition for natural resources, economic inequality, the crisis in democracy…

There’s a lot of them. Diane’s presents some of her solutions as almost inevitable, sooner or later, and that the longer they are delayed the more damage will fill the gap until their implementation becomes unavoidable. Her main suggestions are, in brief and broadly:

  • Improve how progress and production is measured and statistically analysed. How are we to address any issues if we cannot fully understand their scale and their causes?
  • Encourage saving of money and discourage spending, in particular on high-carbon consumption. She advocates taxation on consumption. Promote investment in projects with long-term benefits, rather than short-term returns.
  • Austerity is okay if you convince the public that it’s for a good reason.Cuts in public expenditure are “inevitable” as is “reforming the provision of services”. Yeah, uh.
  • Reduce income inequality.
  • Experiment in how to re-engage disengaged citizens with public policy-making processes. With the Internet?
  • The Office for Budget Responsibility is a good thing, in principle, because it has “an explicit duty to take account of the long-term and future generations”.
  • Countries should just go ahead and address the issues of climate change as best they can, with or without international agreement. They certainly shouldn’t wait around for that to happen, anyway.

The Mythology of Work

I don’t remember much about this. It comes from the right place, one of deep skepticism about the mores that bind us to the millstone, but it is not written well or accessibly. I found it a little masturbatory, to put it bluntly. And not in the good way.

Which made me sad. I would like to be able to recommend a book on this subject to people.

The Goblin Emperor

I enjoyed this! It’s about a guy who gets catapulted overnight from royal family reject to improvisational imperial majesty. The reader shares his POV as he navigates his way through the tumultuous waters of his first year of emperor-hood, dodging schemes and plots galore. The setting is kinda cool, with baroque, almost steampunky elements, and some excellent made-up names, like Varenechibel and Edonomee.

Take my review with a pinch of salt. I read the book on the flights to and from San Francisco, and I appreciated perhaps more than I would have otherwise because it allowed me to escape into a fantastical world in which people have leg room.

The story has progressive leanings, but I find myself agreeing with Lyta Gold’s opinion that

Novels like The Goblin Emperor are especially disappointing because they’ll go out of their way to include genuinely progressive elements – acknowledgement of inequality, protagonists of color, gay characters, heroines who persist – but consistently stop short of portraying anything resembling large-scale political or societal change.

Hmm!

Scotland the Brave

Something about the past and future of Scotland as a place in the world. Positive!

The Knowledge Corrupters

Isn’t it great how much effort some factions put into undermining the ability of people to reach political consensus, or indeed any kind of agreement at all, by sowing distrust in scientific sources and demolishing the integrity of the journalistic profession? All so they can make more money?

Thunderbird

Chuck Wendig continues his flawless streak as the writer of Miriam Black, hardcore detective extraordinaire who can see how you die. This is pure edge-of-your-seat excellence, like the preceding three novels in the series. Not much more to say about it than that. It’s just good.

The Shepherd’s Crown

It took me a long time to get around to reading this one because it felt like finally saying goodbye to an author whose books played a massive part in raising me from childhood to young adulthood, laughing, crying and thinking all the way. He’ll never really be gone, though. Not while his characters are still taking readers like me on adventures they’ll never forget.

The Gates of Azyr

A horror story. I am not referring to the novel, but to the following sentence: I read a Warhammer novel. My first. And the really scary part? It’s not my last.

The Joy of Tax

Richard Murphy on what exactly tax is, and how it’s an indispensible tool for shaping the economy and addressing social ills like economic inequality and excessive carbon consumption. We should all care about it a lot more, and put to flight the school of thought that says that tax is inherently evil. He proposes a lot of ways to improve the United Kingdom’s tax system, as well as providing some useful lessons on how money works.

Here is Richard Murphy defending his book against David Cameron, who made a joke of it at the Conservative Party conference. That will probably make you want to read it more.

Rethinking the Economics of Land and Housing

More economics. A guided tour of how badly messed up the market for land in the United Kingdom and a number of other Western economies is, and how it messes up other areas of those economies. The book is in agreement with The Joy of Tax about a number of things, like how bad council tax is, and how we should probably tax land ownership. I found it quite interesting, but a little dry and technical in places, like its title. I might re-read it to see if I understand some more of it.

Quiver Presentation at C++ Edinburgh

On December 11th I gave a talk at C++ Edinburgh about my hobby project game engine, Quiver. I was barely prepared and kind of blundered my way through it, but the audience seemed to enjoy themselves, and I certainly had fun. Somehow I ran to over 30 minutes, when I thought I had only been going for 10. Time flies! The recording is below.

I made the presentation slides using React.js because I wanted to try using something that’s not PowerPoint or Google Slides. It worked, but there’s something odd about needing to run a web server in order to present some slides.

You can view the slides here.

Introduction to std::chrono

How many times have you tried to call a function that alleges to return a time value only to realise you don’t know what units the value is in? Or that takes a time value as a parameter, but doesn’t specify whether the value is expected to be in milliseconds, seconds, or hours?

// What is it? I guess milliseconds? Could be microseconds!
int GetGameTime();

// deltaTime is probably in seconds?
void TakeStep(const float deltaTime);

Hopefully there are comments somewhere near the declaration of the function that can help straighten things out, but you may not be so lucky. You may have to read through lines and lines of code to see how these functions are used before you understand what units they use.

APIs like this are hard to understand at a glance and can cause a lot of bother. Consider the potential cost of a bug that occurs when an API expects milliseconds, but is passed seconds. Here’s a slide from Bjarne Stroustrup’s CppCon 2017 keynote:

…in which he pointed out that the failure of the Mars Climate Orbiter was due to a software bug that would have been completely avoidable had a particular API encoded the units of measurement it used (in this case, imperial instead of metric).

UPDATE: STL pointed out in a Reddit comment that Stroustrup’s slide is wrong! But the sentiment is correct, anyway.

And so we have strongly-typed time values like C#’s System.TimeSpan provides. In the world of C++, many libraries and frameworks have their own time type. For example, SFML has sf::Time and sf::Clock. sf::Clock::getElapsedTime returns a sf::Time, which can be compared to, added to and subtracted from other instances of sf::Time. Then it can provide its value as seconds (float), milliseconds (int32) or microseconds (int64).

Until C++11, the language didn’t have a standard way to represent times. Then chrono was added to the standard library.

chrono exists at a higher level of abstraction than sf::Time/sf::Clock. The library consists of three concepts: clocks, time points and durations.

Clocks

Clocks are time providers, consisting of a starting point (“epoch”) and a tick rate. A clock has a now() member function that returns how much time has passed since the starting point. The standard library provides three clocks for your basic out-the-box time-getting functionality, the main one being system_clock. If you need to, you can create your own class or bundle that satisfies the Clock concept.

Time Points

time_point represents how much time has passed since the start of the clock it is defined in terms of. For example, a time_point<system_clock> would record how long since the system_clock started. You’d initialise it like so:

time_point<system_clock> t = system_clock::now();

You won’t be able to initialise it with the now() of a different clock because its time_point type isn’t convertible to that of the original clock.

time_point<system_clock> u = steady_clock::now(); // Error!

(Note: because high_resolution_clock may be an alias to system_clock, it may be possible to convert between their time_point types. Don’t count on it, because your code may not be portable if you do.)

At runtime a time_point is a simple arithmetic type like an int or a float, and it can be added to and subtracted from other time_point instances, as long as they all come from the same clock.

Durations

A duration is, like a time_point, just a puffed-up arithmetic type. Unlike time_point, it’s not coupled to a specific clock type at compile time.

Along with its runtime value the duration contains a compile-time ratio specifying the units of time that value represents. A ratio of 1:1000 means milliseconds, a ratio of 1:1,000,000 means microseconds. The default ratio is 1:1 – that is, the default units for durations is seconds. The standard library defines some ratios for us in the <ratio> header.

You declare and set durations like so:

(duration::count returns the value of the underlying arithmetic type.)

// integral representation of 10 milliseconds
std::chrono::duration<int, std::milli> d(10);
// d.count() == 10

d = std::chrono::milliseconds(5);
// d.count() == 5

d = std::chrono::seconds(10);
// d.count() == 10,000

Casting from seconds to milliseconds can happen implicitly, but in other cases it is necessary to use duration_cast.

User-defined Literals

These are wonderful little things of which chrono provides a handful. The s literal, for example, turns its operand into a duration<unsigned long long> or duration<long double>.

using namespace std::chrono_literals;

// integral rep of 1 second
std::chrono::duration<int> t1 = 1s;

// floating-point rep of 1 second
std::chrono::duration<float> t2 = 1s;

// floating-point rep of a fraction of a second
std::chrono::duration<float> t2 = 1ms;

Conclusion

Finally, here is the API from the beginning of this article, rewritten to use chrono:

#include <chrono>

std::chrono::duration<int, std::milli> GetGameTime();

void TakeStep(const std::chrono::duration<float> deltaTime);

And we can all sleep a little better at night.

UPDATE: Reddit user kalmoc mentioned Howard Hinnant’s date time library. I haven’t used it yet but it looks like a useful extension of chrono.

My 2017

I did a some really cool things this year.

For one thing, I settled into my job. I have a long way to go and so much more to learn, but I feel like I’m in the swing of things now. I still find it amazing that people are willing to pay me to write code for games, surrounded by awesome people in a lovely office. I’m very excited about what I’ll get to work on in 2018.

In February I visited San Francisco to attend Game Developers Conference (GDC), an amazing opportunity to rub shoulders with people from all across the industry. I wouldn’t have gone if Connor hadn’t invited me along with him, so I’m very thankful to him for that. You can read all about my GDC experience here and my time in San Francisco here.

In the summer I took a few days off work to attend two short courses at Edinburgh University. The first was “Scottish Politics in Context”, which was a whirlwind tour of Scottish politics from the early modern period to the recent upheavals. The second was “Introduction to Solar Power”, a one-day course that explained the many ways we can use solar power, from heating water to the various kinds of photovoltaic cells. We also got to make our own PV cells using blackberry juice as a dye, which I didn’t know was even possible. I’d recommend both courses. I’m definitely going to do some more short courses this year coming.

In October me and Natalie went on holiday to the South of France, my first actual holiday out of the country for years. It was excellent.

My Mum moved house, so I had to say goodbye to the house I grew up in. I felt sad, but the process made me realise that I’ve well and truly moved out – her house hadn’t felt like my home for several years. Her new place is great, anyway, so it’s all worthwhile. (It also made me think about the Edinburgh housing market (Holy shit! (What the fuck?)))

In the latter half of the year I reached out and became an attendee of C++ Edinburgh, the local C++ usergroup. Everyone who attends is nice, works on cool stuff and has a lot of knowledge to share. In December I gave a short presentation at the meetup about my game engine, Quiver, which was quite good fun. I hope I can fit in some other meetups in 2018.

Speaking of Quiver, that project chugged along a fair bit, although I struggled to commit enough time to it. I finally came up with a good name, so it’s no longer just “the Quarrel engine”, and I made it open-source. You can check it out on GitHub. I look forward to continuing to tinker with it next year – there’s a lot of work to do! Maybe I’ll actually make Quarrel into a playable game! (Ha ha!)

In short, my 2017 was a blast. Just about everything that could have gone well went well. I have a lot to be thankful for. I live in a lovely flat with a lovely flatmate, I have excellent friends and a wonderful girlfriend, I love my job and it seems to like me. I know that 2018’s going to be a tough one (both professionally and personally), so I’m glad I get to begin it on the best possible footing.

Thanks for reading. I hope your 2018 is productive and peaceful.

2017 in Gaming

The annual roundup of games I played this year, both physical and digital, and gaming-related things I did, most of which I didn’t get around to writing about. Let’s get started.

Tolva

A standout for the year for me was Big Robot’s lonely, exploration-driven first-person shooter The Signal from Tolva. Part Stalker, part Ian McQue painting, it struck such a chord with me that I took the time to write a review of it. I’ll let you go and read that instead of nattering on about it here.

Blood and Wine

I completed The Witcher 3’s second expansion, Blood and Wine. Its writing isn’t quite as impressive or thought-provoking as Hearts of Stone, but it provides an exciting adventure and fitting farewell to the franchise and its characters. It also contains a whole new region to explore, which I did at length simply to bask in how gorgeously colourful and sun-drenched it all was. Quite a change from the main game’s grim and stormy lands. I hope Geralt enjoys his retirement in Toussaint.

A Return to Tyria

The announcement of Guild Wars 2’s second expansion prompted me to revisit that game and finally level my character to 80. On paper, Guild Wars 2 is an iteration of the MMORPG formula ideally suited to me. It’s super easy to drop in and out of, welcomes solo players, has actually entertaining combat (a real rarity in MMOs), and above all has no subscription fee. But there’s something missing, something that I don’t think is the game’s fault. It’s me – I just don’t have a network of other people who play the game who can motivate me to play the high-level content and get the most out of the game, and I don’t have the time to build one. I dunno, maybe I’ll pick up the expansions at some point just to play through the content I can do on my own. I sure do like the look of those mounts.

Warcraft III

I reinstalled Warcraft III recently. It’s still awesome. Blizzard have released a patch that makes it play nicely with widescreen monitors and removed the requirement to insert the disc to play, as well as make it possible to switch between the base game and the expansion from the main menu, so now is a great time to revisit this classic. I’ve been stomping my way through the campaign, which is still probably the best example of linear storytelling in a strategy game.

The editor is also the best thing ever. I used it to make a map for Natalie as a birthday treat and rediscovered what an awesome tool it is. It’s super easy just to make something that looks cool, and the scripting system is very accessible and friendly. It’s no wonder that this is the editor that spawned Defense of the Ancients, a custom map that spawned the ultra-successful genre of games like League of Legends and Dota 2 (for which there still isn’t a good name). I was never into DotA, preferring to explore the vast sea of other amazing things people had created using the editor.

Total Warhammer

I’ve been a fan of Creative Assembly’s Total War series ever since its first outing, Shogun: Total War, set in feudal Japan. I’ve also always had a thing for Warhammer. So picking up Total War: Warhammer was a bit of a no-brainer. Steam says I’ve played it for 20 hours, so how come I feel like I’ve hardly touched it?

Well, it’s a bit of a slog. I enjoy it, but it’s incredible how long it takes to make progress in a modern Total War game. And not just because of the long loading times – these games are timesinks by design. That would be okay if I didn’t have a million other games to distract me away from it.

I hope I can get to a point where I feel like I’ve got my money’s worth out of Total Warhammer so I can buy myself the sequel, which by all accounts is a bit more rewarding.

Miniature Matters

In the latter half of the year I discovered (or maybe re-discovered) the joy of painting miniatures. And while I’ve certainly thought a lot about actually playing a miniatures wargame like Games Workshop’s Warhammer: Age of Sigmar or Joseph McCullough’s Frostgrave, I haven’t actually. Yet.

The closest I’ve come is Games Workshop’s fantastic new release Warhammer Underworlds: Shadespire. It has miniatures in it, but it certainly isn’t a wargame. In fact it’s a board game, and a very elegant one at that. For a few weeks after it came out me and a friend from work were playing it multiple times per week, discovering and mastering its systems. No two of our games were alike. I’m not totally sure about the longevity of it, but I have high hopes that I’ll still be playing it years from now, and that it will have evolved into something even more engrossing.

So what did you play in 2017?