Graveyards

This week I’ve made a lot of headway on generating graveyards and have started to generate the graves as well. Graveyards generally have one main entrance (this can sometimes be two, with the other on a different side of the graveyard) then a selection of interconnected areas. As with everything in the game, this is a completely new form of generation that isn’t used again in any other kind of settlement or area – I wanted to give it a feeling that the graveyard had been built up over the time, and that different areas placed graves in different patterns in various eras (note the various patterns for grave placement), whilst farms/towns and everything else have their own algorithms behind them. In a way, I suppose I want to almost “hide” the fact the game is procedurally generated – I want each area to look sufficiently unique that one can be fooled into thinking a region was hand-made. I also have begun to fully implement the generation of architectural styles (brick styles, colours, etc) for each civilization, so the colour of bricks seen here will be unique to this civilization. The road does not yet connect properly with the graveyard, but that is being worked on, whilst the tiny closed-off section of grave in the top-left corner will be removed during generation once I’m finished. Anyway, graveyard:

TerrainTest

As for the graves, there are twelve different headstone styles, twenty different “base” styles, thirty different patterns (the little flourishes on the grave, like spirals or diamonds or whatever), and each headstone style may be undamaged, slightly damaged, or heavily damaged. A zoomed-out picture of all the headstone variations is shown before, but once you include the number of possible patterns and bases, there are over 20000 possible graves, more than enough to service any playthrough. I’ll soon be adding a little bit of moss and general overgrowth at the base for the older graves.

Graves

The graves note three things – the years the person lived to and from (the date of birth may not be known, and older graves are more likely to be damaged), their name, and – if appropriate – what they died of (so naturally with these three aspects, the permutations are almost infinite). Obviously things like “He died of a horrifying wasting illness” would never be mentioned, but things that most would think merit commemoration, like falling in battle, or a duel, or whatever, might be mentioned, along with graves relating to important historical events like disasters. Thus, importantly – and rather nicely I think – these now link up to the histories! If you see a civilization fought in a particular war, you can check out the graveyard by their capital (and likely the minor graveyards in towns) and, indeed, find people to died in that war within the years that war was fought. Ditto for diseases, civil wars, whatever. I’m still working on thinking about tombs, catacombs, ossuaries and the like for wealthier people, rulers, etc. There is a good chance that graveyards which have catacombs below (which may not be all of them) might connect to the subterranean regions of the game (in the future), but these are still early plans right now.

Equally, as with all the history stuff, this will later have gameplay repercussions – maybe you hear somewhere of something buried in a particular grave, or in a particular tomb or ossuary? Or possibly that a particular set of graves are in a particular pattern that has some deeper meaning? As with other things like this relating to the in-game histories, you’ll always be making a choice: do I have the time to explore this little side-aspect whilst you’re passing through a city, or do you need to continue? The overall global clock (which I know I haven’t said anything about yet in detail) will give you time for some side exploration as these explorations of the world will be key to building up your character, but it’ll be up to you to decide which you can/cannot risk.Graveyards as a whole will also serve other functions. Maybe particular cults, religions, smugglers or other individuals might meet there? Perhaps there is treasure to be grabbed from any remaining tombs?

So there you have it. Next week’s blog entry could be at pretty much any time since between the 8th and 12th I’m in Berlin for the International Roguelike Developers Conference! Thus, the next update will either be whilst I’m in Berlin, some time a bit before, some time a bit after, or SOMETHING ELSE. It will likely be on slums and the early graphical generation of keys, and possibly something about the system of keys/doors/civilians I’ve been thinking about for a little while now. See you all next week (at some point)!

Real-Time Strategy “Level Design” II

Several months ago I wrote a piece called Real-Time Strategy “Level Design”, which received a very favorable reception. As such, I’ve decided to expand the series with at least two more posts. This post will be looking at three more levels from the original Command & Conquer – all from the “Covert Operations” expansion, as that generally has the most interesting levels – whilst the third part to be published in the future will examine three levels from Tiberian Sun, the next game in the same fictional universe which Westwood released several years later. Whilst Tiberian Sun is otherwise a very strong game, many of the levels are less like “puzzles” than those in the earlier games, so fewer of them merit the level of analysis I’m aiming to deliver. Due to the latter game being rushed out to release, the balance is not quite as tight as the original, and whilst many of most interesting original levels rely on using the unique abilities of particular units, this aspect is somewhat lost in the sequel. Nevertheless, today we’re sticking with the original classic and looking at three more interesting puzzle levels.

The first level is called Hostile Takeover. The second half is standard build-up-your-base-and-crush-your-foe fare, but the first half of the level is an interesting sequence for the player to puzzle out. You begin the mission with a flame tank – deadly against soldiers, and also quite effective against buildings, though an aspect easily forgotten – and four rocket soldiers. You need to reach the white X in the top left corner. The first part is simply choosing the best units for the situation as the player sends the rocket infantry forward to destroy the tank whilst keeping the more fragile flame tank in reserve (though it can be committed to the battle as well if you’d prefer). In this mission you play as the Brotherhood of Nod, and heading north finds you a ruined Nod outpost – a barracks and a communications centre, circled in yellow. At this point the game plays a rather clever trick on the player. When the ruined base is revealed, the player can just about see two of the three tanks blocking the route ahead. Making sure those tanks are within the player’s sight at the exact moment you gain control of the buildings seemingly sends an obvious message – here are the units you have to kill, and we’ve just given you the buildings with which to kill them. At this point the player has $0. Selling the communications centre will yield exactly $500 which can be spent on five minigun infantry or one rocket soldier and two minigunners. Either way, any force assembled here is going to be inadequate to deal with the tanks parked in the pass which, seemingly, you need to kill. Indeed, the AI of these particular tanks is set to hold ground – they cannot be lured out to be killed one by one, nor can they be easily pulled out of position to slip past. The only way to persuade them to move is by placing troops on the tile directly in front of them, triggering the “run over this soldier!” AI state, otherwise they will not pursue anything you send at them. The player might end up trying half a dozen different ways of getting past those tanks, but even if a unit or two manages to sneak past the onslaught – very unlikely – there is another Mammoth Tank blocking another bridge up ahead.

HT1

A different strategy is required. Once the player realizes there is no way to push past those tanks, they may explore down to the south-west and find a selection of Chinook helicopters behind a pair of guard towers. These are unique among all units in the entire game because they can be captured by engineers… and engineers cost exactly $500. Instead of offering up your troops to be crushed beneath the treads of the tanks blocking the pass, the player needs to sell the communications centre, use all the money on a single engineer, break through the fence to the south-west, capture a Chinook and fly to the desired location. Unlike other levels where the player is only given a single way forward, this level gives the player two ways forward – a false way and a real way, and the player has to realize that blasting through things in your way isn’t always the best way forward, even when such a route is seemingly handed up to the player. Many other levels in the game have similar (though less crucial) situations where capturing a building or sneaking instead of fighting can either help you, or open the possibilities for other tactics beyond open combat. As with many levels in the expansion pack, the player is given only what is required – a player who has learned this lesson in the game’s design may quickly question the presence of a communications centre that seemingly serves no purpose…

One other thing to note about this level. If we take a closer look at where the player’s units start there is a large civilian building on the other side of the river. When the level starts and most of the map is shrouded, you are just about able to make this out. By this point the player will have learned that these buildings always have crates of money inside them. Having acquired the Chinook you can then take a few units over there, destroy it, and retrieve the crate, whereas accessing it via the bridge – which leads into the opposing base – is impossible until you’ve finished the level anyway, at which point the value of an extra few thousand dollars is zero. It’s a nice little addition – most Chinook missions give you a single thing to use the Chinook for, whereas this mission supports a little observation on behalf of the player as a method to acquire a significant amount of extra starting resources.

HT2

The second level is called Blindsided, and starts the player with just a single commando (instant-kill weapon against soldiers, C4 charges which instant-kill buildings if successfully planted). The map is divided into two halves by a river. What happens in the second half is, like the previous example, less to with level design than the first half as there are multiple possible solutions to it. The first half, however, takes a leaf out of the same book as the first level, as well as one of the levels examined in the previous entry. The side of the map you start on (the bottom) has a Nod base on each side (you play as GDI, the opposing force). The base on the right which we’ll come to shortly has an Obelisk of Light guarding it (a deadly base defense) whilst the one on the left has just a single turret with some troops. Your first move is to kill off the turret and the surrounding soldiers, and then to refer back to the mission briefing. The briefing for this states that you must destroy the SAM sites (the orange circles) – once done, a helicopter will arrive with five engineers, and then depart. Which five buildings to capture? One’s inclination may be towards the airstrip in order to bring in tanks, but what you need here is the quantity of units, not the quality. Remember that mission last time where a meat-shield of units was required to let the commando get through safely? A similar tactic is required here, but with a twist.

BS1

You need to capture the five buildings marked and sell all but the barracks (#1) in order to build up enough of an army to rush the other base – that much is clear. In the mission from the previous entry the player had to take account of one extra issue – the gunboat patrolling down the middle of this map. This time, by contrast, the player has two extra issues to contend with. Firstly, the harvester, highlighted in the white circle below. This unit is ordinarily only for gathering resources, but under computer control has a very specific piece of attack code – when shot by a soldier, it will hunt that soldier down until it runs the soldier over. In other missions this can be used to lure harvesters into traps, but in this instance when you only have troops, it’s a problem. If multiple soldiers shoot it, it appears the harvester unit stores a list of those who have attacked it and plans to crush them all. This is an issue for two reasons – firstly because your horde of units is going to have to stand still to kill the Obelisk as fast as possible, which means you don’t want to worry about them being run over instead; and secondly, you need to keep the enemy harvester alive in order to subsequently capture the refinery (blue circle) and claim it as your own.

BS2

The second complication is the selection of normal soldiers inside the second base. When you attacked the first base, you could take your time – none of the soldiers would attack you unless you came close and triggered them, so your commando can safely pick them off one by one. No such luxury is possible here, however – once you have committed to battle several of the troops within the base will attack your soldiers, including potentially several wielding flamethrowers which will decimate your stack of troops. What this means is that the player has to control their troops not just to destroy the obelisk – undoubtedly the primary objective – but to also avoid firing even a single bullet at the harvester, whilst also drawing fire from the turrets so that the commando can finish them off, whilst also dealing with the troops that emerge from the base to defend it. Careful use of the commando is essential – I would recommend using him to pick off the individual soldiers – but your entire army must be carefully managed to ensure that which must die dies, and that which must not doesn’t take a single bullet. This a demanding section of micromanagement, especially if the commando took damage earlier, and especially if you try to make sure to keep the commando alive (a useful though not vital unit for the rest of the level). Many players seem to mark this one down (along with Twist of Fate, a level I haven’t examined here) as one of the trickiest in the expansion. Like the level before, this level gets the player thinking about factors they might not normally consider – in the first case the sale value of a single building was the key to cracking the level, and in this case keeping an enemy unit alive and carefully balancing what you attack and what you don’t is the way to make it through alive.

The third level from the original we’re talking about today is Death Squad. Unlike the above two, this is a mission with a number of possible solutions, but the one I describe here is one which allows you to keep the highest possible number of your own units alive, and indeed – if done perfectly – this mission can be completed without losing a single unit. When you begin, you are given nine units. Many of them are not particularly important for this strategy (though are useful for others), but the useful units are as follows. #1 is a commando, a unit we’ve seen a lot of in these analyses. #2 is a buggy – fast and weak. #3 is a pair of stealth tanks which can cloak and remain hidden, but must be visible to fire. This is only one way this level might be completed, but the method that requires the fewest units, keeps all your units alive, and hopefully shows the extent to which some of the level design of this game enables something close to an ideal of “perfect play”.

DS2

In this mission you need to destroy an “Advanced Communications Centre” at the back of the GDI base (the building circled in white in the picture below). Between your little force and the objective are five distinct obstacles, each of which can be navigated without losing a unit. The first is the exterior base defenses; the second is a commando; the third is a group of grenadiers; the fourth is a Mammoth Tank, the strongest unit in the enemy arsenal; and the fifth is an Advanced Guard Tower (AGT), which will decimate the player’s troops and easily kill most of the light vehicles the player’s been given for this mission. Firstly the player can send stealth tanks around the corner, followed by a unit as bait. All enemy units have a certain radius in which they’ll detect your units and pursue – sending something visible will cause the commando to come out and fight (the dark red line). It can then be quickly disposed of – if their commando remains alive, your commando may be killed, and that makes this strategy impossible to complete. The stealth tanks can then destroy part of the wall shown in the dark green circles, at which point the buggy can be brought up to join them.

However, giving the player stealth tanks in this mission is a clever move on the designer’s part. As above, all the enemy units have a radius within which they will attack any units – any visible units. Bringing the buggy up too soon will trigger the Mammoth Tank to close range and the grenadiers to close in, and your stealth tanks, buggy and commando cannot hold off that kind of force. Even if the enemy units cannot pursue your cloaked stealth tanks, they can pursue visible units next to the cloaked stealth tanks, thereby forcing the player to carefully place their stealth tanks to ensure any enemy units moving around the map don’t stumble upon them, something made trickier by the small amount of room you have to maneuver down the right side of the base (see the picture below). Once the wall is open sending through your commando will trigger the grenadiers and the Mammoth Tanks, but backing off will return the Mammoth to where it started – the grenadiers can be picked off by your commando pretty safely. At this point, things get a bit hectic – you want to send the buggy (the dark green) through to trigger the Mammoth, get its attention, then start running circles around the guard tower and the Mammoth both. Once their attention has been grabbed (and the AGT is firing away from the objective, as shown by the black arrows), it’s then simply a matter of running the commando (light green) up to the Communications Centre and destroying it.

DS1

This level gives you a selection of different units with a selection of different potential strategies. Any kind of all-out assault is bound to fail, but the map is full of possibilities. You have commandos that can instantly kill troops; you have stealth tanks which can navigate their base unseen; you have rocket troops that can even attack their helicopter gunship, if you choose to attack through the other side of the base. Although large in size the GDI base is very sparsely populated – it seems clearly designed to allow you to use your units carefully and cleverly to overcome obstacles one at a time. At the same time, although the player has a lot of choice over the early stages of the level the final challenge – the Mammoth Tank and the AGT – must be dealt with no matter how you approach the level. You lack sufficient firepower to handle them without significant (or critical) losses, so the player has to find a strategy to either handle or negate the effect of both. The placement of the sandbags on either side are an interesting choice – did the designers mean to allow you to shoot through them and rush around the Mammoth? Sandbags are destroyed from a single explosive hit, so maybe that was the intention. As I mentioned before there are multiple solutions to this mission. A quick search of Youtube will find others, including one version where the majority of the player’s units are sacrificed to lure the Mammoth Tank away, after which your two stealth tanks are placed to the south-east of the objective and are just about able to snipe it without the AGTs damaging them. The solution I presented here was one which uses the units you’re given carefully – rather than just as cannon fodder – and is, I think, the most elegant solution to the level and hopefully showcases the depth of strategy possible with some of the level designs in this game.

Summary

These three levels all need the player to think carefully about the unit’s they’re facing and the units at their disposal. The first level cleverly subverts the player’s expectations about how the game teaches you your objectives – it shows one way to do the mission, but that method is only a trick, and you need to explore the rest of the map (and think carefully about the value of the buildings you’ve been handed) to find the right way through to your objective. without killing the tanks in the way. The second mission needs you to distinguish between units that need killing and those which don’t – in rushing the secondary base you need to keep the harvester alive – and again subverts the RTS norm of kill-everything-in-sight (something the original C&C often does well in its more puzzle-like missions). The third mission has a variety of solutions but a map carefully designed to allow for careful tactical play, including a deathless victory, and gives you a base that is near-impenetrable with a full frontal assault yet very exploitable by using the AI and the units you’ve been given. In the third part of this series I’ll be moving on to Tiberian Sun, the narrative sequel to the game, which has a variety of missions that both serve as tricky puzzles and reward players who figure out complex sequences of actions (much like these), rather than simply killing everything in sight.

First look at 0.6

As I’m away from tomorrow until the next weekend, this week’s update is a little shorter, and a little bit early for once. First off, thank you all for the awesome response to 0.5 – copies have been flying off the virtual shelves and I’ve got a lot of really supportive feedback, and some important bits of constructive criticism too. Since I don’t know the meaning of “resting on your laurels”, I have already started work on 0.6 and made big strides in generating many of the game’s settlements. I decided to start off with farms, and have created a system for generating farms of various sizes, with various crops and various interior dimensions. Farms are obviously far from finished – I still need to get buildings generating, as well as making the trees in the orchards (currently just generic trees) – but it’s a solid start. I’m leaving the generating of buildings part until I have all the different types of settlement ready for building generation so that I can code it all in one fell-swoop; I expect taking account of all the required factors will end up being quite complex, so I’d like to do it all within a couple of coding days back-to-back.

TerrainTest

I’ve also begun to implement some of the basic parts of town generation. It starts off by creating a network of roads appropriate to the type of road going through the town (if any – special cases for isolated towns have not yet been handled) and then spreading buildings along them. There will be a variety of rare and crucial buildings in towns – more on this in some later entry – and then a large amount of general housing and the like. For now, just for the sake of testing the system, the buildings are generating… as lava… but I’m sure you get the idea in the bottom image for how towns will end up looking. The town code as it stands now only took a little over a day and I’m amazed at how interesting these layouts are already looking. Once I start to add buildings to towns I’ll put up another update on that. I’ve started to work on generating architectural styles as well, and varying the materials that civilizations like to construct buildings from, but the next step for towns is basically the creation of a massive building database.

Towns

From this point onwards (once I’ve done the few additions to farms I need to do) I’ll be working on the non-building parts of other settlements. I’ve got some very interesting ideas for how hunter-gatherer settlements will generate, but I think I may work on graveyards next, or possibly nomadic fortresses. We’ll see. Either way, I have a train so catch to that’s everything for this week. Let me know what you think of these very early stages, and see you all in eight days.

Ultima Ratio Regum 0.5 Released!

With 3.5 months of development behind it (my fastest release to date), I present Ultima Ratio Regum v0.5! You can download it here. Here’s a summary of the major additions:

 

- History generation! The world now contains over a thousand years of history of conflicts, religions, settlements, colonies and more. Some categories such as discoveries and cults will be added to more in later versions. Although they are currently all shown at the start of the game, exploring and discovering these histories (and the gameplay/world information they provide) will later emerge into a central game mechanic.

- Enlarged world map! The world map is now 250×250 rather than 150×150, but due to various optimizations takes up less memory than the older version. This allows for far more room for everything the game needs, and with a larger world map I can start to think about various mechanics for exploring the world without it all opening up too quickly.

- Religion generation! The world is now populated by religions – monotheistic, polytheistic and spiritual/animist/shamanistic – some of which may spread between multiple civilizations. The game describes their entire pantheons in addition to (for feudal religions) what agendas they might wish their followers to pursue.

- Cities, towns, fortresses and settlements! The world map is now populated by the capital cities and smaller towns of feudal civilizations, the desert fortresses of nomads (between which their caravans will later roam) and the settlements of hunter-gatherer civilizations. These different types of civilization also have different types of flag and symbols associated with them. In the next version, 0.6, these population centers will be fully explorable.

- Coats of arms and families! Feudal civilizations now contain a number of noble houses, each of which has a procedurally generated coat of arms to go with it. The player is assigned to a non-ruling house in their civilization of choice, and house allegiance will be one of several “faction” alignments that offer both benefits and risks as the game progresses.

- Updated start/load screen! The start/load a game screen now displays a wealth of information about each save to allow you to easily browse the saves you may have, and also loads in a fraction of the time that was required in the past. You are also now given a choice of what civilization to follow, and whether to follow the lead religion in that civilization (if any).

- Policies! There are now a large number of “policies” that each civilization possesses, spread across eight different categories. These will act as passive boosts to the player’s abilities, skills and stats in various areas.

- Road generation! A network of roads now criss-crosses the parts of the world controlled by feudal civilizations, and also generate on the human-scale map (not just the world map).

Hope you all like it. Let me know any feedback you have, any bugs you might find (I think the release is bug-free, but there is only so much playtesting two people can do) and any other suggestions or feedback. In the next few weeks I’ll be talking quite a bit about the plans for URR this coming year which I’m rather excited about, so I invite you all to join me for that discussion in the near future. Hope you enjoy the release!

Ratcatdoge

Finishing up 0.5

We’re now just a week away from releasing version 0.5! This version sees the addition of feudal cities & towns, nomadic fortresses and hunter-gatherer settlements to the world map; the creation of colonies by civilizations so inclined; an encyclopedia function that tells you everything about the world you’ve so far learned; a number of generated in-game histories which hint towards NPCs, items and plot points of interest; several tens of thousands of possible family sigils along with family trees for important houses; distinct flags for each type of civilization, and symbols for religions and cults; and various other small fixes, tweaks, memory/speed optimizations, etc etc. This week’s entry is going to be a summary of what’s happened in the last week, then next week – on the 12th – I’ll be releasing 0.5!

First off, for those who didn’t see this on Facebook, Twitter or elsewhere, this week the game really surprised me for the first time in a while by producing this rather tremendous city upon a small island (with a single slum just on the outside) and only accessible by docks:

Islandia

This in turn raised several things I’ll need to take account of for the next release, 0.6, when I’ll be generating the interiors of cities, towns, fortresses and settlements! Which is – what if a city has no roads? Or what if a town is completely enclosed by mountains? I’ll need to have the game recognize that and ensure the former can only be accessed by docks, for example, or ensure a mountain pass is generated to access the latter. It shouldn’t be too tricky to do that, but I’m glad this brought those possibilities to my attention.

I’ve also updated the “choose a save” screen, so it now looks something like this. For this release it just lists every civilization, but in the future it will naturally only list those you have actually encountered:

Newsaveload

And now some other more general notes:

- There will only be three cults visible in the in-game histories for this release and in the encyclopedia; these are the cults that will relate to the three early-game areas. Others are being coded in the game but will remain hidden for the time being. Likewise, only certain languages will show up in the “discoveries” list, but this will expand as versions go on.

- Although you can view nomadic fortresses and hunter-gatherer settlements in the encyclopedia, there is (as of yet) not a lot of information about these. I’m still working on precisely how they’re going to be structured, so there will be more on that in the near future.

- The resources map has been changed to the “resources and trade” map which displays roads as well as mineral resources, and will later show naval trade routes, mountain passes, etc (passes will show on the normal map too, but they’ll just be highlighted on this one).

- I’ve adapted the ziggurats to feature the correct language – though in this version you can still auto-translate the clues – and I’ve also begun some work under-the-hood for displaying other languages, allowing you to keep track of your information on languages, etc.

And that’s pretty much everything. See you next week for 0.5’s release!