M
M
Maxim Buyanov2018-05-14 23:46:54
C++ / C#
Maxim Buyanov, 2018-05-14 23:46:54

How to create a task system in the game?

My question is quite detailed
. I am creating a game in which I need to implement receiving tasks from the database
. I can’t solve the problem in what format to receive and process them,
for example:
a person receives a task to buy 2 chairs in a store -> he buys them -> he is given a reward
further he gets the task to buy a sofa and a table -> successful -> reward
and he gets the third task - to place these 2 chairs, a table and a sofa in the house

, the example, in theory, should illustrate that the tasks can be any, and the receiving mechanism should be the same
I'm wondering how it works in terms of the algorithm in more detail,
I mean the approximate functionality of the classes that I need to write
(where there is a way to save the current progress (I think to use PlayerPrefs)),

rather than "well, there you have a table with tasks in the database, well, you create a class for tasks and that's it"
(usually I found only such answers, but this is obvious | probably , I don’t know how to google)
I haven’t been programming for a long time, but the fact that even VK games have such mechanics freezes me, and I can’t figure out how to implement it.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Pavlov, 2018-05-15
@lexxpavlov

Good answer Yegor , I'll add another table: the conditions for the appearance of tasks - which task appears after which. You can also add other conditions there: time, level, availability of items, or vice versa absence (an important item has disappeared - add an optional task to get this item again).

S
Saboteur, 2018-05-15
@saboteur_kiev

What is the problem with adding a "task type" column, where it will be "buy", "sell", "place", "find", etc.
I did this in the game 20 years ago.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question