Wild functions

Yes, this is a long post, then sit, read and differential in x, I choose you!

Introduction

Q1. Why create monsters with behaviors, advantages and disadvantages controlled by mathematical functions for do a game, if we can use their own mathematical functions as real monsters?

A1. This monsters are the daily lives of millions college students.

Q2. Why choose systems of attack and damage against these monsters if there are already functions that can “simplify” or “make them more terrifying”?

A2. This weapons defeat this monsters daily in all tests of advanced math.

Q3. Ok, but we still need to create a fun scenario to do these battles, right?

A3. In fact, solving math tests is not as fun as playing pokemon.

And speaking of that, there is a rather famous joke about pokemon and differentiation. In case, if you do not know much about pokemon, below we have our protagonist seen from behind with a cap and a backpack (as image above). In this game we find wild pokemons that to fight against. The fight happens like this, we choose an attack, it is launched by the pokemon of our team and the opponent pokemon launches another attack, so on. Until one of them can not take it anymore and faint. In this case, when an attack is very inefficient, such as throwing plant attack at a fire creature, a message also arises that “it is not very effective.”

exemplo básico.png

Thus, the joke is based on this combat system and on the action of facing an “exponential function of x”. The protagonist tries to differentiate it as a function of x, but this “attack” is inefficient, since the “exponential function of x”, differentiate in relation to x, is the “exponential of x” itself.

HXmZ4

A variation of this joke, and the heart of this game, involves the protagonist using the differentiation in the “exponential function of 2x”, and to make matters worse, the result of this attack was to duplicate the “exponential function of 2x”. For the exponential differential of 2x is twice the exponential of 2x.

jEIGNzW

Game design

Thus, by exploiting this logic, we can establish “attack functions” as:

  • differential as a function of x;
  • differential as a function of y;
  • indefinite integral in x;
  • indefinite integral in y.

And “wild functions” we has any functions integrate or differential in x or y, for example:

  • cos(x);
  • cos(y)sin(x);
  • x²+xy+y²;
  • ln(x)+ln(y);
  • exponential of x²+xy+y²;

So, given this combat system, we lack to think of:

  • risk factors (such as hitpoints);
  • control (such as restrictions on unlimited use of functions);
  • conditions of victory (what to do to win a role);
  • threat level of functions (how much risk they give);
  • rewards to the player (to increase the power of character).

Thinking about it, we come up with the idea of:

  • ​​risk factors = the student hit points is his score in course, if the character reaches score 0, he is expelled from the course.
  • control = coffee of the student stock (or caffeine in the blood) as usable energy for the use of functions (after all, coffee in the brain is a great fuel for doing math);
  • conditions of victory = checks if the value of the function in module satisfies the condition or not;
  • threat level of functions = wild function attacks ever the condition to victory is false,  and the character is attacked by a value related to the function module;
  • rewards to the player = wild functions there are also a number of stars that represent the difficulty of that function and the reward to the player after win.

Below is a visual outline of the game.

model gameplay 3

The same image with names of each part to better understand how each component appears in the game.

model gameplay 2

The rewards appear in the form of cards divided by the number of stars of the function that the player defeated:

  • 1-star function – take a 1-star card;
  • 2-star function – take a 2-star card, or look four 1-star cards and take 2;
  • 3-star function – take a 3-star card, or look at four 2-star cards and take 2, or look six 1-star cards and take 3;
  • 4-card function – take a 4-star card, or look four 3-star cards and take 2, or look six 2-star cards and take 3, or look eight 1-star cards and take 4;
  • 5-star function – take a 5-star card, or look four 4-star cards and take 2, or look six 3-star cards and take 3, or look eight 2-cards and take 4, or look ten 1-star card and take 5.

In the initial configuration, the character has 15 full cups of coffee in stock, starts with the score 10,0 in the discipline and all his functions cost 5 cups of coffee. But these settings may change according to the reward cards listed below:

The enlightened upgrade – this upgrade is dividedbuddha.png into 5 levels available in ascending order on the respective award cards. Each upgrade applies to a character-specific function and can only be used for the function that contains all previous upgrades. Example: In order to use the enlightened upgrade level 5 in the differential function of x, you must have previously used level 1, 2, 3 and 4 enlightened upgrades in this function. This upgrade reduces the amount of coffee required to activate each function by 1. Thus:

  • Upgrade level 1 – allows the function to be active at the cost of 4 cups of coffee;
  • Upgrade level 2 – allows the function to be active at the cost of 3 cups of coffee;
  • Upgrade level 3 – allows the function to be active at the cost of 2 cups of coffee;
  • Upgrade level 4 – allows the function to be active at the cost of 1 cup of coffee;
  • Upgrade level 5 – allows the function to be active at no cost to coffee.

12099.png

The coffee pot upgrade – this upgrade is divided into 5 levels available in ascending order on the respective award cards. Each upgrade can be apply individually to the stock of coffee, but only a time for level of upgrade. Example: the upgrade level 3 can be apply before the upgrade level 1, but you can’t apply twice a upgrade already used. This upgrade increases the space of coffee in the character stock by 3. Thus:

  • Upgrade level 1 – increase 3 cups of coffee in the character stock;
  • Upgrade level 2 – increase 3 cups of coffee in the character stock;
  • Upgrade level 3 – increase 3 cups of coffee in the character stock;
  • Upgrade level 4 – increase 3 cups of coffee in the character stock;
  • Upgrade level 5 – increase 3 cups of coffee in the character stock.

Free espresso machine – This item allows the character to restore quantities of coffee inimg_58729.png his stock:

  • level 1. 6 cups;
  • level 2. 12 cups;
  • level 3. 18 cups;
  • level 4. 24 cups;
  • level 5. 30 cups.

Good substitute test – This item works against functions at the same level of it card orsub do bem levels below. It must be activated before the first action against a function, use this card doesn’t count as a move, but it allows at any time up to the time the player collects the cards of his victory, decides if he wishes to cancel the whole event, thus returning the collected cards, restoring their spent caffeine and score points lost (the player can take his winning cards, but this is the time limit to activate the benefits of this card, after this occasion, if the player doesn’t activate the benefit of this card, its effect is lost).

Bad substitute test – This item works against functions at thesub do mau.png same level of it card or levels below. It must be activated before the first action against a function, use this card doesn’t count as a move, it reduce to half current score, but allows the reward of the wild function increase in one-star. Assume that if a five-star was defeat, the player receive the reward of a equivalence six-star (6-star function – look four 5-star cards and take 2, or look six 4-star cards and take 3, or look eight 3-cards and take 4, or look ten 2-star cards and take 5, or look twelve 1-star cards and take 6).

Scientific calculator upgrade – This item allows (against functions 14264-scientific-calculator1-200x200.pngof the same level or levels below), that the player uses two functions in a single action. But the cost in caffeine remains the same for every action. For example, using the differential function on x, which costs 5 cups of coffee, will require the character to have at least 10 cups of coffee.

Teacher personal notes upgrade – This item allows (against functions of the notebook-41336_960_720 (1)same level or levels below), that the player use (level of item+1 – level of wild function) times a function without pay coffee. For example, this item level 4 against a wild function level 3, (4+1-3)=2, them the player in this fight can use 2 functions without pay the coffee needed to this.

Cheat the test – This item allows (against functions of the school-exams-clipart-16same level or levels below), that the player throw (level of item+1 – level of wild function) times a dice and choose the best. Results 1 or 2: eliminates wild function automatically; Results 3 or 4: the wild function will cause half the damage in each attack; Results 5 or 6: the wild function will cause double the damage in each attack;

Dedication: each level of this item restore points in character score. dedicação.pngIn the interval from one battle to another, it is not allowed to use more than one card of this item from each level. For example, the player even having 5 level 1 dedication cards to restore 5 points on the score would require 5 intervals between battles against wild functions. Thus, the strategy to restore many points at once is to use these cards at the same time, for example: a level 1, a level 2, a level 4, and with this in only a battle interval the player will have restored 7 points on the score.
Level 1: restores 1 points.
Level 2: restores 2 points.
Level 3: restores 3 points.
Level 4: restores 4 points.
Level 5: restores 5 points.

Mercy – This item allows (against functions of the same level or mercylevels below), which the player uses to cancel a total of up to (item level + 1 – level of wild function) attacks coming from a wild function. For example, in this level 4 item against a wild level 3, (4 + 1-3) = 2, the player in this fight can cancel up to twice the attacks of this wild function.

Combat system

The combat system depends only on the calculation of the functions and their differentials or integrations. In case, if this game involves mathematicians or people very accustomed to these calculations, the game can run well anyway. In the case of people less skilled in this, I suggest that you use some scientific calculator that does these operations, or even the site wolframalpha.com, just enter the functions and signs that represent differentiation and integration, that it will do the results of each “attack” of game.

Bellow, a example of write the syntax of differentiate in function of x.

2018-11-12-100537_1024x600_scrot

Bellow, a example of write the syntax of differentiate in function of y.

2018-11-12-100440_1024x600_scrot

Bellow, a example of write the syntax of integrate in function of x.

2018-11-12-100823_1024x600_scrot

Bellow, a example of write the syntax of integrate in function of y.

2018-11-12-100840_1024x600_scrot

Below is a short video about this game and with a battle against a wild function level 2 (with any enlightenment upgrades but without others).