Dev Ramblings: Quest System?
This may take a while, so this is mostly just going to be me jotting down notes and progress. Hope that's okay? So far I've made a database table:
Spoiler: adopts_quests
But not much else. Quests will have a Title, Flavor Text, and then a reiterated Objective. For example:
Spoiler: adopts_quest_logs
The status in the quest log will either be Completed, In-Progress, Repeatable, or Available. Available are for quests the user doesn't know they have access to yet, and have not started. If they visit a page that checks if the User has a QUID 'Available' to them, then the quest will reveal itself to the user and give them the opportunity to accept the quest and move into 'In-Progress' status.
My desire is for quests to be able to be started with a simple function call on just about any page. We'll also want a Quest Log page for users to view quests they're on anytime they need to, for reference.
To do this we're going to need to make a new class. I've got two methods in the class so far - one to set the status in the quest log, and one to pull up basic information.
Spoiler: classes/class_quest.php
Quest Info
Where you wanna pull up quest info, you just gotta plant in a link to the class. ( $quest = new Quest(); ) Then ask it for the info using the quest's id number as it's stored in the database. ( $questinfo = $quest->questInfo(1); ) Now, you can pull up specific properties! For example, if you want the title of that quest, you could use ( {$questinfo->title} ).
Unlocking Quests
Some quests you may not want to be available until later. Normally, nothing eventful happens when you visit the river. But, say you just helped some critters in the woods. Well, at the river, everyone heard about your good deeds and want you to do a thing for them now, too. When you finished the quest at the woods, you 'unlocked' the quest at the river.
To unlock quest #5: $quest->questLog(5, "unlock");
In the database, a quest will appear in the quest_logs with the quid of 5, a status of available, accompanied with the user's name.
Starting Quests
We'll want to press a confirmation button for this (it would be rare that you would auto-start a quest for a user). I don't have this formulated up yet, but, you'll be able to call a start to quest #5 like this: $quest->questLog(5, "start");
If the quest is repeatable, you'll want to include a third parameter to say so - : $quest->questLog(5, "start", "repeatable");
Completing Quests
You'll be able to mark quest #5 as comlete like this: $quest->questLog(5, "complete");
If the quest is repeatable, you'll want to include a third parameter to say so - : $quest->questLog(5, "complete", "repeatable");
This will just set (non-repeatable) quests to 'Complete' in the quest log. On the other hand, I may not want to keep track of completed quests, and may opt to replace this with just deleting the row once the rewards have been dispensed.
Anyway, right now, completing won't reward anything, and that's all the progress I've made.
-
So I've got some forms to build and implementation areas to suggest.
There's more than one type of quest I need to incorporate. Not just 'bring me x' it's also 'go talk to so-and-so'. This is going to be complicated so I'm not totally sure how many hoops I'm going to have to make people jump through to implement it. At least I'm good at writing tutorials!
Anyway, these are just my rough thoughts so far, and are subject to change.
And... feedback is welcome. Since this is something I'd like to release to the community when it's nice and done, let me know your needs and desires from a quest system.

But not much else. Quests will have a Title, Flavor Text, and then a reiterated Objective. For example:
Quest Name: Bees!
Flavor Text: Miss Porter needs honey to make her extra special candy. If you find a bee nest, she wants you to bring her back some honey.
Objective: Return with honey!
When you return with the appropriate item or the action has been taken (there will be a Quest Log table built into the database as well, and it will keep track of quests you have actively doing, have completed, and ones that are available to you), either the page will know the quest is complete an immediately present you will completion text, or you'll have to press a button to turn in the text. You'll then be presented with Completed Text and possible rewards - cash and/or up to four different kinds of items, and any quantity of them you want to give the player.Flavor Text: Miss Porter needs honey to make her extra special candy. If you find a bee nest, she wants you to bring her back some honey.
Objective: Return with honey!
Quest Name: Bees!
Completed Text: You present Miss Porter will delicious honey to make her extra special candy. "Is that honey? My, my! Good job!"
Rewards: 200 Cash, Special Honey Candy x3
If a quest is repeatable, the option to begin the quest again should be available the next day (we'll save a timestamp in the Quest Log and check against it on page load). Speaking of, here's the quest log database:Completed Text: You present Miss Porter will delicious honey to make her extra special candy. "Is that honey? My, my! Good job!"
Rewards: 200 Cash, Special Honey Candy x3

The status in the quest log will either be Completed, In-Progress, Repeatable, or Available. Available are for quests the user doesn't know they have access to yet, and have not started. If they visit a page that checks if the User has a QUID 'Available' to them, then the quest will reveal itself to the user and give them the opportunity to accept the quest and move into 'In-Progress' status.
My desire is for quests to be able to be started with a simple function call on just about any page. We'll also want a Quest Log page for users to view quests they're on anytime they need to, for reference.
To do this we're going to need to make a new class. I've got two methods in the class so far - one to set the status in the quest log, and one to pull up basic information.

Quest Info
Where you wanna pull up quest info, you just gotta plant in a link to the class. ( $quest = new Quest(); ) Then ask it for the info using the quest's id number as it's stored in the database. ( $questinfo = $quest->questInfo(1); ) Now, you can pull up specific properties! For example, if you want the title of that quest, you could use ( {$questinfo->title} ).
Unlocking Quests
Some quests you may not want to be available until later. Normally, nothing eventful happens when you visit the river. But, say you just helped some critters in the woods. Well, at the river, everyone heard about your good deeds and want you to do a thing for them now, too. When you finished the quest at the woods, you 'unlocked' the quest at the river.
To unlock quest #5: $quest->questLog(5, "unlock");
In the database, a quest will appear in the quest_logs with the quid of 5, a status of available, accompanied with the user's name.
Starting Quests
We'll want to press a confirmation button for this (it would be rare that you would auto-start a quest for a user). I don't have this formulated up yet, but, you'll be able to call a start to quest #5 like this: $quest->questLog(5, "start");
If the quest is repeatable, you'll want to include a third parameter to say so - : $quest->questLog(5, "start", "repeatable");
Completing Quests
You'll be able to mark quest #5 as comlete like this: $quest->questLog(5, "complete");
If the quest is repeatable, you'll want to include a third parameter to say so - : $quest->questLog(5, "complete", "repeatable");
This will just set (non-repeatable) quests to 'Complete' in the quest log. On the other hand, I may not want to keep track of completed quests, and may opt to replace this with just deleting the row once the rewards have been dispensed.
Anyway, right now, completing won't reward anything, and that's all the progress I've made.
-
So I've got some forms to build and implementation areas to suggest.
There's more than one type of quest I need to incorporate. Not just 'bring me x' it's also 'go talk to so-and-so'. This is going to be complicated so I'm not totally sure how many hoops I'm going to have to make people jump through to implement it. At least I'm good at writing tutorials!
Anyway, these are just my rough thoughts so far, and are subject to change.
And... feedback is welcome. Since this is something I'd like to release to the community when it's nice and done, let me know your needs and desires from a quest system.