A quest system for a first person game, made in Unity (URP). The test world is a small village with three people, a field with wolves, herbs to pick and a boss.
Note: Logic build mein AI ki help li gayi hai.
| Key / mouse | Action |
|---|---|
| W A S D | Move |
| Shift | Run |
| Space | Jump |
| Left mouse button | Shoot (to kill the wolves) |
| E | Talk to a person / pick up a herb |
| J | Open / close the quest log |
| F9 | Delete the save and start a new game |
| Esc | Close a window |
- Quests are data: every quest is a
QuestDataScriptableObject (text, objectives, who gives it, which quest must be done first). - Take it from a person, give it back to the same person. The mark above the head shows what he has for you: yellow
!new quest, green?ready to hand in, grey?you are still working on it. - Four kinds of objectives: kill, collect, reach a place and talk to someone. Enemies, items, places and NPCs only report what happened (
GameEvents), andQuestManagermoves the objectives forward, so the world does not know anything about quests. - Quest chain: Wolves in the Field -> Scout the Ridge -> The Alpha. A quest can only be taken when the one before it is completed. You can carry three quests at the same time.
- Quest log (J) and a tracker on the right side of the screen, with short messages for every step.
- Save and load: the quests and your position are saved to a json file whenever a quest changes, and loaded when the game starts.
- Herbs can only be picked while a quest needs them and grow back after a while, wolves come back after a while, so you can never get stuck.
- Unity 6000.3.25f1 (Universal 3D / URP).
- Open
Assets/Scenes/SampleScene.unityand press Play.