Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] documentation of fairmath or control of statistics #106

Closed
rubereaglenest opened this issue Jun 15, 2016 · 3 comments
Closed

Comments

@rubereaglenest
Copy link

rubereaglenest commented Jun 15, 2016

Hi,

In the GDC of 2015, conference by Jon Ingold, is described how Inkle uses stats and math.

I wonder if Ink has implemented those codes for fairmath, for raise or lower a stat, and the queries High, Low, Up, Down. Or iif you guys just reimplement it from game to game.

PD: I ask because I've not seen any reference to that in the documentation.

Regards.

@joethephish
Copy link
Member

joethephish commented Jun 15, 2016

Right now we just add an include for each game. Here's an example of what it looks like:

CONST INITIAL_SWING = 1001

=== function raise(ref x)
    ~ x = x + 1000


=== function push(ref x)
    ~ raise(x)


=== function lower(ref x)
    ~ x = x + 1 


=== function pull(ref x)
    ~ lower(x)


=== function upness(x)
    ~ return x / 1000

=== function downness(x)
    ~ return x % 1000


=== function high(x)
    ~ return (1 * upness(x) >= downness(x) * 9)

=== function up(x)
    ~ return (4 * upness(x) >= downness(x) * 6)

=== function down(x)
    ~ return (6 * upness(x) <= downness(x) * 4)

=== function low(x)
    ~ return (9 * upness(x) <= downness(x) * 1)

We could add in language support including convenience syntax, but we're not sure whether it's the right approach to take or not right now...

@ladyisak
Copy link

ladyisak commented Jun 22, 2016

Is it possible to get an idea of how to use these fairmath functions? I'm a little lost.

@joethephish
Copy link
Member

joethephish commented Jun 22, 2016

Here's a dry example. In our games we litter raise and lower (or push and pull) throughout. Then, any time we want the story to vary depending on the stat, we use high, low, up and down.

INCLUDE swings.ink

VAR kindness = INITIAL_SWING

- (loop) The loop of kindness {|continues}...
+ Give a gift
    ~ raise(kindness)
+ Give a kick in the teeth
    ~ lower(kindness)
- 
{
   - high(kindness): Kindness is now high.
   - low(kindness):  Kindness is now low.
   - up(kindness):   Kindness is now up.
   - down(kindness): Kindness is now down.
   - else: Kindness is neither up nor down.
}
-> loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants