Share this project


Share this project

Shadowrun Returns brings back one of our most original & cherished game settings as a 2D turn-based RPG for tablets & PC.
Shadowrun Returns brings back one of our most original & cherished game settings as a 2D turn-based RPG for tablets & PC.
36,276 backers pledged $1,836,447 to help bring this project to life.

Developer Diary: Chris Kohnert


As we mentioned earlier, we’re going to continue giving you small snippets and insights into our development process on Shadowrun Returns. So this latest dev diary falls to me, Chris Kohnert. I head up the engineering efforts in our little office.

I think first off, it bears mentioning that Shadowrun Returns really is a pretty ambitious project. There’s a lot of depth and tactical strategy we’re trying to put into this game, while also keeping alive the fluid and dynamic elements that make a good story-based RPG fun.

One of the most important elements of any good single player game is a challenging and believable AI system. Since we’ve recently been tying up loose ends in the bulk of our core AI, I figured it would be a good time shine a bit of light into some of the elements of it, and how it integrates with some of the story-related gameplay elements of SR:R.

For this game, we have many different ways for you to approach any given scenario: do you try a frontal assault? Do you try to don a disguise and trick the guards into letting you into the server room? Do you need to protect that decker as he overtakes that computer node in order to take control of that mini-gun turret? 

In order to facilitate this flexible approach to tackling a level, the AI must be able to interweave many different disciplines and game systems and respond to a lot of different situations. Let’s talk a bit about how this works at a very high level. 

The very first thing an AI needs to do is to be aware of its surroundings. For instance, when you move around a scene and perform actions, a guard will make an “awareness” check (i.e. “Do I see him?”). This is where stealth, line of sight, and audible cues are sensed and perceived (and also where that awesome ninja suit might come in handy). Assuming the guard sees you, he must then make what we’re calling a “perception” check (i.e. “What do I notice about him?”).

This is where the non-combat elements of the game start to come into play. For example, if you’ve managed to procure a guard’s uniform, he may take a look at you and decide you aren’t a threat. Though, that uniform may not do you any good if you’re carrying a couple of assault rifles when the standard issue weapon is a pistol. (Yes, we actually model that level of sophistication! Though whether it gets into the final game is based on how much fun it winds up being. . .)

Oh and speaking of sophisticated, here's Chris Aardappel, who's taking point on the AI operation.

Once an AI has perceived you and identified you as a threat, it drops down into a high level planning system where it determines what types of actions it should perform. Things like staying near a VIP to protect him or her or barreling down the hallway to take out the interlopers are resolved at this level. This level of logic, in our system, is implemented using behavior trees. They can be very useful for choosing among high level alternatives and goals.

Next, it comes down to tools of the trade. And in this case, that means pulling out your gun or choosing to unleash that Force 4 fireball spell. Our system performs a weighted analysis of options available comparing the action points (AP) available, AP spend-per-action, potential damage, chance-to-hit, splash damage potential, friendly fire, etc. It selects the best option (or two) and queues it up to be performed. This may also involve moving to get in range (or better range) and/or possibly moving to take advantage of nearby cover.

Eventually it all lands in a low level system that is the nuts and bolts of driving the character around on the screen. Choosing which animation to play, how it meshes with the current state of the character (crouching and facing), which weapon(s) are equipped, whether and how much to turn and face... these are all driven by state machines, a simple, but trusted friend of any programmer.

When you put these parts together, it is a very powerful (but complicated) tool. You can see from the diagram that it manages to hook into many of the exciting gameplay elements we’re working on as well. We want to be able to build Runs that are your standard smash and grab, but also be able to play dress up and possibly sneak into a dinner party wearing that fancy suit, or to woo that bank cashier into giving you the extra details regarding the bank manager’s schedule without resorting to violence (necessarily).

One of my favorite features that might not be evident at first (it’s in that diagram if you look carefully), is the ability for a superior’s perception check to influence or even override those made by underlings. For example, let’s say you had a squad of Lone Star security guards and their commander protecting a genetics lab. If you manage to convince the commander that you belong there (i.e. pass a perception check) through, say, intimidation, fake papers, or even disguise, then when you encounter any of the guards later on, they will check with their officer as to whether you belong there.

If the commander says you’re good, the guard will just wave you on. Assuming, of course, that the guard has a high enough discipline trait. If he’s a slacker or doesn't trust (or like) his superior, he may just ignore his commander, and make his own check. This could be for good or bad, depending on whether he thinks you’re suspicious or not. 

Currently, this type of “consult with superior” check is simply done invisibly behind the scenes for the sake of gameplay speed and flow. If you wanted a scripted scenario where the guard stops you, rings his commander, and then makes that assessment upon hearing back, you would probably want to dive into the trigger system and implement that kind of logic there.

We’ve come a long way on AI, but there is definitely a lot of work still remaining. We have a lot of different skills and abilities being coded up right now, so we’ll need to spend some time folding that extra logic into the various levels. We have to make sure the enemy Shamans summon things correctly and that mages will use that trusty Fireball I mentioned earlier without going unconscious from the strain. We’re also continually refining the overall believability of the AI to make sure it feels smart and fun while maintaining a proper challenge level.

That’s about it for my little peek behind the scenes. I hope it gives you an idea of what we’ve been up to on Shadowrun Returns! 




    1. Creator Jacob & Natasha Germany on February 24, 2013

      It would be nice to have control in the editor over even lower-level AI points, like adding the superior's perception check as an in-game dialogue. If that were awesome, a simple trigger or extra dialogue more and you could add in an option to hack the comm of that soldier so he can't communicate with the officer. It would all hinge, though, on how deep the editor would allow us to create triggers or dialogues based off of behind-the-scenes AI steps. If that was possible, cool possibilities certainly present themselves.

    2. Creator TheBlade on December 13, 2012

      Just layer after layer of awesome.

    3. Creator Patricia on December 9, 2012

      Great update guys!!! Man but this game has me soooo damn excited :D

    4. Creator Jesse Sanford on December 8, 2012

      Though, that uniform may not do you any good if you’re carrying a couple of assault rifles when the standard issue weapon is a pistol. (Yes, we actually model that level of sophistication! Though whether it gets into the final game is based on how much fun it winds up being. . .)

      PLEASE LET THIS MAKE THE RELEASE BUILD. that is an excellent idea that absolutely captures the spirit of shadowrunning and changes the "disguise/stealth" element from the typical "i has the stealths" feeling that most games use. acquiring the fob should not be enough to suddenly be invisible to security; these are highly trained guards at corporate arcologies, and a large part of the magic of Shadowrun was preparing and executing the perfect plan.

    5. Creator David Herman on December 8, 2012

      you NEED to leave in the choices about what type of weapon/armor/gear (even race!)we are packing/ If i can roll into to Tir as an Ork rolling in with an RPG in a Copper Maiden tshirt, the same as a dressed up elf with no weapons spotted, it's going to cheapen the experience.

    6. Creator Paul van Bruggen on December 8, 2012

      Love the updates! Don't cut down on them :D

      Also, the sophistication of these systems is rather awesome. Can't wait to play this game!

    7. Creator Hideo Kuze on December 8, 2012

      I loved what I just read. Very cool system indeed.
      If you guys manage to implement all of this, the game will be a blast to play.
      Keep up the good work.
      offtopic: (since everybody is whining about it) for the record, I have no problem with pics

    8. Creator Arteziya on December 8, 2012

      Wow, now THAT were some MASSIVE PICTURES. O_O
      Interesting update, but those pics were kinda distracting.

    9. Creator Clint Foster on December 8, 2012

      Holy shit, how wide is your fucking monitor?

      I've tried to read this on an iOS device and now my 1920-wide monitor in Firefox and I have to scroll horizontally in both. Dude, I don't need to see your new haircut or whatever.

      Please consider sending email updates with these minutiae as attachments or something.


    10. Creator William on December 7, 2012

      Goto that page and unclick whatever projects you don't want to get email updates for. Whenever you decide you want to look and see how the game is going, come back to, and look at the little globe icon at upper right, and click it. It will show you the updates you've missed.

    11. Creator Tony Buttafuoco on December 7, 2012

      How do we sign up for less updates? I honestly just want the game and maybe a changelog once a month, max.

    12. Creator vincentlorditch on December 7, 2012

      Can't wait! Sounds in depth, and amazing detail to the game that it deserves. Sounds like I'll be cursing at it like a sailor.

      But really we don't need 2,448px × 3,264px pictures in our email. I had to scroll sideways just to read it. Till I remembered i could just read it here.

    13. Creator blackdrazon on December 7, 2012

      Giant photos ended up stretching this entire update in my Gmail, had to pan horizontally to see all the text and it made things a little silly. Good to see that Kickstarter scales them down but but smaller-scale images linking to the larger ones might be better for email purposes. At least, I'd hope so, I'm not really sure what's going on behind the scenes at your side, Kickstarter's or Gmail's...

    14. Creator Florian BOEUF on December 7, 2012

      Hello people!

      First, congrats for this post! Being a game developer myself, I know how hard it can be to explain such things, and how deep you can go without running out of things to say!

      One question, as a Shadowrun paper RPG player: if astral world makes it into the game, how will you implement astral perception and interaction (particularly for astral "beacons" or players having a strong aura but no astral perception/awareness and having to face mages, for example)?

      Take care guys!

    15. Creator Emeraude on December 7, 2012

      I am SO loving everything I'm reading there.

      Thanks a lot for that. Haven't been so pumped by a game in a loooong time.

    16. Creator Gonchi on December 7, 2012

      This all sounds very cool. Hope the AI checking uniforms/weapons and the like makes it in, I've run into it before in other games and it adds a lot to the experience.

    17. Creator MilitiaJim on December 7, 2012

      This is sounding like an engine that will be good for a lot of cool stuff.

    18. Creator Claire Blackshaw on December 7, 2012

      I love this post and I'm a huge fan of behavior trees and state machines because it's a reasonable task to expose a lot of this to the scenario designer which is fascinating and leads to very interesting level design esp regarding leg work.

    19. Creator RC on December 7, 2012

      Hoi Chummers!


      So whadda ya know?! That's one hell of a Dev Diary there Chris. Seriously chummer, thank you for sharing...because you've just totally blown my mind. Once again I'm so excited hearing about Shadowrun Returns it's like a cranial BOMB of AWESOME exploded in my BRAIN!!! ^_`'`'`'`'`'`'`'`'`'`'`'`'`'`''`'`


      Ja Mata!



    20. Creator Ho-Sheng Hsiao on December 7, 2012

      I for one, would love as much sophistication in the perception model. At one point, I wanted to use tactical games to explore the original concepts of fog of war and uncertainty that was described by von Clauswitz, John Boyd, Musashi, and Sun Tzu. But most games don't do that. The "fog of war" in RTS is not really fog of war. I had toyed with the idea of writing my own tactical sim just to explore these ideas.

      Perhaps consider making stuff like having the right weapons out in the open be something that matters when you play the game on 'Hard'.

    21. Creator Laurent Maire on December 7, 2012

      Wow, never expected the AI to be so smart. As a player we tend to look for complexity more in external or environmental stuff. Tactical advantages we can use to our advantage. It's quite eye-opening to realise that our strategies rely as much on the intangible cleverness of our foes as on on our own skill.

    22. Creator Richard Hendricks on December 7, 2012

      That's a great AI flowchart. Would it be OK if I used it for a small project of my own?

    23. Creator Jamas Enright on December 7, 2012

      Thing to then consider is being able to say "check with superior" as part of the dialogue options. (As well as 'you don't need to check').

    24. Creator TheJTrain on December 7, 2012

      Awesome stuff!!!

    25. Creator Victor Kuo on December 7, 2012

      Whoa, what's with the poster sized pictures in my email. I think I can see every pore in their faces.

    26. Creator J.R. Riedel on December 7, 2012

      I find AI projects fascinating, I'm glad you posted this!

    27. Creator Harebrained Schemes LLC on December 7, 2012

      Aaahh so sorry about the MASSIVE images. My (Sally) bad. I remembered to change the image size last time and I was SO EXCITED to post this time that I forgot. Won't happen again, guys.

    28. Creator Lordnine on December 7, 2012

      Please compress and shrink photos in the future. Those images are huge for email.

    29. Creator Ryan "Keokuk" Smith on December 7, 2012

      Woot more insight! :D

    30. Creator Sérgio Schüler on December 7, 2012

      This is so impressive. Respect.

    31. Creator K on December 7, 2012

      Sweet AI programming! Makes me want to look into that some now.

    32. Creator Rehevkor on December 7, 2012

      The guards looking at what weapon you're holding, checking with their superiors, and potentially ignoring orders based on a personality trait sounds awesome! I hope you do include that stuff in the final game.

      Bonus points if you at least see the guard touch his earpiece and see some dialogue text of him conferring with his commander. It would make for a nice tense moment.

    33. Creator Rafael Lopes Vivian on December 7, 2012

      I got this update through email. First photo is 2448 pixels wide. WHY, MY GOD, WHY?!? They're PROGRAMMERS for fuck's sake!

    34. Creator Sylvio S Maia Conde on December 7, 2012

      "(Yes, we actually model that level of sophistication! Though whether it gets into the final game is based on how much fun it winds up being. . .)"

      This is extremely awesome, leave it in! The system in general sounds superior to most games as well, nowadays guards just notice you and come all guns blazing.

    35. Creator T.J. Brumfield on December 7, 2012

      Looks amazing. This certainly exceeds my expectations.

    36. Creator Serena Nelson - Hero of the AGRM on December 7, 2012

      Great update. I loved reading about the AI logic and decision trees.

    37. Creator Augustine Von Freiburg on December 7, 2012

      Thanks for the info. It was a very interesting read.

      +! about the images in the email.

    38. Creator Joshua Sorensen on December 7, 2012

      Thanks for the update. I'm starting to get really excited for shadowrun (as i never played the very first one, only heard about it)

      A heads up though. Your pictures are now bigger than my screen in the email. If you're going to include pictures you might think about reducing their size.