1
$\begingroup$

I have exactly no knowledge of programming. I want to design/develop/etc a video game I've been wanting to do and part of this is a crafting system similar to what Skyrim has.

Let's say we are working on making an edible food or drink. I want the character to be able to mix ANY ingredient to create a food or drink or even potion. But I don't want there to necessarily be a set outcome. I want the computer to be able to read the information of several ingredients and let the computer decide what the effects of the created product will be.

For example: The player would grab several totally random seemingly unrelated ingredients, and when mixing the ingredients to create a usable object the computer would then read those things and decide the effects. Once the potion/food/drink/poison is created it is a learned recipe.

What would the code for that even look like?

$\endgroup$
2
  • $\begingroup$ If you dont want a set outcome for the same input, simply generate random output $\endgroup$
    – lox
    Dec 8, 2021 at 8:11
  • $\begingroup$ Generating random output on a computer is anything but "simple". We work very hard to make sure our computers behave deterministically. $\endgroup$ Dec 10, 2021 at 20:42

1 Answer 1

1
$\begingroup$

Use pseudorandom numbers to randomize those elements.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.