Skip to: main content or site footer.

Text in games

Hi all, Liam again. For today's blog, I thought I’d share an issue we've been wrestling with throughout the development of Sunless Sea. Almost from the first moment we started right up until yesterday, we keep encountering this bizarre limitation that we need to find a solution for.

Text. Text just doesn't play well with game engines.

It’s worth defining at this point what I mean by ‘well’. It renders fine, it's not as if we can’t put text up on screen. For a company like Failbetter, that would be something of a dealbreaker.

No, it’s just that, by default, what you are capable of doing with that text that is very limited. We’re coming from developing a story-driven browser game, and we quickly learned how many expectations we were carrying over with us from the web.

Admittedly, browsers haven’t always been great when it comes to rendering text, as any designer transitioning from print to web design will tell you, repeatedly, and at length. However, it's getting better all the time and there are plenty of tools at the designer’s disposal to make text formatting for the web attractive and easy to read.

Text in games is a very different kettle of fish. Think back to some of the more text-heavy games you might have played. It’s hard to pick any titles that had print-like (or web-like) text formatting; it has traditionally always been a very plain affair. One font size, no emphasis through bold or italic text, a paragraph break if you’re lucky. The reason for this is that, to put it simply, games treat characters like images. A font is a big texture with each letter on it and the game shows you a small piece of that image at a time. It can tint the image, but not much else. Want it to be larger? Use a different image. Want it to bold or italic? A different image again.

I suppose this is because there haven’t been enough games that have needed the kind of fine control we're talking about. If you want to attempt advanced text effects in a game you're straying off the beaten track. If I want to write some code to introduce realistic handgun ballistics into a game, I'm probably a web-search away from a mine of useful articles, tutorials and tech demos. Try to find a way to italicize a key word in a block of text and suddenly it’s as if you’re the only developer in the world!

That’s an exaggeration of course, there are games that do text formatting well, and we have found solutions to all the problems we've encountered, but it’s still been interesting to find that the area that we're having to find work-arounds to make up for inadequacies in the engine is something we almost take for granted in our other games. The solution that we have implemented eventually involves treating each collection of uniquely formatted characters in a block of text as a separate object, so we can use a different image for each of these sections, rather than referencing the same one. This way, we can switch between font formatting mid-sentence, rather than having to have each block of text all look the same.

I think we've got it working pretty well now, and it’s nice to know that the writers on the game will have the tools at their disposal that they are used to using.