As is annoyingly typical of my projects, it’s not thirty minutes in and it looks like I’ve committed myself to doing something incredibly tricky. Here’s to hoping you can help me out.
My game is about modern warfare in a fictional world, taking place in a jungle, so vaguely Vietnam-esque. The protagonist is the leader of a squad of four other soldiers, codenamed Rome, Knives, Shiver, and Ember. The game also runs on four skills, Close Combat, Sniping, Demolitions, and Communications. Each of the four soldiers specializes in one skill (Rome is Close Combat, Knives is Demolitions, Shiver is Sniping, Ember is Communications). The player can choose to specialize in whichever, and can also choose an area of weakness in exchange for a sub-specialty (how this works out is that the skills are at 2 by default, your specialty is bumped to 4, your area of weakness is knocked down to 1 and your sub-specialty is brought up to 3 or alternatively you can select the same skill multiple times to have 5/2/2/1, or 3/3/2/2). Different situations will call upon different skills and will have different danger levels. So far, pretty standard, right? Characters and skills have been in every choice of game made to date.
So here’s an example of the kind of choice that’s giving me trouble, which may or may not make it into the finished game. The village where you’re supposed to meet your contact has recently been seized by the Makazai, a guerilla army who were unrelated to your mission before they decided to hold your contact ransom. Assuming diplomacy fails or the player just decides to forego the diplomatic route entirely and open fire, they’ll need to assign their squad to different tasks. There are three tasks in this battle. First, someone needs to provide cover fire from a distance, which is a Sniping job with danger level of 3. Someone else needs to extract the contact, which is a Close Combat job with a danger level of 6. Finally, someone needs to destroy the Makazai jeeps so that they can’t pursue, a Demolitions job with a danger level of 5. The player is not privvy to the danger levels in advance, that’s just in code.
The equation for determining wounds to your squad mates is ((S1-S2-S3-S4-S5)+D)/N (and incidentally, each squad mate dies after taking four wounds), where the various S’ are the skill levels of the squad mates involved (the vast majority of these will be zero most of the time, since you’ll typically be splitting your squad up), D is the danger level of the task, and N is the number of soldiers in the fight. As an example, let’s say that the player has 4 in Close Combat, and he and Rome are extracting the contact. That’d make the equation ((4-4-0-0-0)+6)/2, which comes out to -1, so we ignore it. On the other hand, if we send Knives and Ember, two soldiers with a Close Combat of only 2, it comes out to ((2-2-0-0-0)+6)/2, which is 1, so each of them take one wound.
Now, if you send Knives alone, she’ll *die*, because her total skill is 4 short of the danger level and each soldier has only four wounds. If you fail a task, different things need to happen depending on what task was failed. For example, if the covering fire task is failed, then every other soldier randomly takes 0-2 extra wounds from Makazai fire, if the demolitions task is failed than Makazai jeeps will be chasing you in the next vignette, and if the extraction task fails, your contact is killed and you must find the facility you’re supposed to be blowing up without his help, making a later vignette significantly more difficult.
So, that’s a pretty workable system and all (though the specific encounter seems a bit too easy even for the first battle, considering there’s only going to be, like, four battles total), but I have no idea how to program it into ChoiceScript. The choice needs to look like:
Which role do you assign Rome?
*choice
#Extraction
You assign Rome to extract the hostage.
*goto shiver_choice_1
#Covering fire
You assign Rome to cover the team from a distance.
*goto shiver_choice_1
#Jeep demolition
You assign Rome to destroy the Makazai jeeps.
*goto shiver_choice_1
Then, once all five assignments are made, we get the results, which need to be different based on whether Rome takes no wounds, takes at least one wound but does not die, or is killed in the battle.
So, to recap, I need:
- A way of calculating how many wounds are taken for a specific task,
- A way of calculating whether or not a particular task had any surviving soldiers assigned to it, and
- A way to tell whether a particular soldier took a wound or died in the last battle specifically, so I can write different messages for them
Everything else is going to require a barrel of variables, but it’s all pretty straightforward.