Saltar al contenido

Más funciones del motor

Aleatoriedad y tiradas de dados

Usa la aleatoriedad para crear mecánicas de juego y tablas de recompensas.

Por ahora, esta lección solo está disponible en inglés.

You can add random functions to your gameplay, which unlocks the following types of game functionality:

  • Random dice rolls of any denomination (e.g. D20, D2, D100)
  • Random loot or rewards
  • Increasing values by random amounts

So instead of:

player choice → fixed outcome

You can now do:

player choice → random roll → different outcomes

Option 1: Dice notation

This turns a value such as affection into a random roll instead of a fixed number. You are making the affection equal to a dice roll.

Example: If you write 1d20, the game picks a number from 1 to 20, and that number becomes affection.

What does it look like?

Screenshot: the dice-notation field set to 1d20, turning affection into a random roll from 1 to 20.

Option 2: Random between X and Y

This sets a value to a random number in a range, with an optional bonus added. Pick a random number between X and Y, set affection to that, and you can add a fixed bonus on top of it.

Example: If you write a minimum value of 1 and a maximum value of 5, plus 2:

  • The game picks a number from 1 to 5.
  • The game always adds 2.
  • The outcome will always be between 3 and 7.
Screenshot: the "random between X and Y" settings with a minimum of 1, maximum of 5, and a bonus of 2.
Screenshot: the random-range configuration for setting a value in the game editor.
Screenshot: an additional view of the random-range value settings.

Option 3: Increase by a random amount

Similar to the previous option, but instead of setting a new score it increases or decreases the player's existing score.

Screenshot: the "increase by a random amount" settings that adjust the player's existing score.

Outcome

After applying any of these options, use a checkpoint or a choice requiring a minimum number of points for a desirable outcome.

Example: You need at least 6 points for the positive outcome "Heal the Love Interest." Position your checkpoint or choice immediately after the random step.

  • If the random roll is greater than 6 → positive outcome
  • If the dice roll is less than 6 → negative outcome
Screenshot: a checkpoint testing the dice roll, where a result under 6 leads to the negative outcome.