ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Is there a tut about dealing with combat?

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.

Is there a tut about dealing with combat?

Postby Pagrin » Tue May 10, 2016 2:47 pm

I need to have a little combat resolution in the game I'm working on. I think I know how to do it, but I was wondering if there is an example or a tut for how other people have handled it, which might same me a lot of trial and error time?
Pagrin
 
Posts: 16
Joined: Mon May 24, 2010 12:03 pm

Re: Is there a tut about dealing with combat?

Postby Lazzah » Tue May 10, 2016 3:36 pm

Pagrin wrote:I need to have a little combat resolution in the game I'm working on. I think I know how to do it, but I was wondering if there is an example or a tut for how other people have handled it, which might same me a lot of trial and error time?

FWIW, the way I handle "combat" in my games is very simple:

You meet a troll with a battleaxe which attacks you. No sword - you are dead. No shield - you are dead. I might add a provisio that you have to have eaten some food beforehand so even if you have the right gear you haven't got the energy to fight.

You are shot at by a hidden archer - no chainmail - you are dead.

In one of my games, right at the end, I introduced a random element whereby you might get wounded by the enemy arrows and spears, and if you get hit too many times you get killed before you can complete the act that finishes the game. I think it worked OK!

Even if there was a combat system in ADRIFT5 I probably wouldn't use it.
OUT NOW: Run, Bronwynn, Run!
Current W.I.P.: Magnetic Moon
Also available: The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust - The Fist of Fire and The Lost Children
User avatar
Lazzah
Moderator
 
Posts: 2131
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England
Points: 17

Re: Is there a tut about dealing with combat?

Postby Pagrin » Wed May 11, 2016 2:03 am

Thanks Lazzah.
While many games I agree it's better to use the story telling aspect than the number crunching, in my case I really do need that random element.
The game I'm writing will be used several times by the same player, as a way of him attempting to "Hack" into systems in a pen and paper RPG.
Because of the repetitive nature of the games use, it need random elements, other wise is would be just a case of the players typing in the same verb/noun commands as fast as he can.
Traps and defenses need to produce different results, so he can then decide how far to pursue a given hack attempt.
Pagrin
 
Posts: 16
Joined: Mon May 24, 2010 12:03 pm

Re: Is there a tut about dealing with combat?

Postby ElliotM » Wed May 11, 2016 5:09 am

I'm quoting your reply from the other thread over here because this one is tutorial related.
Pagrin wrote:In a nut shell the system works like this. Your character has attributes which represent your physical aspects, like Brawn, Beauty, Dexterity, etc. You also have your skills which are learnt abilities, such as computer use, pick locks, and language etc.

I would recommend making character properties out of the relevant attributes and skills. This is better than using variables because they will be reusable for NPCs too, as each character can receive their own private copy of it. An Integer property might be the most straightforward to use, though this could be a good application of the Value property which interprets an internal integer and displays the corresponding value scale interpretation instead.
Pagrin wrote:To use a skill, the skill and the attribute is applied to are added together and halved to get an average, then you roll a d100 and try and get under that score.

You can set a property or variable equal to an expression. If you named your properties well, their key names should be easy to use in an expression. Let us say that the property key for the hacking skill is Hacking and the property key for the attribute knowledge was Knowledge. You would then be able to do a skill check with something like this inside your Hack task actions:
adrift Code: Select all
Set %RollTarget% equal to (Player.Hacking + Player.Knowledge) / 2
Set %HackAttempt% equal to Rand(1,100)

Then you could call other tasks that have restrictions based on whether or not "%HackAttempt% < %RollTarget%" is true, indicating a success, or false, indicating a failure. This way you could narrate different responses via tasks, which would be more interesting than just being told your number wasn't high enough.
ElliotM wrote:
adrift Code: Select all
Getting good property keys is a little tricky, because they can't be edited directly without exporting to a text editor, changing it, and importing it back in, which is a major pain. To avoid this, here are my guidelines: Make sure the name of the property when you first make it is between 6/7 to 10 or so characters in length. If it is shorter than that, Adrift will add numbers to it. If it is longer than I think 10, it will truncate it. Also, if something else has a similar name, Adrift will add a number at the end.


Pagrin wrote:The player who will be playing the hacker, tends to keep his laptop with him at all times a bit like a security blanket, armed with PDFs of the system we where gaming with. So I thought for my game, what better than to have him use the keyboard to actually "hack".
Hacking tends to break him away from the other players anyway, so by making that aspect covered in an Adrift game, he can work away at a hack while I continue to GM the other players.
I just have to be able to recreate as much as possible of the setting within Adrift games. I already have one set up for him to use when he just surfs the net looking for information. I'm part way through doing one for hacking into a major corporation (Which I will trim down and alter for the smaller companies.). Then I'll do another version for attempting to hack robots.

Sounds cool, would you mind sharing what you've done here on the forum? Also, how does counter hacking work? Are there PDFs I could look at explain the rules that you'd be free to share?
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Is there a tut about dealing with combat?

Postby ElliotM » Wed May 11, 2016 6:08 am

Made a mock up of hacking for you using your descriptions. Hopefully you see how you could use alternate descriptions to give feedback, hints, or warnings to your player. If there is more than one hackable object, I would recommend giving them an unauthorized access tracker property that tracks failed hacking attempts instead of using variables like I did here. My demo does illustrate the short coming of most combat systems in that is repetitive by requiring the player to input the same command, though there is the 'g' shortcut.

Hacking.taf
Hacking mock up. Hack the terminal successfully 5 times to win to simulate a multi-step hacking process where the hacker can choose to give up at any point they feel they are about to lose to the counter hackers by going through the south exit to flee to the streets.
(16.76 KiB) Downloaded 56 times

Test with
adrift Code: Select all
i
x servers
x terminal
hack terminal
g
g
g
g
g
g
etc.
 
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Is there a tut about dealing with combat?

Postby Pagrin » Thu May 12, 2016 2:30 am

Wow load of stuff for me to go through! Thanks ElliotM. I'll work my way though it in detail when I get the chance, so if I ask something here, you've already answered sorry. :)
I'm already setting Variables for the skills as they are needed. Because they don't change within a given session of the RPG I can lock them off at set values, so I don't need Adrift to do that aspect of the math. So rather than "Set %RollTarget% equal to (Player.Hacking + Player.Knowledge) / 2" I've just set the variable to what ever the save is so hacking = 47. Then when a check is called for I compare that to a Rand(1,100). If I want the check to be harder I just alter the randoms specs. So as the player gets deeper into the system it become Rand (21,120), or Rand (41,140).
I did it that way because between session is when he may get better at Hacking so I just have to change that one variable value and the game is ready to use again. (Rather than going over everything looking for every skill check.) I think this is similar to what you are recommending, yes?
The Different response bit is what I am intending to develop, although at this point I'm just working to get it to run through once properly, before I try to expand out the options and results. (Crawl before you walk kind of thing I guess.)
Hacking into a system is sort of handled already, its what happens once someone is in that I'm working on. Stuff like avoiding patrolling guard programs, defending yourself when they find and attack you. Avoiding sensor turrets. Basically outsmarting the systems defenses to stay on line long enough to access information, or working out how to get deeper into a system to access more protected information.
For some hacks, he might be looking to just get access to the local CCTV feeds, other times he might be looking to see if they are funding black ops projects. Some of that will by its nature have to be handled by me on the fly during the game, but they more I can build into these adrift games, the more he'll be able to just work away by himself.

Back Hackers are a system defense. So if he is spotted, and they are able to catch him, they can do a few things. they could just kick him out, they might attempt to attack his mind (Damage him), or they might lock him down so he can't log off, while they hack into his mind to find out where he is and then send guards to arrest his physical body.

I'd be happy to share the information searching game I've already done to yourself but not on an open forum, as the content is copywritten and linked to a series of Comics I'm writing. But a play tester or two would be helpful assuming they don't mind keeping the content confidential.
If anyone wants to know about the Cyberstone Comic and related stuff it might be best to PM me about that, so there are no issues about using the forum for advertising or sidetracking away from Adrift. :)
Pagrin
 
Posts: 16
Joined: Mon May 24, 2010 12:03 pm

Re: Is there a tut about dealing with combat?

Postby ElliotM » Thu May 12, 2016 3:13 am

That would be one way to simplify the math. I was wondering if you had scaling difficulty and altering the range of numbers for Rand() should do the trick nicely. My demo file uses something called Alternate Descriptions, and you may find those useful. Another feature, if you're comfortable writing expressions directly in the text, would be the OneOf() function. For example, you could randomize the description of a sever bank:
adrift Code: Select all
The server bank fills most of the room. <# OneOf("Lights blink on and off.", "The hum of the fans conceals your footsteps.", "Cables and wires run everywhere in a methodical order.", "It is warm next to the servers, but otherwise fairly chilly.", "Portions of the server bank are idling, is that normal?") #>

Use Alternate Descriptions for the big things, where the description depends on changes to the game state. Use OneOf() for the smaller description variation that adds to ambiance and scenery.

I have stuff on character movement if you need examples. NPCs can be made to follow the player, go to specific places, or follow certain paths. Perhaps a cyber map could be 'leaked' to your hacker player describing the layout and the guard movements? If there are enough rooms in your cyberspace model, you could do a printout of it boardgame style. Perhaps with varying degrees of truthfulness?

I played an FPS once that featured hacking. It was called Dystopia and it was played in 'meatspace' and in 'cyberspace' at the same time. Defenders would protect hacking objectives from stealth hackers while attackers would try to secure the jack-in-points. I looked up a youtube video to show you what the game play was like in case you were looking for ideas. In cyberspace you have three attacks (Hitscan, Shaft, and Projectile) and when you hacked there was a mini-game where if you clicked the subprograms in the right order it would be more efficient and finish quicker. The cyberspace area was a set of rooms where physics weren't always normal. Firewalls played a big part in partitioning the cyberspace and you could protect access nodes. Green ICE would kick out a cyberspace avatar if they touched it, so a strategy might be to wait till someone stood next to it to start hacking it with a program and then knocking them into the green ICE hidden on the firewall with a projectile attack. Anyhow, a lot of their game play wouldn't translate too well into text but it might give you some ideas on how you could structure cyberspace.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Is there a tut about dealing with combat?

Postby Pagrin » Fri May 13, 2016 3:38 pm

ElliotM wrote:My demo file uses something called Alternate Descriptions, and you may find those useful. Another feature, if you're comfortable writing expressions directly in the text, would be the OneOf() function. For example, you could randomize the description of a sever bank:
adrift Code: Select all
The server bank fills most of the room. <# OneOf("Lights blink on and off.", "The hum of the fans conceals your footsteps.", "Cables and wires run everywhere in a methodical order.", "It is warm next to the servers, but otherwise fairly chilly.", "Portions of the server bank are idling, is that normal?") #>

Use Alternate Descriptions for the big things, where the description depends on changes to the game state. Use OneOf() for the smaller description variation that adds to ambiance and scenery.


That's brilliant! I had no idea that was possible. you're right in that will go a long way to breaking down the repetitive nature if description, and reactions.
One of the keys to this working is the player having to read and think about their response to the game. With that in mind I was always worried that the problem solving and map layout aspects would become just a case of him typing the same stuff over and over as quickly as possible. Being able to add random element into text blocks will reduce that immensely.

Also with each update of the game between session I can add a few extra comments here and there to the NPCs and descriptions.
Pagrin
 
Posts: 16
Joined: Mon May 24, 2010 12:03 pm

Re: Is there a tut about dealing with combat?

Postby Pagrin » Wed May 25, 2016 10:30 am

OK I'm stumped. I had a look at the Hacking.taf you upload ElliotM. I decided to use your structure to handle the hacking tests. However despite having copied it perfectly except for 2 small changes. (I reduced the player properties to a single number to make the math easier. and reduced the success/failure results from 5 to 1 to make it faster while I tested the system.
However for the life of me I can't work out what "Hack terminal" gets the "I don't know what you are trying to do" result.
I've uploaded it so someone can point out what I've done wrong.
The walkthrough to the point problem point is;
East
X terminal
Hack terminal

Update. OK I'm not sure why but it's working now. Something to do with entering the name of the terminal object again seems to have fixed the issue. :P
Attachments
John general hacking program 3.taf
(17.56 KiB) Downloaded 51 times
Pagrin
 
Posts: 16
Joined: Mon May 24, 2010 12:03 pm

Re: Is there a tut about dealing with combat?

Postby ElliotM » Fri May 27, 2016 7:11 am

Been a bit busy lately but glad to hear that you tried it out. However, the commands below don't work in the sample you shared
adrift Code: Select all
East
x terminal
hack terminal

but I discovered that this does:
adrift Code: Select all
east
hack password


You'll want to take another look at how I setup the tasks in my example. My approach is object-based in that the Hack %object% general task that I used to create the new hack action requires an object reference. After I created the new hack action, I then used specific tasks to tell my demo how to react to the player hacking specific objects in my example.

I like the object-based approach to designing tasks because Interactive Fiction lends itself well to object-based games. When a player sees an object, they will know they can usually do something with it if it doesn't appear to be just scenery. In a sci-fi hacker scenario, finding an unguarded computer terminal auto-suggests that you could try to hack it. In your example, there is no password object there that suggests to the player what they need to type. Doing commands like 'hack password' don't use object references and can run afoul of the old guess-the-verb problem.

Let me know if you need any help. Once you understand this way of designing tasks I think things will become much easier for you.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Is there a tut about dealing with combat?

Postby Pagrin » Sat May 28, 2016 12:45 pm

The hack password command was a left over from the first way I set it up. But thanks for reminding me it's there so i can get rid of it.
It turned out the problem was when I entered the name of the terminal, I neglected to hit enter. So even though the name seemed to be there, it seems Adrift didn't know what the name was. Hence the testing doesn't work. So when I entered the name a second time, it must have confirmed itself and started working.
But I did want to ask a couple of questions about some of the coding in your example.
In the "Hack the Terminal" Task under actions there is a line for setting the FailureTrack, and another for the SuccessTrack. Both have If statements which seem to have the same math. that is Hack Attempt < Skill Target = result.
I know it works but I don't understand why, shouldn't one of them be Greater than and the other Less than?
Also how would I write the If statements is I wanted more than 2 options. For example a Bad fail, Normal fail, Normal Success and Super Success results?
Pagrin
 
Posts: 16
Joined: Mon May 24, 2010 12:03 pm

Re: Is there a tut about dealing with combat?

Postby ElliotM » Sat May 28, 2016 11:08 pm

Pagrin wrote:I know it works but I don't understand why, shouldn't one of them be Greater than and the other Less than?

Though it does work, that is a fair point about the math being a bit confusing. Though the test is the same, the difference is where the +1 happens.

For quick review, the IF statement structure in Adrift is IF(TEST, TRUE, FALSE) and the code from my example is below:
adrift Code: Select all
Set variable FailureTrack to 'If(%HackingAttempt% < %SkillTarget%, %FailureTrack%, %FailureTrack% + 1)'
 
Set variable %SuccessTrack to 'If(%HackingAttempt% < %SkillTarget%, %SuccessTrack% + 1, %SuccessTrack%)'

As you can see, when I am testing for failure, I update the FailureTrack with +1 when the test is false. When I am testing for success, I update the SuccessTrack with +1 when the test is true.

Pagrin wrote:Also how would I write the If statements is I wanted more than 2 options. For example a Bad fail, Normal fail, Normal Success and Super Success results?

It is certainly possible to do a scale of Bad fail, Normal fail, Normal Success and Super Success results, though to give advice on how to do it I would need to know the math you are using to determine that scale. For now I can I show you how I would set it up, just replace the --TEST-- with the actual math behind the scale and that would be one way to make it work reusing the previous failure and success variables.
adrift Code: Select all
Bad fail:
Set variable FailureTrack to 'If(--TEST--, %FailureTrack%, %FailureTrack% + 2)'
 
Normal Fail:
Set variable FailureTrack to 'If(--TEST--, %FailureTrack%, %FailureTrack% + 1)'
 
Normal Success:
Set variable %SuccessTrack to 'If(--TEST--, %SuccessTrack% + 1, %SuccessTrack%)'
 
Super Success:
Set variable %SuccessTrack to 'If(--TEST--, %SuccessTrack% + 2, %SuccessTrack%)'
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Is there a tut about dealing with combat?

Postby Pagrin » Sun May 29, 2016 12:20 pm

Ahhh Ok I get the logic behind the IF statements a bit better now. Thanks for that. I think I understand what I'll have to do for the math.
The idea would be add a critical/botch effect. So for example (As a low role is needed) if the rand number was less than 5 the player gains an extra bonus. If the roll is above 96 the results are disastrous. For combat this would normally translate as a crit = bonus damage, and a botch would mean dropping your weapon. In this case where it's about hacking a Crit = bonus information, and a botch = attacked by guards programs.

On a little side note, while running tests of my game I notice the map goes off the edge of the screen, along with the location the player is currently in. Is there a way to centre the map on the players location in the display window?
Pagrin
 
Posts: 16
Joined: Mon May 24, 2010 12:03 pm

Re: Is there a tut about dealing with combat?

Postby ElliotM » Mon May 30, 2016 4:28 am

Adding a unique critical/botch effect would require separate variables. This does bring up a design question though. If you have critical, success, fail, and botch for every hackable objective but the player has access to several at once, tracking will become very difficult. It would be at this point that I would suggest turning these four trackers into object properties for your hackable objects. This way each can maintain its own trackers and you reference the tracker properties instead of variables.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Is there a tut about dealing with combat?

Postby Pagrin » Thu Jun 02, 2016 6:58 am

Just a quick little update. I've taken what I've learnt from your help ElliotM and applied it to the game. So now finding the hidden rooms is a matter of searching a couple of objects, but the rooms entrance moves each time the game is played. There are now 4 guards patrolling the secured areas, which I'm setting up to do increasingly more aggressive actions against the player.
I've left out the critical/botch for the time being, until I've got the main part working.
Pagrin
 
Posts: 16
Joined: Mon May 24, 2010 12:03 pm

Next

Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 5 guests