Post navigation

Just a short one this week, to say: my apologies for the silence over the last month. A combination of an unexpectedly high workload (five different paper revisions to complete in a short time-span), along with caring for an extremely ill relative, and preparing to move 4200 miles across the globe in around three weeks, has been quite challenging. I also managed to send myself on a trip to the Accident and Emergency part of my local hospital, which was all totally excellent, but has put me in bed recovering for quite a few days. And, to top it all off, a side-effect of the far more serious illness I got several years ago has just manifested; it’s not life-threatening, but it’s intensely dispiriting and depressing. I’m still alive (barely) but just absolutely swamped under everything right now; the injury and the new medical issue are both just extra things I could really, really, do without. I thought the past couple of months would be the proper restart on URR’s development, but apparently that isn’t going to happen just yet.

Nevertheless, I’ll be back to 0.8 as soon as possible. Things have to stabilise sooner or later… right?

I’ve now started work on speech variables, which is to say the parts of speech – such as “[god]” or “[rulername]” – which cannot be stored and simply reproduced, but needed to be generated each time they are called in a conversation, and will vary significantly based on context (reply, question, talking about oneself, talking about somebody else, and so forth). These are a pretty crucial part of the conversation system, since it is often through these that the player will get information about the specifics of the game world they’re exploring, and these will enable the player to ask questions about specific artworks, specific nations, and so forth, whilst ensuring that NPCs give logical replies to these kinds of enquiries. Most words are stable within one civilization: which is to say, everyone from one civilization might say “make” instead of “create”, or might be “homeland” rather than “nation”, and so forth. These give every culture a distinctive way of speaking, and in testing thus far they do come across in very unique ways. However, there are always going to be words in their sentences which have to be selected anew every time they are used, and it is these we are now tackling:

For example, “[holybookauthor]” would refer to who wrote the holy book of a particular religion (if known); “[monasteryfield]” would refer to what particular kinds of books a monastery produces (when we have books implemented!); “[mercyears]” refers to how long a mercenary has been a mercenary (that is “merc years”, not “mercy ears”!); “[armyrole]” refers to what a particular soldier the player is talking with does in the army; and so on. Whenever anyone tries to say one of these, the game needs to be able to look up what exact phrase it should use, which means a unique set of look-ups in the game’s databases for every single one of these. It might mean checking something to do with that particular NPC – such as their age or simply what religion they worship – but it might also require the dredging-up of information from a religion, a culture, a geographical location, a series of historical events, and so forth. Given the central role of the speech system to the game and to the player’s abilities to actually gain access to the information they need, it was clearly going to be vital that these systems are detailed, comprehensive, and sufficiently varied to maintain interest over what can be a long playthrough. Equally, as above, almost all of these are going to need unique bodies of code designed to pull out the correct bit of information – and it is this I’ve worked on this week.

The most challenging task this week was, frankly, reminding myself of how the code for sentence generation works, and finding the right “place” in the code to switch out “[god]” for “the Grey Goddess of the Mountains”, or whatever. Whereas for all the last few weeks I have been primarily or entirely adding more content to (or on top of) existing systems, here I was developing some new systems. I had a bunch of comments, and most things have quite logical labels, but there was still a certain bemusement looking at the sentence generation code again and working out how everything actually slots in. Once I’d figured all this out, however, it became clear how I needed to implement these elements, and what elements should be stored and retrieved from which places in the code and the game’s data structure. Last week, I shifted the code that I vaguely call the sentence-converter, which is to say the code which takes a default sentence and then makes it sound different for each nation. This week I’ve also shifted the code which handles these new variables away from where it originally was, which didn’t make a huge amount of sense, and put it alongside the other. Now, when the game cycles through each word in a sentence to choose the correct cultural version, it will also find the sentence variables in the same process, and decide what each one should become at the appropriate time. This is a good foundation for building on next week, and I’ve already begun to sketch out some of the functions that will select the appropriate words and terms for relevant parts of sentence generation.

I have also decided that the system whereby an NPC looks at you and draws judgements about you – see this entry for more – is something that will appear in 0.9, not 0.8. This is because although one can add and remove clothing at this point, one cannot actually gain access to the clothing of other NPCs yet, because a) we have no shops or currency and b) there’s no way to ask people for clothes, have people give you other clothes, even attack people for clothes, etc. So, for now, everyone will just (correctly) believe you are from your home nation. I’ve therefore implemented a placeholder function with space for a full assessment of who they think you are, which can be easily expanded in 0.9.

Lastly, as part of this, some different NPC classes will also give you different greetings; this is part of the placeholder above, and will be expanded in 0.9, but there are now some variations in greetings according to what kind of NPC you’re talking to. A priest, therefore, is likely to comment on religion when they say hello; a servant or slave will be especially shy when they greet you; and so forth. Again, this will be expanded in 0.9 to integrate with the NPC’s judgements about who you are when you talk to them.

Next Week

Next week: with the system in place, I’ll start working on handling the variables themselves, and drawing on the appropriate information, in appropriate contexts, to complete these square-bracketed parts of NPC speech. See you all then!

Well, it’s done. My first book – The Unpredictability of Gameplay, due to be published in 2018 by Bloomsbury Academic – is finished. I’m now just putting the final touches to the formatting on the footnotes and the bibliography, and then in the next few days finally submitting it to the publisher. At my suggestion they have kindly created an absolutely beautiful front cover for the work, which I can’t wait to see printed. I’m not sure whether I can post it here yet, but the moment I can, I will.

As long-time followers of the blog will know, this has been quite an undertaking, both contributing to and being made more challenging by the pretty severe burnout I’ve experienced in the last six or so months. This week I’ve had to crunch absolutely on finishing the book, and although this is only a small blip in my overall return to coding related over the past several weeks now, it has meant that things haven’t moved on from last week: which is to say, I haven’t yet fixed a few small remaining issues with speech generation, and then begun to move onto generating the variables in sentences, such as “[god]” or “[painting]” or “[place]” and so forth. As such, this week I instead wanting to reflect a little bit on the writing process – as I naturally haven’t written a full-length academic monograph before – and talk a little about what I wanted to explore in the work, what I’ve learned which will stand me in good stead for future work, and some thoughts on the future monographs that are presently flying around my brain.

The Book

As long-time readers will remember, the book is entitled The Unpredictability of Gameplay. I first came up with this idea at least three years ago, when I was approached by a fellow academic who edits a book series, who had heard of me and both my game design + game scholarship work, and was interested in getting a book from me. Originally I pitched a book specifically and solely about roguelikes. This was a series about game genres, and nobody had written in the series about roguelikes – nor, for that matter, other related areas like strategy games, the always-nebulous “simulation games”, and the like. I described what this project might look like, and although the editor was interested, it soon became clear that my thought process was inching toward something a little grander, and more conceptual, theoretical and “foundational”, rather than a study specifically of roguelikes. I think this was made clearer when I had a paper published on roguelikes, which I think is the first academic paper I ever had published, which showed me that there was a “market” for roguelike scholarship outside of books. So instead I drifted away from publishing in that series, and instead to publishing a standalone volume, which metamorphosed into a way of addressing a longstanding linguistic vexation. This problem, in essence, was over how we use terms like “chance” or “luck” to describe any kind of mechanical unpredictability in games, and the incredibly breadth of categories like “games of chance” or “games of luck” that encompass everything from slot machines to Dwarf Fortress. These categories – to put it mildly – seemed somewhat too broad. Consequently, the opportunity seemed to be there for unpicking these categories in more detail, and developing a useful framework for understanding perhaps the different kinds of chance, luck, or whatever we might want to call them.

After more discussion with Bloomsbury Academic, the book thereby shifted into an attempt to unpick these categories and find ways to distinguish between different implementations of unpredictability (what in the book I came to call “locations” of unpredictability within a game’s design). As soon as I confirm with Bloomsbury what I can post here, I’ll hopefully be able to post a contents list and that type of thing, but succinctly, the first two-thirds of the book primarily develops a four-part typology for thinking about unpredictability in games, depending on “where” in the game that unpredictability is found (roguelikes have all four, some other genres do not), and then the final third looks at three “case studies” where I think the typology is particularly useful: procedural generation, replay and grinding, and things that players do in order to remove or negate the unpredictability in a game (such as gameplay seeds or save scumming). The idea is therefore to first develop a more detailed way to think about game unpredictability, and then to hopefully demonstrate the analytic value of the typology I suggest in the earlier part of the book. This structure also works because although the book’s primary target audience is game scholars, and the theoretical foundations of the work are pretty dense, I’m also hoping that the work will have some impact for game designers, and indeed, game players. As I look over the final product now, I’m confident that the book does what I set out to do, and with the quality of writing I wanted – although it was certainly not an easy road.

Time and Workload

This book, even once it was my primary working focus, took me around six months of concentrated work. This came after over a year of more general work around it, reading relevant literature, sketching it out in greater detail, learning about some of the case studies I wanted to know but I wasn’t especially knowledgeable about, and so forth. Although I had scheduled ample time and energy, it was still more demanding than expected, and this was an important lesson to learn. So much of writing a book comes not from the actual content itself, and the marshalling of ideas and the analysis of examples and so forth, but rather from all the stuff in-between. Do all of the chapters follow logically from one another? Are there any glaring gaps in what I’ve written? Have I accidentally missed crucial citations? Am I repeating myself enough that people can keep track of where they are in the work, but not somuch that the reader gets bored of reading the same signposting statements over and over? My doctorate, although the same length, by its nature a) was written over a longer period and b) was something that had to adhere to a slightly different set of rules. Dissertations are like books, but they remain different, and undeniably a simpler task; one simply has to produce a good piece of work which at most half a dozen people might read, rather than producing the best piece of work one possibly can, and a piece of work that a large number of people will read. These differences make the writing process into an intense and often challenging process, but also a tremendously rewarding one now that I look back at the final product, and one which also taught me a lot about writing monographs in the future; how to structure my time, and what elements to prioritise which might be less natural and inevitably more laboured than the purely intellectual component.

As a result, I’ve decided to make a few changes for when, probably next year, I commit to a new book project. My next monograph – assuming the proposal is accepted, of course! – will be a) co-authored with a colleague, and b) shorter in length anyway (we’re looking at around 80,000 – 85,000 words). This means, in essence, that I will be writing half a book next time around, and a half-a-book done in tandem with a friend and colleague one can bounce ideas off and who can take over when none isn’t in the mood (and vice versa), all things which I anticipate lessening the mental load significantly. And, of course, again, I’m only writing half as much. Even though (if we get the contract) we won’t be writing this until well into 2018, I’m confident that these shifts will prevent the project from coming to so completely dominate my life as it has in the last six or so months. Equally, the work we’re currently developing the proposal for is primarily empirical rather than theoretical in nature, which – from my experience writing journal papers – is a significant help in the writing process. Marshalling existing theoretical insights and concepts to give sense and meaning to one’s data and the analysis one wishes to perform is, inevitably, a project that is not simpler, as such, but certainly one which requires the author to step less determinedly outside of the existing boundaries of ideas. As such, looking back now, I feel writing this first book has allowed me to establish a kind of “base line”, if you will, for future work, and one which I think will be extremely useful going forward.

The Scope of the Question

Lastly, I was struck by simply the sheer number of previous engagements with somewhat-related topics out there: far, far more people have considered unpredictability in games (understood broadly) than I had imagined, even in the fairly-comprehensive review of existing literature I did in the production of the initial book proposal. Naturally, any monograph is going to draw on a tremendous amount of previous work, but in the process of developing a truly comprehensive look at the field I found myself citing a larger number of other scholars or game designers than, I think, almost any other book-length work I drew on. In part, I think this is a consequence of wanting to produce an explicitly foundational work for thinking about game unpredictability, which therefore necessitates making sure I’m being exhaustively detailed about other relevant literature; but also, in part, I was amazed by how much previous work there has been examining game unpredictability – yet without unpicking sweeping categories like “games of chance” or “games of luck” in greater detail! This ranged from anthropological work looking at ancient board games, examinations of the rise of casinos, or the growth of statistical thinking and games of chance in the Renaissance, or the relationship between unpredictable games and religious divination, the role of unpredictability in game theory, and far more besides.

This led to an experience quite unlike that of simply writing a paper, because although one is forced into brevity for a literature review, that sits in keeping with the nature of an academic paper more generally. One’s focus is expected to be more narrow, and thus a shorter literature review is not just appropriate for the length of the work, but also for the far more precise focus of any paper compared to any monograph-length work. By contrast, here – both due to the scope of my project, and the tremendous range of previous work in the area – a truly sweeping review of existing work was needed. This only continued to grow as time went by, eventually far exceeding any possible epistemological boundaries I might have imagined at the project’s start. This, equally, struck me as a crucial lesson about the delineation of one’s project in a book, and something I think I would have benefited more at the start of this particular project. Although the final product is as good as it could have been, the process could definitely have been improved by applying what I’ve learned here about how profoundly vast the body of work one draws upon in a book-length project can become, and in the importance of circumscribing more clearly the boundaries in which you are going to work. Again, as above, because my ambition was to write a foundational work this was inevitably going to need to offer the more reader an even more thorough review of the existing space than most, but looking back over the process, a tighter focus in the future will definitely aid in writing.

Final Thoughts

Overall, and despite a slightly bumpy road, I’m extremely happy with the final product. Numerous proof-readers (academics, game designers, and others) have been extremely positive in their comments whilst also giving valuable critical feedback I’ve since incorporated into the final version. At the same time, the process of writing monographs is now infinitely clearer to me than it was two years ago, and I am confident that moving forward it will be a process that will more streamlined, and less damaging to my work-life balance, than it was in this first iteration. As above, a second work is currently in development (to write in late 2018), and I also pretty much know what my third book will be (2019/2020?) – I’m excited about both of these projects, but even now I’m already applying the lessons learned here to their very earliest stages of development, aiming to build on my strengths I discovered in the process of writing this first book, and mitigate, streamline or evade some of the challenges or problems. As for TUOG, I’ll be posting more about the work as soon as I can and I’ve checked what I’m allowed to put up here, including, hopefully, an introductory chapter. In the mean time, this coming weekend I’ll be back to working on URR’s sentence variables: see you all then!

This week has been a week of consolidating everything that was in place so far, continuing to test and refine and test and refine over and over the speech generation and the flow of sentences, moving around some of the code so that it can be handled more efficiently, and thinking about handling sentence variables in the future, which is to say, the parts of sentences which are things like “[god]” or “[nation]”, and therefore have to vary every time the same sentence is uttered. As such, here’s this week’s fairly substantial update:

Thanks to some great suggestions left in the comments list in the blog post from two weeks ado, I’ve added in a number of new responses. If you’re asking someone about a potentially suspicious topic, and you’re in a region with guards, they might (if they really like you) say something like “You shouldn’t ask such things, the guards will think you’re a spy!” or something of that sort.

Equally, if you’re asking a particularly “academic” rather than “practical” topic – the difference between “what is the nearest mountain range?” and “what is your religion?” – they will sometimes, very rarely, say “I don’t know, but you should go and ask [expert]”. I think these are both great changes, and again, add even more speech detail to the potential library of sentences the player will actually encounter. However, again, to prevent farming, there’s now basically a hidden counter, which varies significantly from iteration to iteration, and affects how often people will recommend that you go and talk to somebody else about the topic in question; equally, you need to be talking to people who both a) have the knowledge and b) have the inclination to recommend an expert, which will be a fairly small number of NPCs.

I then spent quite a bit more time developing the above in order to maximise the detail that people can offer the player, the variation in the sentences the player will read, and integrating all of this will knowledge and mood modifiers. So, now, if you hang around in a shop, and then a random person comes in, and you ask that person about the currency of their nation, for example, if they don’t want to respond they will point you towards the merchant in that shop, knowing that a) they and you are in a shop and b) you are asking a question that it would be relevant to talk to a merchant about and c) there is also a merchant in this shop.

These responses also vary depending on whether you’re in the nation or church relevant to the person you’re speaking to. So let’s say you ask someone something, and the relevant answer would be “You should ask a noble”. If you’re in the mansion of a noble from their civilization, they’ll say “You should ask a noble, such as the one in this mansion” or whatever; but if you’re elsewhere, they’ll say “You should ask one of our nobles, who dwell in accommodations like these”; if you’re right nation but outside and in the right district, they’ll say “You should ask a noble; several have their mansions here”, or in wrong distract, they’ll say “You should ask a noble; many dwell in our richest district”. Equivalents in a foreign nation would be “You should ask one of our nobles, who dwell in a district much like this”, or “You should ask one of our nobles, who inhabit the richest part of my home city”. The game can therefore now generate appropriate sentences both based on the player’s location – right building, right district, or just overall right region, or overall incorrect region – and the relationship between the person you’re talking to and the area you’re talking to them in (especially relevant when you run into people who aren’t native to the state they live in, for example).

I have to be honest and say that I’m extremely happy with how this context-specific recommendation system has developed; I’m really hoping this will produce some strikingly specific procedurally-generated sentences for the player to encounter in appropriate situations, and as ever, just generally provide greater variety in the conversation system. There are also a bunch of sentence possibilities which might be generated that I know are currently impossible, but might become possible later once the potential actions and schedules of NPCs expands further.

Going back to repeating questions, if you ask X, and then you ask X again, sometimes on the first repetition people will now be confused rather than annoyed or bothered; they’ll say “Didn’t we just discuss this?”, or “That’s strange, didn’t I just answer that?” or something like that; the potential mood drop will be the same, I think, but it’s just another little bit of detail for some NPCs.

Thanks to an outstanding suggestions left on the Bay12 forums, there is now a little bit of extra conversation detail in there which I hadn’t thought of. If you ask something, and get a positive response (they answer your question), when you say the next thing you say, it’ll normally start your next question with “Thanks” or “Understood” or “I appreciate you letting me know” or things of that sort; equally, if they didn’t reply, your next thing will often start with “Apologies” or “Ah, okay” or things of that sort. This adds a nice little bit of extra flow to the conversations; naturally even more flow will be added once they can ask you questions back, but for the time being, putting these in 50% of responses definitely makes everything look a little more human once more.

Next week’s blog entry will be a little different: I’m in the final fortnight of the extension period on my first book, and this week’s absolute priority is finishing that off. Next week I’m going to have the first non-URR entry since development restarted and write up some reflections on writing such a long piece of work about games, what I’ve learned from it, my future writing plans, and so forth; there’s just no way I’ll have more than a little time in the coming week for programming, and I’d rather return with a blast the week after. See you all next week!

Only a short update this week, I’m afraid; this week I’ve been busy putting some of the final touches to my book and haven’t had as much time to program as I wanted; only half a day rather than a full day. As such, this week’s update is very short, but next week’s should be longer. However, in light of my new decision to have a gradual update log, I’m still going to do this post and then next week’s, instead of compressing both updates into one longer update. As such, this week:

Most centrally, I’ve finished the task of moving the code that exchanges default words for the preferred word of a given civilization. In some cases this was being called twice, and in other cases not at all, and even though in some cases it was correctly being called once, the range of situations this was being used in were making it all rather unclear. I’ve finished making this shift, which required moving around quite a bit of the sentence generation code and adding some new code to re-handle things like punctuation and capitalisation, but I think that’s now done and working correctly.

I’ve been going through and removing a lot of phrases, and a lot of word orders, which sound strange. As several people have pointed out, sentences could sometimes come out rather strangely; I’ve tried to fix as many of these as I can. At the same time, though, some of the interesting but logical sentences are generated from the same sources as the interesting but illogical sentences; it’s tricky to strike the right balance here. As ever, I think this will just need lots of playtesting.

Just stated sketching out (on paper) a list of the bugs and small issues that need to be resolved before 0.8 is released; I had a bunch of smaller lists of this sort, but I hadn’t really collated them into one place before. For some of the bugs I’ve decided they don’t need fixing until 0.9, and some of them I decided it was easier to simply remove the thing that caused the bug (temporarily) than to fix the bug now; as I’ve said several times, I’m really trying to do the absolute minimum now required to get 0.8 released, and putting some of this stuff off until 0.9 is definitely the way to go.

I’m afraid that’s all for now, folks. Should get a full day to code next week, so should be back with a larger update next time around. See you all next weekend!