How It Wokrs | Documentation | Home |
Adventure Game Documentation
Shows the journy of creating the quest system for an adventure game.
In the link above is the same content but on github
Road map
Quests
- Add quests skeleton (add how quests will work and function) [1/31/25]
- Finish quest function system (progress in quests, types of quests, and complete quests) [2/6/25 - allow more than 1 quest to work at a time - allow progression through quest - add a way to finish quests
- optimize current quest system and fix small bugs [2/6/25] - make the quest load when the level loads so every level does not have there quest active at once
- Add a npc for quests npc [2/7/25] - inside of the level add the npc data - place npc on the right of the screen - Make a questNpc.js to fully customize the quest npc as the current npc.js file is focused on quizzes
- Make the npc give quests to the player - when colliding with the npc make 1 random quest be added to the quest list - add a delay after getting another quest - when the quest gets completed when going back to the npc the quest will be removed from the quest list
-
Add ui for quests - add the skeleton of how the dialogue will be made / shown - make a small box show up with text inside - make the box show the quest name - add a quest description value - show description in the box - Make a function inside of quest system that handles the ui
- add dialogue
- Spawn item on map when getting the scavenger quest - Make the spawn function inside of questSystem.js - Select a random Spot on the level (decided to go with set pos) - Spawn a sprite - Add spire data - base sprite data off of the selected item
- Make the scavenger hunt pick a random item - Select random item in an array of all items - Assign item to the quest
- Add more Collectibles - Add a flower - Add a Hammer - Add a broken plate
IF leftover time create a system that auto generates random quests for the current level to make inf quests
Player
- Make movement accelerate start faster
- increase movement speed
Reminders Look at slack and follow the stuff
How to document
Use drawio to describe how every step works, How a quest is given(duolog, what the quest is etc),How quests are made, layout how to make the quests so after you finish 1 section you can move to the next like a list on drawio, just explain in more detail and show how you are going to do it before you do it.
As of 2/4/25 there will be sub goals that will be like the checklist but on how to to the next goal or progress in it
1/30/25
I have added 2 js files QuestSystem.js and Quests.js
In the image below you can see where the quests are being stored
In the image below it shows how the quests are being created and added into the Quest System
In the adventureGame.md I have sectioned out a place for the scripts and where the future UI might be
Inside of the levels you can add quests which will be very customizable with different types of quests
1/31/25
I have added 2 types of quest a scavenger and a talk to npc quests.
The quests values are stored in an array for future use on tracking how far you have progressed on the quest
How I will update quest progress with actions inside the game
This is were the npc collider checks are for when they talk to you
2/3/25
Instead of the previous way of checking if you collided with an npc, obj etc. I was going to but multiple lines of code sending checks, but instead of have checks in a bunch of places I decided to place the checks in the collision system to send checks whenever there is a player collision.
2/4/25
I added logic to check when a quest has been progressed in and removed the quest check functions for the scavenger and npc quest as when they were called they were not created in time.
Plans for next changes
Sub Goal the next set of changes want to add is that the quests values will be updated after talking to an npc then fully implement the scavenger quest.
2/5/25
I have decided to move the quest checks inside of the quest update function inside of Quests.js to organize were the quests function are in. For the npc quest the code removes the npc if it found on the npc list and if the list has nothing inside of it it will render the quest as completed.
Now inside if QuestSystem.js I made it so when colliding with objects inside of the level it will find what kind of level corresponds to the object and trigger the function to update the quest
(these images show changes for the npc quest)
sub goal
Finish the scavenger quest progression and complition
2/6/25
In the image below you can see that I changed to a class system and I have a function that creates a new quest object.
In the image below is were Levels will store there quests then it will add the quests to current levels
in the image below you can see how the quest upd function works which will upd quest values based on what type of quest it is
Now when the level gets loaded the corresponding levels will also laod
Next Goal
add the npc
2/7/25
In the bottom 2 images it shows how I added the new Activated value into the quest object. When this value is false the quest will be ignored when running quest checks meaning quest can only be progressed through when they have been activated. In the final 2 images It shows how I added the new quest NPC. When interacting with this npc it will chose 1 random quest and turn its activated value to true.
Sub Goal
Before he quest npc gives you a random quest it will check if the quest has been completed as I only want quests to be completed once.
2/10/25
In the images below it shows the function that are used to find the random quest that will be assigned to the player when interacting with the quest npc. When finding the random quest it needs to have a list of all non completed or assigned quest so it can quickly assign quest that are ready to be done
Added a div into the MD file for the quest messages to show in
Sub Goal
Create a displayMessage(message) function in QuestSystem.js to allow updates or dialogue to be given to the player
2/11/25 & 2/12/25
Bugs
- can interact with quest npc from any were
To fix the bug were you can interact with the quest npc from anywhere I had to add a function that uses the built in collision system to detect if the player is touching the npc. If it is a random quest will be given with a message output
The images below show different outputs that the quest message box can have
there are many images of code I am not putting on how the messages work as they will take up way to much room in this issue the future blog will be more detailed
Next Goal
As of now everything is working for the npc quest so my next goal is to get the scavenger quest to work and implement a scavenger object onto the canvas
2/13/25
I added a new ScavengerObject class for the scavenger quest. As of now the object must be placed onto the screen when the game loads and not when the quest is given
When the player is assigned a scavenger quest the object appears on the screen
next goal. Make an array of objects that can be randomly selected from
2/14/25
The image below is an example of what the scavenger quest objects will look like
I added quests to gameleveldessert as I am done testing
The code below is a switch statement in which when it is given an id the corresponding object will be created and placed into the game
Next Step. Create blogs to organize how everything works and store all info inside of this issue