Cho Ren Sha 68k World Record and Analysis

I’ve now picked up my fourth bullet hell world record to date (and the third just this year), this time in Hard Mode in the excellent Cho Ren Sha 68k. This is a shmup quite similar to Blue Wish Resurrection in many ways, with a very strong following and is one of the most well-regarded PC shmups currently out there. Most players play “Normal” mode, but I decided that I wanted to pursue the Hard Mode world record instead, both because it makes for by far the more exciting and dramatic visual spectacle, and because the Normal record is so optimized that I would basically just be playing to exercise my skills at precisely memorising spawn patterns and navigating a relatively easy set of bullet patterns, rather than playing to exercise my reflex skills navigating an incredibly challenging set of bullet patterns. The game is longer than most, coming in around forty minutes, and is notable for two elements: return bullets, and the presence of two “loops”, which make it quite distinct from the three previous games I’ve picked up the world records in.

Firstly, return bullets. Whereas in many shmups ships simply come on screen and shoot their bullets, in some games destroying a ship causes it to release additional bullets. Depending on the game and the difficulty, this might be only a single bullet aimed at your ship, a random cloud of bullets, a line of bullets, or some other pattern. In the case of CRS68k Hard Mode, there are two kinds of return bullets. On the first loop (see below for what this means) ships fire multiple lines of long pink bullets roughly towards the player’s location, with the smallest ships firing a single stream and larger ships firing up to six or eight streams simultaneously, which quickly fill up the screen and limit the player’s options, whilst moving extremely swiftly. On the second loop a burst of thick individual bullets are fired in every direction; in some ways the second loop’s return bullets are easier, I think, because although larger, they don’t form the kind of thick bullet-lines that cannot be traversed. Additionally, being close to an enemy ship prevents the return bullets from spawning when it dies, but you actually get points for every single return bullet that spawns. There is therefore a risk/reward element here: being close to an exploding enemy reduces the number of return bullets (and you’ll see me do this a few times), but for each return bullet that spawns, you get more points – and with a tremendously impressive score of 25.5m to beat (which I only beat by 0.1m!) I knew that I had to try to let every return bullet spawn (see gif below for example) that I could allow in order to eke out those few extra points.

blog1

“Loops”, meanwhile, refer to the practice of playing through the same stages a second time, but with a difference. In the case of Cho Ren Sha, this means the player plays the game’s seven stages, and then upon completing them and defeating the “final boss”, the player is them reset to stage 1 and plays through all seven again, but with a change to the return bullets and the score given for each spawned return bullet (each individual bullet spawned in loop 2 is worth more than each bullet in the pink bullet chains in loop 1). This means that just being able to maintain one’s focus and composure for the entire period becomes even more crucial than in other games, which tend to take somewhere around twenty-five minutes to play, and by the end of the playthrough I was definitely reaching my limit of mental and eyeball focus without a break.

Lastly, scoring and an additional unusual mechanic. Scoring is simple: kill everything, get bonus points for ships and bombs and shields stored at the end of each level, and maximise the number of return bullets that spawn. Part of this is also a final interesting mechanic – when you kill power-up ships, they will drop three power-ups which spin in a circle. These are shields (which is a binary on/off and protects you from a single hit), bombs (you can have up to 5, they clear the screen and do major damage to everything on screen) and power-ups (which boost your gun), and for each million points, you also get a “1up” appearing here instead of the shield. However, if you sit in the middle and move down the screen with the powerups, they will speed up and after a few seconds you collect all three (see below), which is crucial to maximising points. I’m remarkably bad at this, especially in the first half of the run when I’m still warming up, but you’ll see me do this a lot in this playthrough. As a result, I do think that getting all of these perfectly, and avoiding my one death, would get my score up to around 26.5m or more, but I’m not going to try for that unless someone takes the Hard Mode WR back from me.

blog2

Now, on with the analysis! Since the game has two loops, the time-stamps in the sections below below will take you to both of the loops.

Second Boss (4:50 and 28:45)

The second boss is indicative of much of this game, which is to say that there are lots of “secrets” and hidden attacks and optional enemies and whatnot that spawn or appear depending on the player’s actions. You’ll see here that I spend very little time in the first phase actually shooting the boss, aside from defending myself against the missiles which are very fast and weirdly dangerous if you don’t attack them. Once I’ve waited long enough, extra little ships spawn, which are worth killing to boost your points score. There are actually even more ships that can spawn if you wait longer, but I didn’t do that in this run, mainly because – sigh – I simply forgot; however, if I find myself having to come back and improve this record, this is somewhere I can get an easy optimisation for another 100k points or something by keeping it alive a little longer.

blog3

Fourth Boss (11:00 and 34:50)

The fourth boss has always been, for me, the decider between a good and bad run; if I die here I normally reset. Rather than a single ship, the fourth boss is a selection of half a dozen identical ships that drift onto the screen from alternating sides, and consist of many components – a core, wings, and guns on those wings. This multi-component nature is what makes it so difficult on Hard Mode, because every component gets return-bullets, and the player is certainly encouraged to maximise the number of components they destroy in order to boost the points they get from the boss. I use a bunch of bombs, which are certainly not perfect but more than good enough to keep playing with, especially on the first loop – as I say, any playthrough where I don’t just outright die against this boss is very good. There are a few particularly hairy moments in both of these bosses where I’m trying to hold out against using a bomb for as long as possible, and I have to say I think the previous WR holder is quite a bit better than me at this boss; if memory serves, their record is hit- and bomb-less on one loop, and one-hit and bomb-less on the second loop, which is amazingly good and better than I do here.

blog4

Fifth Stage (12:10 and 36:00)

The fifth stage is particularly difficult due to the presence of the large multi-component ships that drift slowly down screen, and have numerous rapid-firing guns as well as a central core that needs to be destroyed. They put out a lot of bullets which wall off large areas of the screen very quickly. Equally, once you have killed the central segment, they then take quite a few seconds to actually explode, which means that by the time they explore they’ve moved even further down the screen, which means that the return bullets will come on from the side of the screen and be even harder to dodge than bullets coming from the top of the screen. You’ll see that I just don’t kill quite a few of these enemies for these reasons, and instead hide on one side of the screen or the other in order to slowly lure their bullet streams down one side of the screen. Even after completing the stage 4 boss, I often screw this stage up, but it goes well here.

blog5

Fifth Boss (14:15 and 38:10)

I think the fifth boss is the most well-designed boss in the game. Basically, it has five “conveyor belts”, and along each conveyor belt a bunch of hexagonal segments spawn and slowly slide along until the belt is full. They then open up and fire bullets at you, and every single hexagon also fives return bullets when destroyed; alongside these challenges, the core of the boss fires spirals of pink bullets, and then fast-moving circles of purple bullets as you do more damage to it. In this first stage you therefore want to kill as many of the hexagons as possible to maximise your points; once you’ve done enough damage to the core, any remaining hexagons self-destruct, and the conveyor belts “close up” and the boss shifts onto a new phase. Here, again, you want to destroy the “coverings” on the conveyor belts before killing the main boss, and it shifts to a sequence of more precise and predictable, but generally faster and more extensive, attacks. In terms of killing the covers before destroying the boss, I do better in the second phase than the first, pushing the boss to its later attacks and therefore getting more points out of it. It’s a tough boss, but a really interesting one and a lot of fun to play, and one that really rewards the player’s skill. Again, I could get a few more points here if I made absolutely sure to skill all the segments, and the “covers”, before killing the boss.

blog6

Sixth Boss (17:45 and 41:40)

The sixth boss was an issue for me for a long time. It is hard to really optimize it and stay close to its relatively small hitbox, although by this point I had found a fairly reliable timing system for being very up-close, whilst the “splurge” attack of bright purple bullets is very tough and fires in a very weird pattern that I find quite difficult to see. The second attack with the three sweeping patterns of long pink bullets is also tough, but then once you destroy the first phase, the real boss begins. The first attacks of dense blocks of pink bullets are hard to dodge and make it tricky to stay close to the boss to maximise damage (although I do my best here) and then an incredibly fast sequence of attacks starts, which I do partly from rote-learning and partly from reflex. It was these final sequences of attacks that sunk so many playthroughs – I had a lot of attempts that died at this boss on the first loop – until I figured out how to handle that attack, and how to speed up the first boss to minimise the number of times I have to face that weirdly-angled bright purple attack.

blog7

blog8

Seventh Stage (19:20 and 43:15)

Whew, the seventh stage! This is just total madness throughout, and yet, weirdly, the denser the screen is in bullets, in some ways the easier I seem to find it. Perhaps because there are so few safe areas at any one time that my brain has to process a smaller number of possibilities? I’m not sure. Either way, these stages went really well both times, even if I had to use bombs pretty often to clear out the screen and pick up more powerups. The final segments of this stage is one of my favourites, with the spinning triangular ships that tumble down the screen and spew out bullets; they look completely wild, but they’re actually one of the easier parts of the stage, and once I get here I know I should get to the boss without any more hits/bombs being expended.

blog9

True Last Boss (47:45!!)

The “final boss” – the massive thing that drifts above the screen before properly coming in to fight, and has three components – is tough, but not actually that tough as long as you kill off one of the side segments before it does the attack where it “traps” you within a funnel of bullets. The True Last Boss (TLB), though – whew. This guy appears when you beat the “final” boss on the second loop; the final boss drops to the bottom of the screen, it explodes, your score comes on screen… and then this amazing music starts playing and the true last boss rises from the bottom of the screen. This guy has three phases, each harder than the last. The first phase restricts the player’s movement, fires these sweeping “shotgun” blasts, lines of bullets that overlap and can be hard to track, and a range of overlapping bullet blasts from various angles that (if your ship is at full strength, which mine was) shouldn’t last too long. The first phase is scary when you haven’t really played the boss much, but not too bad once you know what’s coming.

blog10

The second phase is much harder, due to two main attacks – these six overlapping streams of rapidly-fired densely-packed pink line bullets (at the start of the gif below) and the splurges of light purple bullets that sort of “tumble” down the screen in the second phase, and also overlap. This second part is made even harder at the end when massive volumes of bullets are pumped out on both sides of the boss, too many for anyone to dodge, which are basically designed to limit how much of the screen the player can actually move within. A very hard phase, and the six-sweeping-pink-lines phase came very very close to hitting me towards the end when I rushed to the right-hand side of the screen, but happily that didn’t happen, and the tumbling bullets phase went well.

blog12

The third phase then appears, which is totally bananas. It basically bounces around the screen firing thick lines of bullets, even thicker lines of bullets that track you, and spinning whirls of bullets with only the tiniest gaps between them, as well as just firing out mad bursts of different-sized bullets all over the screen at extremely high speed. I’m honestly amazed I didn’t lose a life here, as I think this is the first playthrough I’ve ever had where I didn’t lose a life on the TLB. However, in fairness and in the interests of reasonably objective reflections on my own play – I definitely got lucky on this phase. Sometimes this final phase trolls you terribly and the boss just sits at the bottom of the screen, or jumps back and forth more rapidly than it does here, so I definitely got a relatively pleasant final phase. The previous world record holder in Hard Mode, if memory serves, had a pretty rough time with the moment pattern of this guy, so that certainly helped my attempt just a little bit. Nevertheless, the TLB is always super-difficult irrespective of how the final phase behaves, and although I used a few bombs, I’m very happy with my performance here, and it’s a very visually striking conclusion to the run.

blog11

Next Game

So, er, I really wasn’t planning on getting this record so quickly, and so I hadn’t really given a lot of thought into what game I was going to play next. I’m considering Warning Forever, maybe Patriot Dark, maybe returning to my Xbox 360 and getting the world record in Decimation X3 (the previous game from the guys who made Score Rush), or maybe competing for the Western records in some of the super-high-competition classic danmaku games, like Ketsui or one of the DoDonPachi series. We’ll see. See you all next week!

Does it matter how it was made?

I recently watched Mad Max: Fury Road. Generally speaking I’ve never been a fan of the action blockbuster, but the film’s very strong lead performances, intriguing and unusual world-building, rich sociopolitical subtexts and – most importantly – extraordinarily striking visuals and art direction elevated it far above the norm to something very compelling, singular, and original. I don’t ordinarily seek out behind-the-scenes stuff for most media I consume, but whenever something has particularly excellent visuals, I tend to look for any videos or information I can find on the creative process behind them (the Dark Souls Design Works and Half-Life’s Raising the Bar remain two of my most treasured books for just this reason). To my shock, it became apparent that in the overwhelming majority of shots, the cars were actually physically present on the shoots: those sweeping takes across the car “fleet” were takes in which all those cars were actually brought on set (though “on set” loses a little meaning in the middle of a desert) and filmed driving alongside one another. I was very pleased to discover this, speaking as someone who has always preferred the real-stunt for the car chase (or the costume or animatronic for the monster) to their CGI equivalents, but it got me thinking.

mm4

One of the most common questions I get on this blog, the various other sites I post about URR on, and in my website email inbox, boil down to “how did you program X?” or “could you please write more technical rather than design/progress-oriented blog entries?”. For the former I try to give a design oriented answer (“I made the system do A B C and keep track of D whilst factoring in E because I wanted it to output F”), whilst the answer to the latter generally boils down to “I’m afraid not”. I don’t write technical entries partly because there’s a lot of very new PCG stuff in URR that is (currently) unique, partly because I don’t find coding as a practice particularly interesting (I enjoy coding, but only because of the results produced at the end), partly because my code is rarely very elegant (since I don’t come from a Computer Science background), partly because I am remarkably ignorant of useful computer science terminology, and partly because I just think what the code does in the game and how a player experiences it is so much more interesting and important than anything I could say about lists, dictionaries and matrices (whatever those are).

I therefore find myself somewhat torn – I think the use of physical objects rather than CGI in Fury Road should be applauded (even though I suspect most viewers couldn’t tell the difference), yet I dismiss equivalent questions about my own under-the-hood processes, and have little-to-no interest in the coding of any other games out there, even those which I love and revere above all others. How can I resolve this apparent bit of cognitive dissonance? Does it actually matter for the appreciation of a piece of art how something is done, or does it only matter what the viewer/player gets from it; and does this vary across genre, or across different creative practices (film-making/game development), or in differing contexts between the contemporary states of different media formats?

mm1

There are certainly arguments that the process of construction is important to the overall artistic product. I’m sure many people would argue that there is undeniable artistry in the “production” of art – that producing film special effects through CGI or physical effects brings a different artistic quality to a film, just as I know of many programmers who certainly describe programming as an artistic and creative process. For myself, it’s definitely a creative process, but only as the means to the creation of the eventual creative product; I’m not a programmer who derive any pleasure from, or has any interest in, creating the most optimal code or the most elegant code or the most interesting and effective way of coding some particular element. It’s not at all artistic for me. Similarly, the perceived aesthetic worth of so many modern art movements are fundamentally contingent upon emphasising the form of production – drawn without the lights on, randomly thrown paint, using only certain pens or brushes, and so forth – that it seems hard to remove the process from the value of the final product. Indeed, in URR all the art is ASCII/ANSI art, and to me some of the visual pleasure in looking at URR’s graphics (if I may say so) comes from understanding the constraints and limits placed upon the artistic process, which is to say the particular process of selecting and placing characters and colours.

On the other hand, by suggesting that process matters, are we not inevitably suggesting that a piece of art cannot stand on its own merits, but we need to know its production for a full appreciation? This brings with it some pretty obvious problems: there are tens of thousands of ancient works we cannot go back and investigate the production of. For every one modern novel whose development can be traced across author interviews and hand-written notes later made available to an interested public, there are a thousand whose origins are shrouded by time. Certainly, we don’t know what we’re missing out on by not appreciating how these were written – perhaps every chapter of a certain work was written only on certain religious holidays, knowledge of which would bring new understandings of the author’s intentions – but there may nevertheless be meanings we can’t comprehend. But if we believe such production-oriented meanings are always important, we inevitably limit ourselves to only partial understandings of almost all works, and that just doesn’t seem right; some of my most profound experiences have been with art (of whatever form) the production of which I knew nothing about, or only learned about after the experience. Perhaps knowledge of how something was made should be treated as an enjoyable addition, not a crucial component?

mm2

In watching Fury Road I also found myself quite surprised that, in essence, I couldn’t tell the difference. I’m sure some people who viewed it realized “wow, none of those are CGI” just as I’m sure others thought the same way I did – “I assume these are CGI, because that’s the norm” – but that was my particular experience. I actually recall some time around halfway through the film thinking “wouldn’t it have been cool if they’d actually got all these cars in these shots?” but such a possibility seemed too remote to be worth taking particularly seriously. I think there is some broader point we can learn here about how the expectations of any art-form, especially in an era of major technological change (CGI in cinema/TV, and the expanding horizons of hardware/software capabilities in games more generally), can come to shape our experiences within that art-form, and even trip us up. Now that we expect so much to be done in cinema through CGI, it actually comes as a shock to learn that something wasn’t made using such a technique.

In turn, that highlights one of the things I find so compelling about the worlds of Dark Souls and Bloodborne (yes, I couldn’t go through a single blog entry without bringing these games up again) – they deliberately produce that same surprise in the player by allowing you to later explore areas that, in 99% of other games, would be mere skybox (background art that shows parts of the game world that cannot actually be explored). You spend much of the game staring at these areas that you expect to be inaccessible, and then when you get there, visiting that place has far more impact than some new location one had never even observed before gaining access. Just as films so often feel slightly more “real” once you know CGI was minimal, the same can perhaps we said about game worlds when you find more of the visual world to be physically present than you perhaps expected.

mm3

As with last week’s piece, I’ve mainly been throwing out ideas here rather than putting forward a particular argument; I’m not yet sure myself where I stand on these questions, and I find the arguments I’ve outlined here (and I’m sure there are many others I’ve omitted) to be equally convincing on both sides. Ultimately, however, I am inclined to think that whether or not it “matters” how an artistic product was produced depends on our appreciation of that medium. I have the deepest appreciation of games and literature, a strong appreciation of cinema and television, and then from there I have a tremendous drop towards my level of appreciation of music, theatre, dance, poetry, and other cultural forms. This is not of course from any rejection of those forms, but they just don’t happen to be the cultural/media forms that especially interest me. But because I know games so well, I can “step behind the curtain” and appreciate how they were constructed if I so desire; I rarely do, but I have the knowledge and expertise to do that. By contrast, I have no real ability to do that for music, as I can barely tell instruments apart, let alone come to appreciate how the method by which an album was constructed should be considered when appreciating the final product.

This does not guarantee that I will have a more shallow experience of that piece of music than someone else, but it certainly alters the nature of my experience from the piece of art itself, to the piece of art and its methods of production. When one engages with the latter, its production methods inevitably find their way into one’s brain: I cannot view a film of a game without considering how it might have been created. Such elements have to matter when we are in a position to consider them, and are bound to influence our consumption of the art; but when we are without them, I don’t think we are any worse off. To return to games, which are after all the focus of this blog, I certainly don’t feel I lacked anything in my appreciation of games when I was younger and didn’t know much about game design, development, and production. Nevertheless, now that I do, I cannot help but appreciate something that subverts our expectations of game production, or a game that was a struggle for a single developer to produce, or a game whose visual or storytelling elements, perhaps, clearly demonstrate a remarkable commitment by its designers or writers. How much production methods matter perhaps therefore depends more than anything upon how much we know of those production methods, what production methods we have come to expect, and the extent to which a piece of media breaks away from those norms and tries something profoundly new – not the pure pragmatics of the basic processes that constitute programming, filming, or putting words to paper.

Figuring Out Enemy Triggers

To what extent should an intelligent player be able to work out the triggers and AI routines that govern enemy behaviors?

This is a question I’ve been pondering some time. This entry has been going back and forth in my head for the several years now (!) so I’ve decided to finally upload it as something more akin to a collection of ideas and questions than a particular conclusion. In URR we’re now implementing conversation and movement AI, before too long we’ll be adding combat AI, and I’ve been wondering how transparent a game’s AI should be. Should the player be able to figure out exactly how it works and be able to predict what it’ll do, or be able to work out how it works but be unable to predict (due to schotastic elements), or should I base it on some other rationale? To think about these issues I’m going to start off with a few example of AI routines being deduced, the benefits and weaknesses of these deductions, and then think about the best way to make an AI interesting and unpredictable: does this come down to random decision-making, to such complex decision-making the player can’t figure it out, or decision-making that can be understood but is too difficult to act upon (the game is too fast, or the variables too many?). As I say, this entry is a large collections of thoughts on this topic, but I don’t think I’ve yet reached any conclusions, so any thoughts you folks all have will be greatly appreciated in the comments section down below.

Metroid Prime

In the original Metroid Prime one of the latest (and by far the hardest) boss is known as Omega Pirate, shown in the picture below. In the fight he teleports around the arena and recharges himself in these three pools around the arena. When you do enough damage to him during a recharge, he will teleport to another pool, and so on until you fail to do a certain amount of damage and he will then stop teleporting and resume the normal fight.

ACmap

At first many players thought it was simply random – it was easy to spot that he never appeared in the same pool twice, but the future pool seemed random. However, someone eventually – after years, I believe – figured out how the game decided, and it actually isn’t random it all. Omega Pirate never appeared in the same pool twice, and never in the pool you were nearest to of the remaining two. This meant that when he vanished from Pool A, standing near Pool C would guarantee he’d spawn at Pool B, and vice versa for B/C. This makes the boss fight significantly easier (especially on speedruns, from what I’ve seen) and even if playing “casually” it’s a massive help – not just can you shoot earlier because you don’t have to look around to figure out where Omega Pirate is going to respawn, it helps you control the boss fight more generally; you can decide when and where to kill the small enemies that spawn throughout the boss fight and position yourself well each time he reappears. In this case, figuring out the AI makes the boss fight undoubtedly easier, and although the actual algorithm is very simple, there were enough possible variables that it took some time until anyone cracked it.

Dark Souls

The Souls games are known for having a large number of bosses with (generally) unique attacks and patterns. Although no Dark Souls boss is fully deterministic – or if they are, the determinism comes down to pixels, or frames, or similar, and likely could never be achieved by a human player – many can be exploited. There are three “Demon” bosses (Asylum Demon, Stray Demon, and Firesage Demon) who share a lot of attacks, including one where the boss flies upwards and does a “butt slam”.

Buttslam

This attack has a very clear tell, is very slow, very easy to dodge, and gives you a good second or two to attack them once they’ve landed. In other words, it is an ideal attack for the boss to do. By contrast, both the Stray Demon and the Firesage Demon have huge area-of-effect attacks, and are fought in small arenas. You don’t want them doing these. Although the system is not perfect, running directly against the belly of the demon when they are resting on the ground has a very high chance of encouraging them to do the butt-slam, and I have often got them into AI loops of 10+ slams in a row, all but trivializing the boss fight. Other bosses have equivalents, such as attacks they might do if you are under/over a certain range, or performing a certain action yourself. One or two bosses are very clearly specifically coded to come out of their “passive” animation and attack the player if you pause to heal (e.g. Artorias), therefore likely mitigating the entire effect of that heal (or doing so much damage you are left worse off than before). In other cases running directly towards them appears to trigger certain actions (e.g. Seath, Smough or the Iron Golem), or being in a certain position relative to the direction the boss is facing will affect attacks (e.g. Kalameet), or knocking the boss below a certain HP (e.g. Manus), whilst others seem to have hidden timers running under the hood for certain attacks before they are allowed to use them again (e.g. the Bed of Chaos’ firestorm). In this case the AI algorithm is determined by your movement and actions related to the boss, not related to the map. The few enemies that do have some pattern other than randomly selecting attacks are generally based on where you are in relation to the boss, or what action you’re doing. Some of these are only “negative” – such as Artorias always attacking when you heal, as long as he isn’t already doing an attack – whilst others, like the Demon bosses, can be useful.

Angband

Angband, one of the classic roguelikes, has a form of AI that has become notorious among roguelike-players because, although broadly deterministic, it is exceedingly hard to outsmart. Rather than randomly selecting from a spell list or a selection of special moves, in most Angband versions enemies aim to choose the most intelligent and appropriate attack from their repertoire for the situation. Whereas in Dungeon Crawl Stone Soup spell-casting enemies, for example, are sometimes balanced by giving them a “spell set” which might have some stronger and weaker attacks (for example, Gloorx Vloq’s Invisibility and Poison Arrow are all but meaningless by the time you encounter him), Angband’s AI always seeks to choose the most painful option for the player. Even if AI decision-making can be perfectly understood, therefore, that doesn’t mean it needs to become trivial. If the decision-making is so strong that the choice the AI makes is always challenging, whilst you may be able to “predict” it (or at least make an educated guess), that doesn’t mean you’ll always be able to deal with it.

ACmap

So it seems fully transparent decision-making need not be simple. If you take the DCSS route and we know the enemy will pick from one attack of four, if all four attacks are very different and demanding to avoid/mitigate, that might be more difficult than an AI that specifically chooses its attacks for the situation. Alternatively, if we follow Angband and we could try to make an educated guess about what attack the AI is going to choose – either because of our actions, or position on the map, or the tactical situation – it still might not be trivial to deal with either due to your character setup or the input skill required to survive. Although the DCSS AI can sometimes work to provide a challenge due to its random behaviour, the Angband AI is more interesting and significantly closer to the question of how predictable it should be, and whether it matters if you can predict what the AI’s going to do. In this way, I’d suggest the Angband AI tries to behave “like a human” – it judges the situation and chooses the best selection. But are players necessarily harder to judge than an AI?

Counter-Strike?

Take a Counterstrike:Source example I played several years ago, which for some reason has always stuck in my head. In the picture below I was the green circle, a little inside the garage on cs_office; my enemy was the red circle, waiting out in the snow. My enemy had a superior weapon and – since I have barely played in the last five years – undoubtedly superior aim. We exchanged momentary fire before I ducked back in. Up the staircase on the left of this image is a window looking out over my foe. I backed off originally intending to move up to that window, but then it struck me that would be too obvious. Hoping my foe would look up there (as in the red dotted line), I instead moved back out. He had indeed started looking up at the window and I was able to pick him off. Whilst not the world’s most brilliant strategy, I was certainly satisfied at having tricked my foe, and whilst carrying it out I felt I had a decent chance of the ruse succeeding. Although I had never played with this player before it seemed like a logical tactic to attempt.

Office

But here’s the interesting thing. Imagine if we codify this into an AI routine. If the AI sees you moving out of its line of sight, maybe it takes note of the direction you’re moving and sorts through the areas you could potentially move into. When it finds the first area from which you could see it and it could see you, the search routine stops and it aims its gun at that point for x seconds until either you appear, or some other trigger overrides it and draws its attention. On one level, it seems like this could make for quite a clever AI. It looks at where you might move to and sets itself up accordingly when you try to flank it, preventing you from just doing a quick loop if some scenery before killing them from behind. However, I think it would be quite easy to spot if an AI always acted this way, and certainly easy to take advantage of in exactly the same way I did. Such an AI, although it might have a fairly complex piece of code behind its where-might-you-next-appear identification routine, would be trivial to understand, and trivial to defeat. Player information would be absolute – moving out of sight causes your enemy to look for other places you might emerge – and provides far too much information to the player on the AI’s systems.

In the situation I fought, the difference was is that I couldn’t be confident my human adversary would do this. My enemy might have thought “He thinks I think he’ll be at the window, so I’ll actually keep my guns trained where he was a moment ago”, and would have been waiting for me. As it happens, they didn’t. In poker terms this is “levels” of thinking – what’s my hand, what’s their hand, what do they think my hand, what do they think I think their hand is… and so on. Perhaps a stronger version of such an AI would flip a virtual coin when you go into cover; half the time they search for where you might appear, and half the time they’ve keep their eyes on where you just vanished. This comes with its own issue – most players, I wager, wouldn’t bother trying to flank, and therefore if they just re-emerge from the same cover, half the time they can guarantee their foe will be looking away from them. But if we take account of this and decide that the AI will only look for your appearance elsewhere on the map 10% of the time so that players who just rush back out will normally get shot, then any savvy player will adapt. How can we keep an AI challenging in this kind of scenario? I think the key here is that landing the shot – especially in a game at the speed of CS and where players have as little health – is not trivial. Even if you’re using a wallhack and you know exactly when and where someone is going to turn around the corner, there’s still no guarantee you’re going to land the kill against a skilled player. So perhaps how demanding your response to the AI choice affects how much it matters if you can predict that choice?

The Solution?

I think we can consider this to be a flowchart. Firstly we can ask – is this game turn-based, so you have a potentially infinite length of time to think about your solution, or is this real-time and you need a reasonable level of twitch/reflex skill in order to survive? If turn-based, an exploitable AI will result in a very mundane experience; put in the correct inputs (which is trivial, since it is turn-based) and you get the output you know you wanted. You’re then left with two solutions. Either you take Angband’s method and make the AI always choose what it considers to be the best move – not a move you have “induced” in the AI like in Dark Souls – and make sure that move will always (or will a lot of the time) be challenging to handle. Or you take the Crawl route and have full randomization of attacks; you know the possibilities of their attacks but you don’t know any given specific incoming attack so you have to respond. For the DCSS method it doesn’t matter that you know how the AI functions (total randomness), and for Angband knowing how the AI functions is actively an important part of the game – even when you know how it functions the game remains highly challenging due to how cleverly the AI behaves. Alternatively, if the game is real-time, you can make your AI’s choices a little more predictable so long as dealing with them isn’t trivial, or figuring out what determines their choices isn’t too simple a process.

In many ways Dark Souls’ AI takes the best of both worlds – attacks are predominantly “random” (from the player’s perspective), and are generally challenging to dodge perfectly. You can exploit them to an extent as an effective strategy, but you still have to execute your avoidance of the attack correctly. For a roguelike, I think Angband’s method works brilliantly so long as the AI really can make those kinds of decisions well, and the decisions aren’t sufficiently trivial that you can immediately negate the severity of the AI’s choices with your own decisions. If the AI’s most devastating attack is hardly different from it just flipping a coin, there’s no threat; but if the AI will always look carefully at its situation and pick the toughest possible choice, there is.

Ultimately, I don’t think I’ve really found the answer in this post – but hopefully I’ve related some of my thoughts about the complex intertwining of predictability, exploit-ability, and the ease or difficulty of playing against certain kinds of AI actors in certain contexts (and how the real-time or turn -based nature of the game is undoubtedly important). Different games handle this in different ways, and for the main part of URR’s AI (the conversations) and the future part of URR’s AI (the combat), I haven’t yet decided on transparency and how it will impact gameplay. As I’ve mentioned in recent entries, conversations are definitely not going to have any kind of counter or visible metric for representing mood – it’s up to the player to figure that out – but that’s only one part of the overall AI transparency questions. It remains to be seen how much of the rest of the AI’s decision-making we want to show, and how much should be kept hidden, and how these decisions are going to wind up shaping the player’s experience of URR.

Replies and Counter Questions

Two exciting realisations about in-game conversations this past fortnight! In the process of continuing with sentence generation it became rapidly apparent that in order to actually ensure conversational flow, and to boost the range of experiences that the player can actually have in talking to the game’s NPCs, several new additions would have to be made. As readers will remember, until now there have been basically three kinds of question – the kinds of question that anyone can be asked from the start of the game (such as “What do you do?” or “What are your religious beliefs?”), the kind of question that only specific people can be asked from the start of the game (such as “What are you guarding?” which would apply only to guards, but can always be asked), and the kind of question that can only be asked after a particular trigger is met (such as “What do you think of the novels of [author]?”, which requires you to have come across the author). There is another “category” of question, as well as a new kind of reply that both the player and the NPC will be able to produce within a conversation. These do not especially increase the required volume of sentence generation implementation, as the creation of an overall framework for sentences (in progress) will be equally applicable to all possible sentences, but they will substantially enhance the variation of in-game conversations, and also their realism and believability. Read on!

Counter-Questions

Counter-questions are, as you might expect, questions that the person you’re talking to winds up asking you, which then lead to a variety of possible replies. So, for instance, they might ask you about YOUR religion, in which case you can be truthful or lie and so forth, and the same will then apply for a range of scenarios. Questions of this sort will be particularly relevant when trying to get past guards, for instance, or when trying to enter particularly restrictive or xenophobic or militaristic nations, and the like. I think this will add a very strong extra layer into the conversation system and the ability for the player to “bluff” their way through certain areas, whilst also (like the above points) boosting the realism of the system by changing it away from a rather simpler question-and-answer system. Here’s an example of what counter-questions might look like based on some of the conversations from last week:

591

Replies

A “reply” in URR is something that can only be said in response to another person’s statement. When a reply is possible, the “Replies” dropdown list will appear, highlighted, right to the special options and to the left of the dialects. Clicking this option will then offer this special sentence/response; if you select another option that isn’t in the replies list, the replies will remain and can be returned to later in the conversation, so this isn’t just a one-off chance. This means that as particularly long conversations continue, the number of possible replies will grow, but it will never grow above half a dozen or so at the most, I would think, and some of the replies will actually be the same as other default questions that simply take on newfound relevance after a previous question. Here’s the same conversation with some answers and two different models: which do you prefer? In the first version the reply and the next question are apart, and the other person might make another comment, whereas in the second version, the reply and the next question are combined…

592

593

If you don’t select the reply when prompted, various things will happen. If they ask you a question and you just go onto asking them another question, they’ll likely be offended. Alternatively, some replies will be akin to “follow-on” questions, so they mention something, and you can then pursue that with them as a result of that conversation. These options will stay in your reply options for that character forever, and can be addressed (or not) whenever.

I’m going to implement this because as I experimented, it became clear that conversational flow in real life is obviously far more of a back-and-forth than a question-and-answer, and the system needed to reflect this. The reply will allow the player to get more depth about a specific question asked instead of moving onto another question, and should be especially relevant if the NPC being talked to winds up revealing something the player wasn’t previously aware of, and wants more information on.

In the process, though, I found myself wondering about the exact flow of the overall. Right now the system is that you select a topic, you select a question, then the questions window closes and you see it spoken and a reply given. This is largely from the inevitable constraints on the size of the screen, fitting in questions as well as images and topic lists, and so forth. I became briefly concerned that this might actually break up the flow of conversation, especially if you want to ask two questions from the same topic list one after the other. To help cancel this out, if you return immediately to a conversation topic you’ll be at the same part of it you previously scrolled into, and I also added in a system that will keep any letters typed in for the search function whilst you’re still in one topic. So let’s say you ask about Artwork X from Nation Y, and you found the question by typing in Nation X’s name into the “Art” menu, and that question is asked, and then you want to ask about another artwork from Nation X, going immediately back into the art list will keep the letters there, but changing to another menu will reset the letter tracker. I think this is quite a good compromise. Equally, of course, we should remember that the conversation system in URR is specifically designed to be a little slower and more thoughtful than the systems one gets in more RPGs where the player is encouraged to just exhaust conversation options. I think the current system (with these recent changes) will now work very smoothly, actually, and I’m happy with the balance between ease-of-access and possibly encouraging the player to think about other relevant options as a conversation progresses.

Next few weeks:

In the coming weeks I’ll be trying (see below) to continue the implementation of counter-questions and work on the implementation of replies, as well as adding all the “Hmm…” stuff and punctuation options into conversations properly, rather than having them only present as a placeholder to test how things look. The other big thing to handle now is that all the [religion] or [date] or [place] modifiers work; a few have been implemented, but again, just quickly and crudely to get a feel for the system. Another task for the coming weeks is to go to all of these, make sure they work, and to make sure NPCs already spawn with the requisite information for personal details – “I was born in [place] in [year]” – as well as civilisation details – “I am from [nation] and we worship [religion]”, and so on. There’s a pretty big selection of these,so it’ll take a bit.

Why no blog post last week?

Last week was the first time in several years I missed a blog update – this, unfortunately, is simply because I am basically working twelve hours, every day including weekends right now, and I’m totally swamped with my work at the moment. Believe me, folks, I am *incredibly* desperate to get 0.8 finally finished and out, but there’s just so much on my plate at the moment with strict fixed deadlines which has to be prioritised, and it’s hard to carve out any time (even at weekends) to do much coding. Just rest assured I am working as hard as I possibly can to get 0.8 released, and I’m really sorry it’s taking so long and I feel tremendously guilty about dragging it out, but things are really tough right now (due also to other life issues beyond what I’ve described here) and I’m deeply stressed out, but doing my best. There’s only so many hours in the day and I just cannot prioritise coding at this month/two-month moment in my life, but I’m trying to grab an hour here and there to just inch forward on conversation implementation. In the coming month, therefore, some of most of the blog entries are going to be other entries on general games topics of discussion/interest I’ve had written for a while and I think you folks will be interested in, and I’ll upload those instead if (as is likely) there isn’t really any URR update to put out. I hope you’ll enjoy these entries; people have always enjoyed these before, so I hope these will keep you all occupied until I’m out of this rough patch. I’m really sorry, I hope you all understand, and I promise 0.8 will be worth it.

Defaults Finished, Negative Replies, Simulated Boredom

All the remaining default conversation options, and all the remaining expansions, are now complete. I’ve also altered the expansion code such that certain expansions aren’t tied to certain words or sentences within a language and guaranteed to appear whenever that sentence or word is said, but instead they appear with a % chance for every instance of a particularly word or phrase someone in that dialect says, depending on their sentence complexity (as we discussed before, sentence complexity is now tied to individuals, not to entire cultures). Here’s a couple of examples, courtesy of our good playtesting friend, Orangejaw Moonblizzard, and some NPCs who may or may not have had their origins changed using admin commands for the sake of testing (as you’ll notice these replies could not be for the same nation!)…

OJ1

OJ2

Negative Replies

The big thing this week and weekend has been working on negative replies – so, for instance, if you ask “Are we near the desert?”, the default response is “We are near [desert] in [direction]”, or whatever, but obviously a valid option is “We are not near the desert” – and this obviously applies to loads of questions. What if the speaker’s nation has no army, or dislikes art, or have never travelled, or doesn’t know any other civilizations, or lives on a tiny island and knows nothing of the wider world, or doesn’t worship a religion, and so on? We therefore now have a body of negative replies for people to basically say “no”, “that’s irrelevant”, “I don’t know”, or “I don’t care”, in hundreds of thousands of interesting ways!

These negative replies effectively now split up into two categories, which we could usefully call “general” and “specific” negative replies. “General” negative replies include replies like “I don’t know”, “I don’t remember”, “I’d rather not answer”, “I’m not authorized to give you that information”, etc, which can apply to a huge range of NPCs in a huge range of situations. Since the player will run into these fairly often, I’ve made sure that there’s a lot of variation in these general negative responses – although in many cases, of course, there’s only so many ways that you can actually utter some of these things, but here are a few examples.

OJ3

“Specific” negative replies refer to asking a question where the answer is still answering the question, rather than a general answer, but still a negative. For instance, if you ask someone what they think a particular policy in their nation should be, they might reply “I have no interest in politics”, or if you ask someone whether they know any distant cities you might want to visit, they might say “I know of no distant cities” – and so on and so forth. Each of these is often more specific and more varied than the above, so I’m trying to bias people towards using these wherever possible, although they are naturally dependent upon particular cultural/political/religious situations.

OJ4

Crowd Disinterest

You’ll all recall the “conversation interest” idea that URR conversations will have implemented – that unless you ask relevant questions, NPCs will quickly lose interest in talking to you. This is to stop the player just going through every single question one after the other, and to encourage you towards asking sensible, logical and appropriate questions. However, I realized the other day that I can’t just limit this to a specific NPC getting bored; if you have a bunch of general questions you’re asking every soldier, for instance, then you could just go from one soldier over to the next soldier in the barracks and start questioning them, ignoring the questions you already asked Soldier 1, but assuming (quite fairly) that they will probably respond the same way, seeing as both Soldier 1 and Soldier 2 are just default soldiers.

Therefore, I need to implement some kind of “crowd disinterest” solution, and I think I’m going to do this on two levels. On the “local level”, NPCs within a building will see who you’re talking to and what you’re asking them about, and also within a map grid (within your line of sight, or nearby), and will take note of the questions. So if you question Soldier 1 about pointless stuff, and they tell you to go away, then you start asking Soldier 2 pointless stuff, the time it’ll take Soldier 2 to lose interest will be shorter than normal; Soldier 3’s will then be even shorter; and so forth. Then, at the global level, I think we need a system whereby information about the player slowly spreads through cultures/cities/religions/etc in the entire world so that people get some idea of whether they should respond to the player or not. Neither of these systems will be in 0.8, but they definitely need to be there.

Next Week

Remember those two new conversation features I mentioned a while back – replies and counter-questions – and also all those questions that have more complex replies, such as lists? Some combination of those will be coming next week – probably the complex replies, I would think. See you then!