ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Dice, Probability and Skill Checks.

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.

Dice, Probability and Skill Checks.

Postby DUTTENHOFER » Thu Mar 17, 2016 9:10 pm

I'm used to game mastering Dungeons and Dragons d20 type games and I would like to translate my experience into Adrift games. I would like to have dice-like variables when players attempt an action like attacking. My goal is to learn how to make a d20 variable, add/subtract modifiers and compare it, potentially, against another variable +/- modifiers.

Not sure exactly how to go about making an integer variable that rerolls every time and I haven't been able to find any information on my specific needs. Would appreciate any explanations or links.
DUTTENHOFER
 
Posts: 3
Joined: Thu Mar 17, 2016 1:47 am

Re: Dice, Probability and Skill Checks.

Postby ElliotM » Fri Mar 18, 2016 1:06 am

Welcome to the forum!

I've never played D&D, but I have an idea of how most RPG's work. When a player makes an attack, is there a scale of outcomes, like from terrible to phenomenal, or is it a binary fail or succeed type outcome?

Tasks in Adrift will run (succeed) unless their restrictions say they can't run. If you make a restriction based on the value of a d20 variable, all you need to do is make sure that it has been rolled to a new value with your modifiers applied. To do that, you could use something called Specific task. Make one that runs before your d20 action, and it will be random. See the Roll d20 task and the Win task for attacking the lion with a sword. The other stuff was extra that I had fun making.
Attachments
d20 Attack with Cinematic Scaling and Text Variation.taf
Higher rolls are restricted at first, but then lifted.
(16.75 KiB) Downloaded 103 times
d20 Attack.taf
You can get lucky and win in one attack.
(16.58 KiB) Downloaded 98 times
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Dice, Probability and Skill Checks.

Postby DUTTENHOFER » Fri Mar 18, 2016 4:19 am

Ahh thanks.

In D&D's d20 system, the d20 only denotes whether or not you hit. If your roll + atk modifiers ≥ their armor class + def modifiers, you hit. Then a damage roll is applied with a die appropriate to your weapon's damage.

But I think if I digest these I can work it out. And thank you for this resource, I don't have an excuse not to start working now.

I half expected to get a "give up now," haha.

Edit: So I've spent a few minutes poking and trying to recreate and I'm still having trouble. Where exactly can I find where you specify the value of the d20. From what I can tell so far, the d20 variable is just a number with initial value 0. Of course when I recreate it only from that information, it spits out 0 every time. I can see how you discriminate results but not really where the random-number-generator is defined. Again I appreciate the help.
DUTTENHOFER
 
Posts: 3
Joined: Thu Mar 17, 2016 1:47 am

Re: Dice, Probability and Skill Checks.

Postby ElliotM » Fri Mar 18, 2016 5:44 am

I find it interesting to see the ideas people come up with. :)

You will want to focus on learning about properties. Think of them as private variables belonging to any character (or object or location) that you give it to.

Using the math you described, I came up with another sample for you to learn from using properties. I cleaned up what I was doing with the tasks. The d20 Attack Character has the same syntax as the standard library attack character task, but because of task priority the d20 one will run first, preventing the other one from being used. It rolls the d20 and then the two Hit and Miss tasks will run after the d20 attack character task, which have your math in the restrictions. The one that passes will update the hit point value of the character who took damage, either the referenced character for a hit, or the player for a miss. Not sure if that is how it works, but it should be easy enough to learn from because there isn't as much extra stuff like I put in with the first two files I shared here.
Attachments
d20 Stat System.taf
Simple fight with a troll. You can adjust the stats in the developer.
(16.09 KiB) Downloaded 107 times
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Dice, Probability and Skill Checks.

Postby ElliotM » Fri Mar 18, 2016 5:47 am

DUTTENHOFER wrote:Edit: So I've spent a few minutes poking and trying to recreate and I'm still having trouble. Where exactly can I find where you specify the value of the d20. From what I can tell so far, the d20 variable is just a number with initial value 0. Of course when I recreate it only from that information, it spits out 0 every time. I can see how you discriminate results but not really where the random-number-generator is defined. Again I appreciate the help.


Just saw your edit, my new file should help. I set the values for the d20 variable using the task actions. Open any of the three tasks in the new file and go to the actions tab to see where I update the variables. Rand(1,20) is d20, Rand(1,6) is d6, and Rand(1,4) is d4.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Dice, Probability and Skill Checks.

Postby DUTTENHOFER » Fri Mar 18, 2016 12:39 pm

Update. Doing much better. I've recreated the roll, and have discriminated between hit/miss. First major obstacles have been overcome. However I'm unsure how you wrote in "(%d20% + Player.Attack1)" to the task restriction. Mine reads only "Variable 'd20' must be.." and I'm unsure how to open the entire argument to edit. (as apposed to editing just the end where it gives you a '123' or 'x+y' button)
DUTTENHOFER
 
Posts: 3
Joined: Thu Mar 17, 2016 1:47 am

Re: Dice, Probability and Skill Checks.

Postby ElliotM » Fri Mar 18, 2016 5:07 pm

Glad to hear it. :) If you have more questions, keep asking and I'll try and help. Did you find the Adrift 5 wiki? From the forum main page there is a link to it near the Adrift 5 subforum. I'll be linking to a few pages here so you have additional information.

The "(%d20% + Player.Attack1)" stuff is an Expression. When you create a new restriction (see http://wiki.adrift.co/Restrictions), you will see a few different tabs. The ones that said "Variable 'd20' must be ..." were from the variable tab. The ones that said things like "(%d20% + Player.Attack1)" were from the expression tab, and those are, like you said, entirely open to editing (see http://wiki.adrift.co/Expressions).
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Dice, Probability and Skill Checks.

Postby ElliotM » Fri Mar 18, 2016 6:41 pm

I also used keys (see http://wiki.adrift.co/Key). Everything in Adrift has a unique key. In settings, I turned on "Show Keys on Edit Forms" in the general tab and this will let you see what each key name is. "Player" is a key name for the player character, while "Attack1" was the key for my character property that held their attack modifiers. I use "Generate Key Names from Item Names" in the Advanced tab so that I can get sensible key names I can remember. Otherwise it will be things like Character23, Location14, or Property7 by default. I also work with Simple Mode off, because things like Properties are considered advanced features that are hidden when Simple Mode is on. Hopefully properties will make sense to you (see http://wiki.adrift.co/Properties) because they will make organizing your project much easier than using variables for each character.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Dice, Probability and Skill Checks.

Postby ParadoxGames » Thu Mar 24, 2016 2:36 am

As a fan of Star Wars Miniatures game, I'm familiar with Wizards of the Coast d20 system they use for D&D. The game originally used all sorts of dice tables, and came with what we know now as the 7-piece polyhedra set. This set were originally supplied by Gamescience corporation (no relation to the NJ company from the 1960s of the same name originally run by Philip Orbanes, Jr., the Monopoly buff who now is an executive of Winning Moves, creators of faithful reproductions of classic games like Candy Land). The Gamescience dice are designed to resist entropy and are collectible these days.

Anyhow, ADRIFT has a nice section on randomly generating numbers, which is perfect for making dungeon crawlers with Phantasy Star type turn-based combat. Going with a d20 character, say you give your hero a base attack of +7, defense of +18, a weapon with damage 30, and hit points of 70. Firstly, it can be fun filling your world with other weapons you can upgrade to, with increasing power directly proportional to a skill level required to use it and weapon cost. Secondly, the "rand" function is perfect for generating random integers 1 to 20. Naturally, you set up pre-emptive tasks corresponding to critical misses and hits (1 and 20, respectively). The other results are tasks based on whether or not the defender's attack roll plus his base level equals or surpasses the opposing character/creature's defense. ADRIFT would be a good game engine for implementing a d20 system, or your own system (d20 is proprietary mechanics).

I invented my own system called the "counterstrike system", where an attacker and defender rolls a number of d6s equal to his attack/defense strength. Certain rolls are hits which can be cancelled by the defender's rolls to defend, but every defender's roll of a 6 is a counterstrike, where the defender strikes back and can't be blocked. I also use the system on d12s, where the system plays out better.

Read more on the RAND function in ADRIFT help.

By the way, if you like RPGs and happen to love cards, Paradox Games published a 120-card deck that simulates a 7-piece set of polyhedral dice with a proper ratio of outcomes for each die. If you're interested in such, it's available here:

http://www.drivethrucards.com/product/166541/Polyhedra

If I ever get through my first game, I'd like to do something with a well-developed combat system like the d20 system, and a lot of creatures for doing battle.
ParadoxGames
 
Posts: 161
Joined: Sat Sep 05, 2015 2:33 am
Points: 10


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 7 guests