Hello everyone! Welcome back.

Those who are long term readers will know that I’ve been working on procedurally generating universities for a while now, with the intention of this now being the place where the player starts, both in the next versions (0.10.3 / 0.11) and indefinitely into the future. I wasn’t expecting this to be this week’s blog post however, but the other two which are currently part-written are not finished, and there are aspects in each one which needs some more thought before they can go live. As such, unexpectedly, this week’s blog post is a huge new feature post, with the focus on – universities! I don’t know whether any other game procedurally generates institutions of higher education, so this may well be a first, but regardless of whether not it is, I’m incredibly happy with how these have turned out. There’s a lot to say here, a lot of discussion, a lot of screenshots, and I’ve tried to explain a lot here about why I think this will be a really logical and sensible start for the player when they beginning a new game… so let’s get into it.

Universities

For a while now starting outside an upper-class building in a city district hasn’t really necessarily meant a great deal in terms of conveying information to the player and giving some sense of what they’re doing and what they’re meant to be doing, so I thought the time had come to make a major change here. In some recent previous blog posts I had commented on the intention to shift the player’s starting location over to a university rather than a fortress, and that has now started to take shape! I’m really happy with how these are coming along and really excited about what these are going to allow me to do; I also think there’s a nice novelty in not starting in the player in the city and allowing them to come to their nation’s home city or their own accord, or of course to simply immediately move out into other lands before ever coming to a city at all.

So the first thing is to place universities and name them. The game now tries to place universities as far from other structures as possible, again because I like the idea that the player starting out at the university doesn’t have an obvious path to take once they leave – i.e. they could go anywhere – and because it again contributes nicely to filling out some of the emptier parts of the world map. For example:

As for the second part, the game now generates one university in every starting nation – though there will be two or three universities in nations with the “scholarly” cultural preference – and gives it an appropriate name drawing on any one of a number of different archetypes. Here’s a set of university names from one world generation, showing some of the variants that might appear for particular religious nations (you’ll note here two universities from a religion that worships a Lovecraftian god with six arms, though this could be anything, of course, depending on the world), or imperialist nations, or pastoral nations, or whatever it might be:

And here one is, being viewed on the world map in-game:

Once the placement and naming are done, the game then decides what should be on each university campus; in general the more intellectual the culture and interests of the nation the more buildings will be in a university (and the larger they will be, the better equipped, and so forth) while the more populist or isolationist a nation, in general the fewer buildings you’ll find and the smaller they will be. Aside from that other policies might yield particular buildings or rooms within university buildings, so a stratocracy or a nation with a standing army will always have a recruiter and lots of soldiers around the university; a religious freedom nation has a “hall of worship” building containing all the various altars and priests for the various religions present; a theocracy or a nation with the “zealotry” religious orientation will always have a religious building on campus; a slaving nation will have slave quarters on campus; an aesthetic-focused nation will have a gallery on campus; and so forth. Some universities will therefore be huge and varied, some small and minimal, and others in the middle.

As for generating them, well, let’s get to that now. Firstly, the basic layout of the university is (like many things) based on the aesthetic / shape preference of a sedentary / feudal nation, i.e. square, circle, cross, diamond, or octagon. Then there are four possible large buildings that the campus has to potentially accommodate – a religious building or a hall of worship (containing altars to many gods or to many cults), a library, a gallery, a large garden – as well as a guaranteed “main hall” for the university itself. At most, it might need to accommodate four of these except the hall – the religious building / hall of worship could never co-generate, as the latter is dependent on a free religion nation, while the former are dependent on a one-religion theocracy or zealotry nation; galleries and gardens are mutually exclusive, as both of those civilizational traits are in the same category; and libraries are required – and at the least it will always need to accommodate two, since there will always be a religious building or a hall of worship, and there will always be a main hall. The gallery is then an addition for “aesthetics” civilizations, and the garden is an addition for “pastoral” civilizations. A campus will also need to accommodate some civ-specific unique cultural things as well, which I haven’t implemented yet but know will be coming very soon, so I’ve also made room for these as well – both those which would take up multiple tiles, and those which would just take up single tiles in and around the other buildings.

The first thing, then, is to lay down the main road for the university, which goes around the entire map grid and is in the aesthetic shape for the civilization in question. This gives us things like this – though note that all my trials were done at the start on a particular university in a temperate region, so naturally, other terrains are possible too:

With that done, the game then selects spots to place the large buildings which must be placed somewhere. The locations are different for each shape, as I found some (squares, octagons) looked better with the large buildings placed on the sides of the shape, while others (circles, diamonds, crosses) look a lot better with buildings placed at the corners of the shape. All can also have a large building in the middle, and this is guaranteed to be the main hall – the other large buildings will then be distributed in the slots allowed for that particular shape. This then yielded layouts which look like this, with the main hall in the middle and other major structures around the edges:

It’s still looking rather sparse (where are all the students going to live?), but this is the first step to generating one of the campuses. The next step was to place potential mid-sized things which will be later appearing as particular civilization-specific cultural things, and these could sometimes be of reasonable size, so there were slotted – if required – into some of the empty spaces. For now I just had these appear as a placeholder just to test that they generate correctly, so all you’ll see here is just a loop of road which might, later, contain something cool and interesting:

Then we need to add classroom buildings! Again, medium-sized, and again, placed in the same way, giving us something like these:

And suddenly things are starting to look just a little more comprehensive, aren’t they? Then we come to student accommodation. This starts off by trying to place a few medium-sized students that could accommodate many students on many floors (I have dreadful extremely fond memories of my own experiences of such living), and adding a few of these into the mix then yields something which looks like this:

Then we just shift to smaller student accommodation, starting near the middle of the map grid and working out, until the remainder of the grid is pretty full. We also here add a number of very small garden or park areas (even if the civ is not especially into them), and bunch of meeting and gathering places with benches, fountains, and the like. Here we also add more roads, and reduce the number of trees. This final set of additions then gives us something like this…

…and suddenly, we have campuses! And let’s just have the doors show up, as well:

Then let’s have a look at all the new buildings, and what you can find inside them.

Great hall

At the centre of every university campus in URR is the main hall building, which (like all of these) is a totally new generator. The main hall can take a number of different shapes, again dependent on the dominant aesthetic shape preferred by the civilization in question, and is primarily (of course) a single very large room with a huge amount of seating and a lectern (generated, of course, to reflect both the shapes and colours of the nation in question), although this large room will also be surrounded via the generator by corridors, little offices, storage rooms, things of this sort. The main hall will also always have a basement containing lots of supplies and boxes and the like, and also upper floors again containing offices and the like. The floor and walls – and one day soon, windows, but let’s not get ahead of ourselves… – are very ornate here, and you’ll find statues and other swanky things, including sometimes some of the one-tile civilization-specific stuff which will be finding its way into the game in the near future. I’m very pleased with how these came out, and I think they give a nice sense of grandeur and purpose, while also being sufficiently everyday, and actually used, rather than something people only go into for special occasions. They also have generated names, so each university might have “The Great Hall of [Founder]”, or “[Founder]’s Great Hall”, or “The Great Hall of Black Ravens” or “The People’s Great Hall” or “The Great Hall of the Land” or “The Great Hall of the Ancient Truths”, or whatever it might be (always appropriate to the civ, of course). These are found on signs outside the great hall.

One might also notice each of these halls has a single up staircase – we’ll come back to that in just a minute. And of course, last but not least, great halls have their own generated names, as ever dependent in part on the civ, or drawing from more general sets of ideas instead:

Classrooms

Then, classroom buildings! Again these are buildings with larger rooms as well sometimes a few side office or communal areas. There isn’t much more to say here beyond the obvious, so these look like this, separated into classrooms, each with a lectern, sometimes a few tables and boxes around the place, and a little entry area which normally has chairs, and sometimes, a statue:

Student accommodation

Next, we have student accommodations. Before we go inside them, I should note that the size and scale of student accommodations are influenced by the sum total of the policies in that civilization, so one which as a populist political landscape, and a hegemonic culture, will have relatively few student places, while a nation which really values learning, and its own history, and exploration or international relationships, will have relatively high numbers of student places – and so on, with most of course falling somewhere in the middle. As for the buildings themselves, though, we start with the medium-sized ones, which have many floors – a civilization with the “mechanical” culture option will have much taller buildings, as they feel much more comfortable building up to higher floors – filled with rooms for students with beds, desks and chairs, as well as some communal areas as well. Each of these will also have a name, so these larger student halls might be called “Bluerain House” or “Sakito College” (where this is a word that means something else in that nation) or “Sixteen Fox Hall”.

The smaller student accommodations, then, are smaller buildings just housing a few rooms, beds, desks, etc, which are presumably where the poorer students shack up – and these, tragically, do not merit their own names. They just have a whole bunch of beds and a few other things crammed into a relatively small area.

Library

Next up, most universities (I’m told??) have libraries, and that seems logical for this game of all games… but I quite quickly ran into some serious questions when thinking about how they might actually work. The way that books work is that they come unopened (note the new graphic and description added here), and as long as they are unopened…

…they can be sold for full price (whatever that might be, depending on the nation, market, book, etc). Once they are opened, the player gains access to the information in the book, but the item itself then becomes worthless to resell – no merchant will accept them (the in-universe explanation being that only unopened books / scrolls are traded), and they don’t even show up in the list of things you can sell to someone who might buy books. This was to prevent players having to open up a file on their computer to store everything in the book, and then sell the book on, but want to keep the information in it – I want to let the player keep as much information as possible in the game itself. This way a book can be a trade object, or a knowledge object, but never both. I confess that I still think this is quite a neat little solution. Anyway, going back to libraries, the question was then: how would libraries work?

Well, the first idea I had was that you’d be able to request any book that exists, but pay a high price for it, so libraries would essentially work as an all-books-“shop” – rather different from the real world, but it would work within the world’s fiction and the game mechanics, i.e. allowing you to “snipe” a particular book that you need, but it’ll always be at a high price. At first I didn’t think this would work, as I wondered how you’d be able to specify the book you need without it just giving the player a spoiler-y – and huge, and thus very hard to navigate! – list of every book that exists within a given world. After more thought, though, two options presented themselves – the player could ask for a book on a particular topic from a list of topics (so similar to buying books in specialist shops, but you’d be explicitly requesting a book you haven’t yet seen within a given category) or they could ask only for a book they have heard of, and thus the game would track “known books” just like it tracks so much else. The trade-off for these two powers, both of which will be very strong, will be the cost, which would be many times the price of a normal book in a shop. I sat with this a while, always trying to think of potential glitches and exploits, potential issues and the like, but I couldn’t find any no matter how hard I thought about it.

As such, this is now the model! First though, here are the library names (as ever, varying a lot based on the nation which generates them)…

…and then entering a library gives you a generated space in the appropriate shape, which is filled with bookcases and a bunch of chairs and tables scattered about, as well as very rarely potentially a statue too. These layouts were fun to make, but far more entertaining were the really rather nice graphics of procedurally-generated bookcases (which, like everything else, might hide something important). I’m especially pleased with the three-dimensional element here, which is always time-consuming but I think came out really very nicely here, especially when coupled with the range of colours, the shading on the individual tomes, and the use of characters (including ancient language characters) to simulate the front covers:

Each library also has an inner door, and at that inner book you can request a book. This gives you two options – one to request via topic, and one to request via name. Requesting via name will give you a list of all books you have ever heard of, and will tell you whether you currently hold an opened copy of them or not, i.e. whether or not you actually already have them and have access to he information they contain. It also tells you whether you have an unopened (hence sellable) copy of the book as well, and of course notes if you have neither an unopened nor opened copy of the book. This screen looks something like this:

You can then select any book, including those you already have an opened copy of (though the purpose of this is very hard to say, but seemed safer to include it just in case), and they’ll give you a price. I thought here about having them set a time – “Yes, we can order that book from the Land of the Red Eagles, but it will take eighteen months to arrive” – but decided that would be too bloody annoying. I like some of the strategic time management ideas that are slowly being developed in the game – your character has one life, you’ll live an average lifespan, the world is vast, it takes time to travel, and you need to weigh up travel via the time it takes and the potential benefits at the other end – but this one just didn’t seem to add anything except interrupting a quest or riddle-line that the player is trying to pursue. Instead, therefore, the idea is that all (non-secret) books are in stock at all libraries, but one must pay a significant cost to acquire them. In the future I’ll add little explanatory pop-ups first time the player does something to explain the mechanic (probably something like “Libraries hold every widely-published book every written, and will give you any book on permanent loan – but for a very high price. Shops are much cheaper, but their stock cannot be guaranteed.”). The other option is requesting a book on a topic instead, so here you can get a list of topics…

…and then you have the option to request only a book you have already read, only a book you have already seen but not read, or only a book you have neither seen nor read. The cost is again high – not quite a high as the specific – and delivers a book that fits your requirement straight into your inventory (unopened, of course, so you can sell it to someone if you wanted to, although that wouldn’t make a profit in 99% of cases compared to the cost of acquiring it from the library). Either way though, whether you target a book or a type of book, you select what you want and then get given a price…

…and if you pay that, then the book is yours.

So, that’s how libraries work! A little different from the real world, but the model of “you can take out any book and read it” rather destroys the logic for how books (and scrolls, and information more generally) work in this world, and that’s why I’ve developed this alternative instead. Libraries are hence now a way to both target existing enquiries, and potentially open up new enquiries via a book you’ve not seen before – and in this regard I think they’ll function as a really nice and useful addition to the game world, both in terms of strategy and clue-hunting, but also in the sense of what people these days sometimes call “quality of life” in game design – i.e. in this case the ability to be precise in the information you need, and to get it immediately (albeit it a cost – make sure to trade those dyes and pocket watches wisely, and collect all the loot you can find some treasure chests dug up!).

Halls of worship

Next, we have halls of worship. There is something vaguely comparable here in castles for civilizations with the “religious freedom” option, i.e. the castle will contain every altar for every religion extant in that nation, and they all have different rooms and a priest on-hand to, presumably, minister to the needs of however many believers live and work in that castle. Halls of worship are, however, a new building with a new generator, and they essentially have various small rooms that, again, house altars (though this time, not priests) and sometimes statues, as well as chairs or prayer mats, of however many other religions are present in that civilization (the same building and model is used for civilizations with numerous extant cults instead of religions). Again, very happy with how these look and generate.

Galleries and gardens

Then we also have galleries, and gardens, for aesthetic and pastoral nations, respectively. These are both rare buildings, and as above, only appear on campuses with specific civilization traits. Both have generators already (for city centres), so those were repurposed here:

Painting generation is, of course, coming at some point (and like everything else will be integrated into world generation, into history books, into riddle solutions) – but that’s going to be a big one (think about how complex generating statues were!) so it’s not going to be a 0.11 goal. Maybe 0.12? We’ll see.

Museum

Last – but absolutely not least – we come to the museum. I didn’t mention this earlier in this post, but this is a super-important area – as I think it’s going to be where the player starts the game! The museum, at present, sits on a higher floor of the great hall and consists of a range of different interesting things from around the world, as well as the office of the museum curator (which, to be even more specific, I think is where you’ll start, as a student assistant to the curator – or maybe the new curator brought in? Not sure yet). The goal of this area is, essentially, to front-load interest for the new player. We all know that games don’t have that long to grab a person’s interest, and although I’ve tried to make the world generation loading screens as interesting as possible, and I intend to work on world gen to make it a great deal faster in the future, and I have an idea for an interesting character-creation system after you set what kind of civilization you want to start in, and I have planned a procedurally-generated opening cutscene (!), and I’ll be giving the player at least a half dozen clues / notes to get them started… I think immediately showing the new player some of the variety of the world, in the very first room they see, is a really good idea.

As such, each museum contains a 4×4 (or 3×5, or 5×3, or some similar size) grid of interesting things drawn from any of the world’s civilizations, though all on plinths / pedestals so that one can’t pick them up if they’re an item (if they’re a “feature”, like a vase or a statue, then they just exist by themselves without a plinth). These might be vases, or statues, or cult shrines, or any of the future stuff I’ve vaguely hinted at here, or murals, or paintings, or in rare cases a religious relic, or even an ancient crown, stolen from another land! Soon, once I work on the “start of the game” stuff, I’ll probably have a little help window appear, telling you that looking at things is very important in this game and hence you should certainly have a glance at the stuff in the museum. Anyway, here’s an example of a museum…

…and me leaving the curator’s office and looking at the things that happened to be there on this iteration:

I’m excited about this start! I think it’ll really set the tone very nicely, and although I’m still working out the specifics (curator has vanished and left their notes, perhaps?), I think I’m really happy with this opening. Once I start properly adding tutorial popups, I will make sure one appears here explaining how the look function works, and thus encouraging the new player to take a look at all the things in the museum. That will both emphasise the importance of the look mechanic, and also should give a good sense of the size, scope, and variety of the stuff which is there to be found within the game world. Again, the exact specifics here are still being worked out, but I think this is a really novel and intriguing start which will accomplish a lot of objectives in terms of conveying a lot of info to the new player very quickly. Still subject to change, but I like it a lot right now as a way, combining this with the initial set of notes you’ll be given, to set the tone very well :).

Final thoughts

So there we have universities! For, uhhhh, about a decade, the player has randomly started in an upper-class housing district, and while that sort of made a loose kind of I-will-finish-this-later sense around a decade ago, it hasn’t for a long time. Connected to this issue, of course, is a general “lack of direction” the player gets when they boot up a world. Some of that I think is forgivable, given that no core objective threads have yet been implemented (though I’m of course working darn hard on it, i.e. 0.11’s core goal, right now, as very soon we’ll have another updates about clues, etc), it’s definitely time to start focusing the early-game and giving the player a much better sense of what they’re doing, and why. I’m really happy with how the universities are generating, and I think starting the player in a university – and particularly in the university museum – will give a really clear sense of some of the chief concerns of the game, what you should be looking out for, what you should be doing, and so on, as well as leaving quite open the “where do I go next?” question, rather than starting in a city implicitly saying “well, explore the city”. Universities are admittedly currently depopulated (you might have noticed an absence of fellow scholars), but that’s only because I haven’t touched the NPC AI stuff in 6+ years, and when I go back to all of that deranged very well-written code, I want to do everything that needs doing there in one go (not just for universities, but other things too), instead of doing it piecemeal. A relatively near-ish future update (i.e. before 0.11 releases) will be heavily about NPC AI and the like – but for now, universities are now fully present in the game world, generate in complete detail (aside from those pesky students going about their day!), and through the museums and the wider setting, give a really nice launching point for the player.

Thanks so much for reading, everyone! As ever I really do appreciate it an incredible amount, and if you think this is a really cool post that would interest other roguelikely people or PCG people who don’t know about the game, please do feel free to share it around. More immediately though, please do leave me your thoughts down below! It feels great to have almost completely ticked off one of the major remaining tasks for the 0.11 release – a few little bits of polishing are still required, but everything you see here works – and I’m already excited by this greater sense of focus and direction that this new start should be able to give the player in a game about uncovering procedurally generated secrets, riddles, and mysteries.

Thanks everyone! See you all in three weeks :).

6 Comments

  • Looks like in working on the game you’ve stumbled upon the same old problem: how do you make knowledge scarce and expensive to acquire when by definition it can spread without limits? Fun stuff!

  • Wow awesome! Totally agree with the on-boarding function of a new starting location. The museum stuff is really cool too, sounds exciting to start a new game and get a random slice of the generated world in a small room like that.

    • Thanks so much for the comment Greg, I really appreciate it! I agree, I think it’ll be a great way to introduce some key things and ideas, especially when coupled with a dozen generated notes and riddles in the player’s starting inventory to go with them.

  • The topic of information and the economy of knowledge can be quite critical in other games, too – it is quite common in cyberpunk genre, for example (in part because ‘hacking games’ are usually cyberpunk). The trader-of-secrets is a common archetype after all.
    The solution of info-xor-monetary value is a very interesting, if quite extreme, approach – I believe it will serve URR very well, given how many other aspects are there to juggle, both for author and for players!
    In the past, I was thinking of a system where each piece of information is tracked like an inventory item, with a quirk that it does not disappear when given away/sold – but it gets less and less valuable with each sharing! As well as with time etc., also being potentially more valuable if paired with proof, and so on. This was for a planned roguelike-burglary-simulator in a cyberpunk city, where player could find some information during burglary, and sell or trade it further.
    Also, with roguelike style comes another potential solution to that elusive look-and-reload problem: only generate the secret information on-demand. If player reads the book and reloads the game, info he gleaned is no longer valid! This wouldn’t work with URR, of course, not with all the interconnectedness of the world generation, but might be worthwhile in other games. Kind of reverse of keeping the RNG stable to prevent save-scumming random rolls!

  • Another exciting update! I love the idea of having the player start off in a museum — it’s very Indiana Jones (“It belongs in a museum!” “So do you!”), and will be a great way to introduce them to the mechanics of the game and the overall quest. I also like how the layout and features of a university are influenced by the nation’s culture, and you’ve created some fun name generators for universities and libraries.

    It does seem a bit odd that all universities are generated out in the wilderness instead of near towns or cities. Even the most rural real-world campus has some kind of community nearby. It does make sense to separate the university as a map location from cities, fortresses, etc., and to provide the player with an open map full of possibilities to explore once they exit the university, but it might make sense to have universities appear near a city. That would also give new players an obvious place to go in search of more information, equipment, transportation, etc.

    You’re threading a difficult needle with the library system in the game’s limited-information economic system. I’m not sure how I feel about university libraries functioning as places to buy expensive books (full disclosure: I am a university librarian). But I think it could work. Historically, many libraries did and do have closed stacks (e.g., the U.S. Library of Congress), so it could make sense in-game for the library’s collection to be non-browsable. I would think that students and faculty in a closed-stacks library would to be able to request books without being charged, but perhaps as a museum worker the player isn’t *technically* part of the college faculty and so has to pay $$ for the privilege of borrowing books? However it’s done, as you’ve noted it’s important to make this very clear in the game to avoid confusing players. Maybe a librarian at the book request area could say something like, “You’re not a student or professor here? Sorry, but we have to charge you if you want us to loan you a book. What title did you have in mind? In exchange for a donation, I’ll see what I can do.”

    I really like the way the generated bookshelves look, even if they are non-browsable (maybe the open stacks only hold books that are explicitly not interesting or useful to the player? I’m not sure how that would be communicated or would work). I can see all sorts of possibilities for cryptic clues to be hidden in certain shelves, perhaps slips of paper with riddles tucked away in mouldering dusty tomes or scribbled marginalia on an ancient incunabulum that leads to the next piece of the game’s central puzzle…

    Congrats on this milestone — I’m excited to see what you cook up next in URR!

Leave a Reply

Your email address will not be published. Required fields are marked *