Sunday, October 15, 2017

Big Speech

Part sixteen in a weekly(⛰) devlog.

Standard development disclaimers apply. This is pre-pre-Alpha content, everything is subject to change, features may not be present in the final version, there's a very strong chance none of this will ever be released, etc. etc.

There shouldn't be any plot spoilers in these posts, but there will be occasional discussions related to characters, locations, mechanics, and other aspects of my potential upcoming Shadowrun campaign (tentatively titled "CalFree in Chains"). You may wish to skip them if you'd like to be completely surprised.  

I started work on the climax. Yay! I also rewrote the climax. Yikes!

I’ve been looking forward to this - obviously the climax is a significant milestone in the dev phase. As I was ramping up to begin work, though, it gradually dawned on me that the boss fight felt, uh, anti-climactic. I’d come off of a couple of late-game missions with final confrontations that were pretty interesting: unique mechanics or victory conditions or environmental factors that put a challenging twist on the fight. By comparison, the final fight in the game was a very stock “shoot all the bad guys until they are all dead” affair. I think there’s some interesting narrative context to what’s going on, and also some potentially cool visual elements to the battlefield, but the actual mechanics of the battle just felt bleh.

I’m curious about how our brain works. The interval between me recognizing “Oh, there’s a problem here” to “Here’s the solution!” was surprisingly short. It makes me wonder if my subconscious had realized the issue before and had been chugging away in the background, proposing alternatives, causing one to pop out to me before too much longer.

Much as with the horror level I mentioned last week, the solution here partially involved reviving a previously-discarded idea from what I’ve come to think of as the “bad end” of the game. It doesn’t necessarily change the ending, but adds the threat of a worse ending, with tiered failure conditions that will carry over into the finale, which I think adds even more motivation and tension to the fight, on top of the purely story-based ones that already exist. Once I had that in mind, there were some obvious mechanics that I could build into the fight that present some interesting decisions for players to pursue, weighing pros and cons against the more straightforward task of killing bad guys.

I’m still in the process of building it out, but I’m decently happy with it. In all honesty, it’s probably a step down from the final fight in Caldecott - that had a really nice combination of tightness, reactivity, and branching that I don’t think I’ve replicated here - but it does add some unique new elements that I think help this stand on its own.

So: As with all of my scenes, one component of the climax is crew reactions. As you encounter obstacles and make decisions, your teammates will periodically sound off, commenting on your actions or offering advice. I do this a TON, there are probably literally hundreds of reactions throughout the game. Let’s take a look at how to do ‘em.

Let’s start with an anti-pattern. Here’s an example of how this used to work back in the Dragonfall era, using a convo from the official campaign as an example:

This comes from the start of the Aztechnology raid. The basic idea is simple: you have four potential crew members, the game checks to see which of them are present and then has them speak. It feels nice and natural in-game, but it’s kind of clunky from a development perspective.

  • There’s a lot of duplication. Eiger delivers the exact same line many times.
  • This makes revisions/edits more difficult. If you later spot a typo, you need to track down the four or so copies of the line and make sure you update each of them.
  • The amount of work increases exponentially with the number of characters. This is a “four pick three” combination; when I think of doing this with a “six pick three”, my nose starts bleeding.
  • It’s difficult to track what’s going on. It’s so long that you can’t see easily all the branches on screen at once, which can make it harder to see if a character is getting skipped or if you’re missing something in a particular branch (like the etiquette check here).

Back in the Dragonfall days, this was probably the best way to do it. I took a different approach in the Antumbra games, with looping dialogs that returned to a an empty root node after each interjection; unfortunately, with the way the conversation engine worked in this game, it would auto-skip past intermediate blue nodes, so the player would only actually see the final interjection, unless I manually inserted a red-text player response after each one. This is why there are a lot of “nothing” responses in Antumbra, like “I see.” and “Go on.”

Fortunately, Hong Kong made a subtle but enormously helpful change, eliminating the skip-through and allowing each blue node to be shown in sequence as intended. That’s made my life writing reactive dialogue FAR easier. In all honesty, if it wasn’t for this one update, there’s a very good chance that I’d be writing CFiC in Dragonfall instead of in Hong Kong: I love the music and other goodies that we lost from that game, but the improvements in dialogue handling are so important that they blow all other considerations out of the water.

Anyways, let’s look at one particular conversation. This is an excerpt from the Sacramento mission that we’ve previously looked at. When your character encounters a decision, all of your companions can chime in, offering their own perspective that expresses their values and desires.

So, the basic idea here is:
  1. Create a blank blue node. It functions a little like a traffic conductor, deciding who should speak when. Here I've added the comment "Reactive party check-in" so I can easily see where it's referenced.
  2. Create an empty red node. The conversation will automatically proceed into any blank red node, PROVIDED IT IS VALID.
  3. Check the “Available only once” tick (bottom oval). This ensures that we won’t endlessly loop into this interjection.
  4. Add a prerequisite (middle oval). Here, we’re checking to see if an actor with the correct tag is present. These tags are set on the crew members’ character sheets, so we can access them even if we spawned them through the hiring screen. By setting this prerequisite, we’ll only proceed into this branch if the speaker is present, and skip it otherwise.
  5. Finally, add the companion’s own dialogue. For the speaker, select the [tag] for this character. When the scene runs, the game will find an actor with that tag and show their portrait in the interface. (If you mess up and select the wrong person’s tag, their portrait will show instead. If there is nobody with that tag present, it will show the default speaker. Avoid these problems by always matching the tag in the pre-req with the tag for the speaker.).
  6. If desired, you can add more nodes in this branch from the same speaker, responses from the player character, or dialogue from other folks in the scene.
  7. Once this branch is finished, use “copy link” to send the dialogue back to the blank blue node we created in step 1.
  8. Repeat steps 2-7 for all the crew members / other people you want to optionally speak.
  9. At the bottom, include a blank red node with no pre-requisites. This is the final branch out of the optional interjections, and continues the main thread of the dialogue. (Alternately, you could omit this to just end the convo, or give the player dialogue choices - those will display once they have exhausted all blank responses.)

That probably sounds like a lot - in practice, once you get it down, it’s almost trivial to build. I generally lay out one blank interjection, copy-paste it however many times I need, and then fill in each individual’s tags at the same time I’m adding their lines.

Here are some brief videos showing how the same conversation might play out differently depending on who you have in your squad. Dialogue contains some minor plot spoilers.

And, that’s it! These have been real meat-and-potatoes in my scene work, and it’s just now occurring to me that I’m probably almost done with them. There’s still a ton of branching dialogue to do, but specific party-based reactivity like this will be finished after I wrap up the climax. Once again, that’s a very nice milestone to reach!

Friday, October 13, 2017

The Entire Northern Side Was Covered With Fire

Taking a break from creating the future apocalypse to comment on the present apocalypse:

The Bay Area has been surreal this week. I'm far south of the fires and not directly affected, but the entire region has filled up with smoke from the flames. Every time I step outside it smells like a campfire, and we've had surreal sunrises and sunsets that make me feel like I'm on an alien planet.

This region is usually very fortunate in that we're adjacent to the ocean and typical wind patterns help circulate in clear air, avoiding the bad pollution that plagues valleys in California. But the northern winds are a curse in this case, both for the spread of the fires and the subsequent spread of smoke. The air quality is as bad here now as it is on the worst days in Beijing.

For posterity, here are a few images of what things look like here and now. (None are my own photos, each links out to the source, but they line up with my own experiences over the past few days.)






Of course, we have it far better than our neighbors in the North Bay who have lost their homes, jobs, and loved ones. I'd appreciate it if you could keep them in your thoughts.

Sunday, October 08, 2017

Atmospheric Disturbances

Part fifteen in a weekly(👻) devlog.

Standard development disclaimers apply. This is pre-pre-Alpha content, everything is subject to change, features may not be present in the final version, there's a very strong chance none of this will ever be released, etc. etc.

There shouldn't be any plot spoilers in these posts, but there will be occasional discussions related to characters, locations, mechanics, and other aspects of my potential upcoming Shadowrun campaign (tentatively titled "CalFree in Chains"). You may wish to skip them if you'd like to be completely surprised. 

I'm not much of a horror person, but for some reason I really enjoy creating horror-tinged levels in my Shadowrun mods. This week I've been working on the last one that I'll ever make, and it's been a blast. After making several of these games, it becomes increasingly challenging to think of creative new puzzles to solve and creative new boss fight mechanics, but there's a well of inspiration for creepy scenes that has yet to run dry.

This particular scene was inspired by my original ending for this campaign. Not to say that the new ending is all sunshine and daffodils, but my original vision was much bleaker. I chickened out of that conclusion, but I loved it, so I recycled the shape of the arc and the interior beats and morphed them into this more-or-less stand-alone mission. At the risk of sounding arrogant, I think it's the best one I've created yet! I get a weird thrill from the subtle and gradual slide into dread, which I think comes across really well here.

The scene is taking notably longer to create than I had expected, but I have zero regrets, since every minute I spend in it is resulting in something that feels tighter and more effective. Atmosphere is important in any Shadowrun mission, but it's especially important for the creepier ones: you're trying to guide the player into a certain mental state, and you have a better shot at succeeding if you use all the tools at your disposal: dialogue and lighting and sound and graphics and everything. For it to work, it needs to be synchronized and logical, so I end up doing a lot of iterative testing, figuring out the appropriate gaps between events to make it work.

There are a few tools at my disposal when I want to create an effective atmosphere, whether for horror or something else. In no particular order, they include:

Sound Effects

These can be run by a simple trigger command, Gameplay -> Play Sound. It's easy to browse through the drop-down and look for a sound that will fit your scene.

A few notes:

  • Most (not all!) of the sounds in the "ambient" packages do not actually play. There are a few exceptions, like the Raven sound in ambient_graveyard. Be sure to test any sound you use. EDIT: Ah! I've discovered that the sounds can play, so long as you add that sound to an ambient audio node present on the map. I suspect that this means they'll also play if you add the containing sound set to the region's ambience, though I haven't tested that yet. (Note that, while all the default ambiences use a single sound set, you can add more to include additional sounds from other sets.)
  • Volumes are pretty well normalized, but you can drop the volume if you want something to sound subtle, distant, etc.
  • Avoid anything with "loop" in the title, as these will play forever. Unless that's what you want, but then be sure to use the Stop Sound trigger. But in that case, I would prefer to use an Ambient Audio gizmo, which you can move in or out of the scene as appropriate.
  • A few sounds are actually sound sets, and will rotate through a different sound each time it is invoked. For example, "Ghoul Chomp" will switch between two different sounds. Usually these are all similar enough that they will work in your trigger, but again, test it to verify.
One really nice utility for evaluating sounds, especially when you're getting familiar with the library, is the Aztechnology Aural Mindscape mod.  This is a standalone "campaign" that lets you easily play all of the sound effects and music in the Hong Kong campaign.


Great when you want an on-screen character to visually do something: act surprised or fall down or shrug or whatever. You can browse these through the Actor Play Animation from Manifest command. Almost everything is included under the Hong Kong General category. There are a lot! The ones with "idle" in the name are persistent, so the actor will continue to hold the pose until they do something different (either from a subsequent Play Animation command or the result of a standard walk, attack, etc.). The non-idle animations generally perform a single discrete action, like throwing something, and then reset to the idle standing state.

One important note: playing animations from a manifest will only move the actor's body, nothing else. For example, if you play a spellcasting animation, your character will move their hands and arms as expected, but you won't see any colorful sparkles. Sometimes that's what you want, sometimes it isn't.


If you've been making maps, you're probably already familiar with prop FX, which you can drag into your scene to add dynamic atmosphere: billowing green smoke or flashing sparks or glowing mana. I've been using those forever, but I've only recently started using scripted FX. These usually perform a single discrete effect in the environment: a fiery explosion or crows flying away or a burst of electricity. A few of them can be played directly on an actor. For example, playing the "Smoking" animation from the manifest will just simulate the arm motion of smoking; playing the "Berlin:LoopedSmokingIdle" FX on an actor will produce the same motion but also add the lit cigarette glow.

Unlike playing animations or sounds, you can't browse through FX, you need to know the name of the effect. If you know where it is used in one of the official campaigns, you can just open the scene in the editor and look it up from the trigger. I've found it most convenient to search the wiki page for something that looks promising.

And, uh, that's it! These are too spoilery to show off, but I've been really happy with how things are coming together. I'm using a few more animations and sounds than in Caldecott, and a lot more FX, and I think it's helping CalFree In Chains to be my most atmospheric campaign yet.

Sunday, October 01, 2017

Curiously recurring templates

Part fourteen in a weekly(🖼️) devlog.

Standard development disclaimers apply. This is pre-pre-Alpha content, everything is subject to change, features may not be present in the final version, there's a very strong chance none of this will ever be released, etc. etc.

There shouldn't be any plot spoilers in these posts, but there will be occasional discussions related to characters, locations, mechanics, and other aspects of my potential upcoming Shadowrun campaign (tentatively titled "CalFree in Chains"). You may wish to skip them if you'd like to be completely surprised. 

This was another weekend of cut-scene work. I think it’s the last significant one in the game… there are many more missions after this, but I think the major story beats from here on out are just done through dialogue or direct action. It was fairly time-consuming to get right, but not especially tricky. Unlike the first one, which had a lot of movement, the characters are mostly stationary for this one, but there’s a fair amount of synchronized action. But not TOO synchronized… it looks really fake if you have a whole bunch of characters performing an action in lockstep, so there are little micro-pauses scattered throughout to make it feel a little more realistic.

I’ve already talked about cut-scenes before, though, so this time around, let’s talk about image manipulation.

I am not an artist. At all. That’s a huge part of the reason why I shied away from game development after early youthful enthusiasm: I can’t draw, don’t have a very good artistic eye, and am generally helpless when it comes to visual things. Which, again, is a huge part of the reason why Shadowrun is such a tempting platform for me to create on, thanks to its amazing library of great-looking artwork.

There are still a handful of images that I need to work with, though. A big example of this is loading screens. By default, if you don’t set a loading screen, you’ll see something like this when a scene loads.

Pretty gnarly, right? The image itself isn’t bad - it’s a nicely generic dystopia-plus-magic tableau that says “Shadowrun” - but it’s not very readable. In particular, the white text blends into the white pixels of the background image. What gives?

Well, this is the same default image that’s been around since the very first Shadowrun Return game in 2013. Back in that prehistoric era, they used to draw a translucent overlay on top of the loading image to provide nice contrast between the image and the text. With the shift to Dragonfall, HBS removed that overlay. This was a fine change on its own - it gives more flexibility in how you compose the image, keeps it from appearing needlessly dark - but the default image was never updated, so it’s no longer an acceptable fallback.

So, we need to produce our own image. We can provide any 1024x1024 PNG, but adding a random image will look janky within the game, with an abrupt transition to the black border and potentially the same white-on-white contrast problem.

Fortunately, people with more talent than I have come up with good tools to produce your own loading screens that look good, match the general feel of the official campaigns, and solve the text problem. The one I’m currently using is an update of the CXZman template, a Photoshop layered PSD with smart objects that ingests an image and outputs a nicely framed version of that image.

As a sidebar, this is the only time I use Photoshop. I’m much more familiar and comfortable with GIMP, and tend to prefer that for any image-related floundering. But this particular template really does require proper Photoshop to work.

I’ve used versions of this template before for Antumbra Saga and The Caldecott Caper, so I’m already somewhat familiar with it. At the same time, I kind of wanted to mix things up a little. In particular, that teal-ish blue border feels really dated to me. The official Hong Kong campaign has a really nice gradient border. I can’t do that, but it’s pretty simply to just replace one color with another, so I arbitrarily decided that CFiC would use an orange border instead.

You can put any image that you want within this. I’ve been following the convention of the HBS campaigns and my own prior games to populate these with in-engine screenshots of the current scenes. I like this, since the in-game artwork looks really nice, and it’s fairly simple to capture (you can just use the Steam screenshot button or a similar utility). I’ll build and run the scene without any other characters in it, then just move my player around to various areas to life the fog-of-war and capture a screenshot. This time around, I captured these in 1920x1080 resolution, which gave a lot of buffer for the roughly 900x520 visible space within the frame.

The image actually needs to be placed twice. First, double-click the “Actual artwork” smart object. Hide any existing art by clicking the eyeball icon in the lower-right. Then drag the screenshot PNG in.

In my previous games, I always just accepted the centered version of the image. This time, I was a little more opinionated, and would pan the image to what I thought was the best-looking position. Brighter colors tend to look nicer; keep in mind that a translucent overlay will cover the left half of the image, so that area may look particularly dark anyways. I try to avoid including any UI elements, most notably the PDA/power button in the upper left.

Once I’m happy with how it looks, I save the smart object (“placing” the new image within it) and return to the template. Next, I need to repeat this process in the “Glow light filter” smart object. If you forget this step, it will light the new image with glow colors from the previous image, which isn’t too noticeable on some pictures but can be very jarring on others. This process was a bit more complicated this time around, since I would need to position the pasted image at the exact same offset as in the “Actual artwork”.

After that’s done, the image is ready! The template automatically handles cropping and overlays and the gradient and glow and everything. You can then export it as a 1024x1024 image. This goes into the art/loadingimages folder of your content pack, after which it will appear as an optional loading screen within the editor and, eventually, within the game.

Much nicer!

Custom loading screens definitely aren’t necessary, and don’t have any direct impact on the game’s functions, but I think they’re one of the critical factors in making a campaign feel polished. These are some of the first images a player will see when starting a campaign, and they may be looking at them for quite a long time thanks to the long load times! So taking a little extra time to make sure they look good is, in my opinion, time well spent.

Sunday, September 24, 2017


Part thirteen in a weekly(☣️) devlog.

Standard development disclaimers apply. This is pre-pre-pre-Alpha content, everything is subject to change, features may not be present in the final version, there's a very strong chance none of this will ever be released, etc. etc.

There shouldn't be any plot spoilers in these posts, but there will be occasional discussions related to characters, locations, mechanics, and other aspects of my potential upcoming Shadowrun campaign (tentatively titled "CalFree in Chains"). You may wish to skip them if you'd like to be completely surprised.

I finally finished that monster 30-page mission, hurrah! Not only was this probably the longest mission of the campaign (in terms of text, and, depending on your playstyle, possibly clock time as well), but it also marked the half-way point of missions. That doesn't mean I'm halfway done with the game - I haven't even started scripting the hub yet, where about half of the dialogs take place - but it's still a really nice milestone to cross.

I'm currently working on the mission after that, the last one before the next critical-path story mission. This one is a bit more conventional, with a little dialogue, some puzzles, and a fair amount of mandatory combat. But I try to do something unique in every mission, so this one has a few wrinkles, especially in the combat. Another unique thing about this mission is it gives you the chance to craft a unique weapon of your choice. I'd like to chat a bit about the design and implementation of this feature.

My Words Are Poison

My favorite thing about RPGs is the intersection of choice, morality, and gameplay. I think a game is designed well if you choose a mechanically inferior outcome because it leads to a morally superior outcome. Shadowrun tends not to have clear-cut good and evil characters, but absolutely has a wide variety of factions and values to which a player may align themself. A simple example here is supporting Samuel's ork resource center in Dragonfall: there isn't a gameplay advantage to giving him nuyen, and you'd be better off hoarding the cash, but a lot of players gladly become benefactors.

In my current mission, you can come into the possession of a deadly venom. There's an immediate plot-required use of this venom to manufacture an antidote. But you can acquire more than is needed, and then can choose how to use the surplus. There are a variety of options for this. You can make even more of an antidote, which is a benign use and may support your team in the future. You can hoard it for a phat cash payout. Or, if you can locate the required schematics, you can craft one of several unique poison weapons.

This doesn't have huge repercussions, and I don't need to track much beyond the player's initial decision. But it may be a relatively significant decision for the player to make: how badly do I want this cool new toy? Am I willing to take risks to get it? What will my companions think of this decision, and do I care?


I mused over the weapon selection for a little while. I wanted some choice here, both to make things more interesting and to support different playstyles: if the only option was, say, a new throwing weapon, then it wouldn't be tempting for 90% of player builds. But I also didn't want to go overboard. It would be time-consuming to create 9 new unique weapons, and there's an ongoing cost to tune and support all of them.

I ended up with three main weapon selections: a bioweapon grenade launcher, a poisoned axe, and venomous hand razors (a cyberweapon). I'd initially considered doing poison rounds for firearms, but that would have required making different variation for each weapon type (pistol, rifle, etc.). I like the example of the grenade launcher: unlike most weapons, it only uses the Ranged Combat stat, and doesn't have a specialization like Rifle, so many more players can use it. The axe is useful for melee characters; I'd previously created a unique unarmed "weapon" in a previous mission so it felt like that slot was already filled. The hand razors fit into an existing gap between the entry-level and end-game cyberweapons, using poison damage instead of the customary bleeding type.

In terms of power level, these weapons are all "Tier 2", which is about the level that players will likely be using, so the weapons should be useful but won't be essential top-tier gear. They also have some unique mechanics, so even if a player already has Tier 2 gear they can be situationally useful. Heck, even after upgrading to Tier 3 they might keep them around if they have a spare slot. The axe and the launcher can be used by other crew members, so if you personally outgrow their usefulness, they could become hand-me-downs.

The hand razors can't be transferred and are only useful if your PC has the appropriate skill, so I gate its creation behind the Cyber Affinity skill. I also gave options to pick up Acid Bolt or Acid Stream, which are existing spells that can be useful to casters.

Copy That

So: You can absolutely make complete Shadowrun campaigns using only the official editor. However, as my campaigns have become more ambitious and polished, I've started dabbling in creating unique things that can't be directly made within the editor: new gear, weapons, spells, crew advancement, etc. This requires manually editing text files, so it's a different skill set than standard mission creation.

I always start off by finding an existing file to copy and modify. You can locate these in the official content pack. In my case, I'll use the existing Grenade Launcher as my template, which is located in data/items/ex 1\ m203.item.txt.  Here it is!

I rename this and place it into my own content pack, with the new name data/items/ex 1\ poison.item.txt. Here's the updated version:

The modified properties have been marked up with violet lines. Here's a quick run-down of what I changed and why:

  • ID: This must match the filename, minus the .txt extension, but the capitalization can vary. I try to follow their existing conventions for naming items. Here it's similar to the existing grenade launcher.
  • Icon: Just noting here that I did not modify the icon. Icons are baked into the game itself. You can switch to another icon, but can't create new icons. The existing launcher one is fine so I stuck with that.
  • Name: Obviously, giving this a new name. This is player-visible.
  • Description: More detailed flavor text about the item. Some weapons also include stats here, others don't. Note that there is limited space in the UI to show descriptions, so don't make this too long.
  • Base HP damage: To differentiate this from the existing grenade launcher, I lowered the initial damage but added a new damage-over-time effect. The total damage per shot can end up being greater, but takes longer to be fully applied. This has the nice side-effect of reducing the cyberarm auto-reloaded exploit: you can still fire off multiple rounds in one turn, but since the DOT effects don't stack, it isn't quite as overpowered as the vanilla launcher.
  • Modeless Ability: Not shown here, but I copied and modified the existing ability. The new one has updated text and will show poison FX on enemies instead of the default explosion one.
  • Effect Duration: I added a new DOT effect. I copy-pasted this and the following lines from another weapon with a similar effect (I think the incendiary grenade, though it doesn't really matter) and edited them to match this weapon's concept.
  • ActivationStatusEffects: I'll tune this based on my testing, but the idea here is applying 8 HP damage per round for 2 more rounds. This particular weapon does not bypass armor, but the axe and razors do.
  • Store cost: I artificially lowered the cost of this so it isn't too valuable for players to sell. If they want the cash, then they should choose one of the other outcomes for this mini-quest. As noted above, due to the unique mechanics of this weapon it could still be useful to your party in the end-game, since multiple crew members have a spare equipment slot and have the Ranged Combat skill required to wield it.
  • Sorting group: This defines where the weapon will appear within the Shadowrun editor. You can use anything you like here, but I generally cluster my items into categories like "Unique" or "crewWeapons" to make them easier to find later.


After it's been added, I exit and restart the Shadowrun editor. The item will now show up, just like all the built-in items do.

I've done this enough now that I pretty much always get it right on the first try, but when I first started making items I'd often screw stuff up. This will generally cause problems with the editor: often you'll see errors while the content pack loads, or sometimes you'll get errors when launching a scene that references it. You can always back this out by deleting the newly added items, or just keep modifying until it's working.

I use my existing combat test scene to test and experiment with the item. This one worked off the bat, since it uses pretty common and simple mechanics. Crew weapons tend to be a bit more complicated and require more trial and error to work properly. Anyways, here's a screenshot of the successful test:

The correct item name and attack name show in the UI, an appropriate status message is shown on the enemy's hover window, and they're showing the green "poisoned" effect animation. Test passed!