Quote:
Yes, I was looking at the quest system this morning, and that was my thought. While I am at work, I thought I would start sketching out how to implement this, and welcome any thoughts you have on my tentative design choices. First the tables. Global tables for the stuff that doesn't change (once the task is written), and character tables to record their progress. Code:
CREATE TABLE GlobalTasks ( logins, and probably not across zoning, so needs to be resent after zoning. As I see it, zone will need to load the global task and activity tables in their entirety on zone bootup. This may become an issue later on if their are lots of tasks written. As this is global static data, it could be a candidate for shared memory, but I will leave that for the future. The next issue is how to represent the Tasks in memory. Each Task has a unique ID. I am leaning toward #defining a MAXTASKID (say 10000 ?), and using a fixed size array ... TaskInformation* Tasks[MAXTASKID] The benefit I see of doing this is fast cross referencing to the Task/Activity information from the per-character data. I think this would also make it easier to #reloadtask a single task during development. Onto the per-character info. Should I restrict a character to a maximum number of active tasks, e.g. 20 ? The benefit I see to this is it constrains the amount of checking that needs to be done on killing/looting to see if there is a matching goal in the characters active activities. Pseudo Code: On NPC Kill or Loot: for each active task the character has: for each open activity in that Task: if ActivityGoal == Kill This NPCType or Loot this item.id Increment Goal Count It did occur to me that an extra flag could be added to the npc_types and item tables, 'involvedintask', so that the code could check this flag and if it is set to No, not bother checking the characters active tasks. Task initiation will be done through the existing Perl quest system, so the usual checks for class, race, faction can be done before the NPC initiates the Task Chooser. (Also provide a function so that a check can be made in Perl to see if the player has already completed a particular task, so as not to offer it again). I also see Task Completion/Reward as being handled by the Perl quest system, i.e. the last activity in a Task would be go speak to an NPC who would then do something along the lines of: Code:
if quest::ActiveTask(1234) && quest::TaskActivityComplete(1234,10) .... give reward, quest::TaskComplete(1234) been using http://everquest.allakhazam.com/db/q...tml?quest=3237 as a guide, as that is the one in the packet collect I was looking at. |
Looks like you have a good handle on it, and your initial approach seems viable to me. I would think that limiting the number of active quests a toon can have is wise at this point. Once you get started implementing it, I'm sure you'll come across other challenges. As for tasks, I'm mostly familiar with these...
This is an example of a collect task: http://everquest.allakhazam.com/db/q...tml?quest=4320 This is a combo kill/collect: http://everquest.allakhazam.com/db/q...tml?quest=3065 I know we're not up to DoN yet, but these tasks are examples. |
Quote:
Personally I'd do something like: Code:
CREATE TABLE TaskSet ( Would also need some way of enabling the tasks if one were to go with such an implementation. Quote:
Putting it in shared memory is also probably a better option as the structures are probably going to need to be in some cases quite large and with the assumed 10000 entries it would really add up for a server that loads quite a few zones. A couple MB per zone doesn't seem like a big deal until you load up 50. |
Ok I have to say this is awesome! Ive been waiting for tasks to work since i came to eqemu! Awesome work derision
|
Quote:
Code:
$args ="1,2"; Shared memory I will leave til last, as it's not something I've ever worked with. |
First, allow me to say that your findings are very promising. A good Quest Journal was really a missing part of EQEmu (and in fact of EQ for some quests).
I did not play with the task system very much on Live, it really came when I was taking a break from the game. There is one thing you should be careful of : may be some Live tasks have simultaneaous activities. Something like "Make 7 flame Posts" and "Get banned for one week", that you need to complete before you can progress to the next activity. As you see I am sticking to your examples spirit :) Regarding the design, you could make the Quest Journal have even more reach by separating the low-level Journal handling from the Task system. In short, it could allow quest designers to track quests in the Journal even for quests that are not formatted like tasks. Let me take an example, this time from a quest idea I actually started implementing through the normal Perl system.. "The young gnome had been playing a few pranks to several personalities in Ak'anon, following the directions of the enchanter guild mistress. The last one had put him in hot waters though : passing for a half-elf had been easy with the illusion spell the enchantress had given him, but he was still shaking about the thought of what would have happened had he answered to the necromancer in the wrong way. But the real problem was : what to do with the letter the necromancer asked him to deliver to the dark elf necromancer guild master in Neriak ! Clearly he had gotten more than the enchantress had hoped for, surely she sent him there on purpose, not just to play one more prank. He could certainly bring the letter to her, or may be actually delivering the letter to its actual recipient would make him rich. Neriak was a wealthy city." At some point the character can choose one of two major paths in a quest. Having the Task Task system handle that could be tricky. Handling arbitrary quest progress triggers (like we do in Perl sometimes) would be overkill. It is made for simple tasks and let's face it, many quests are like that. On the other hand it would be very nice to allow regular Perl quests to benefit from the Journal, given the quest writer accepts the extra work naturally. You could achieve that by untying the actual quest progress (task progress) from the Task system logic. The tables would be unchanged, except the comment for completed would not apply : for arbitrary quests donecount has no meaning. The activity would be complete when the completed field is filled. What does actually change then ? Answer : the way the tables are managed. At the moment may be you are thinking of wiring the table management into the task system. Instead you could separate the table management, and expose all "atomic" operations on those tables as quest:: xxx calls in Perl scripts, on top of using them for the task system of course. Quest writers could then decide when to : * quest::start_task(taskid, activityid) : the quest could start at any activity, defined by the Perl script * quest::complete_activity(taskid, activityid) : completed date set by the server * quest::start_activity(taskid,activityid) : this activity is started. Several activities could be up at the same time. * quest::complete_task(taskid) : completed date set by the server Of course those "manual" activities would not track progress , the Perl script does. But the player would at least see the quests he is on and the text for the current activity. It would be the quest writer responsibility to start the next step(s) after completing the previous one(s), to detect when an activity is complete etc. A few checks could be added to avoid inconsistencies, like tasks completed whereas some activities are not complete for this task. But the code need not ensure an open task has an ongoing activity. The Perl scripts pilot the Quest Journal, and try to reproduce faithfully the facts. The Task system in this case is not active. With an activity_type of "Unmanaged" or somesuch it would be easy to deactivate the task system for those "quest" tasks and activities. Ultimately this could lead to a flexible, semi-automated quest/task system : quests/tasks and their steps would be defined in the DB, with the transitions from a set of steps to the next ones. Each activity/step could either be handled by Perl, disabling any automated counting of objectives, or be fully supported by the engine for easy activities (loot, kill, explore). This would just depend on the activity_type. But it can be built one step at a time :) By doing that we could have an emu better than Live with regards to quest tracking : even old quests could be tracked by the Quest Journal, given they are reworked of course. I suggest this because I doubt it would be much more work to structure the code to allow the Task system to be optional with regards to the Quest Journal. Most of the things to write are the same, you just need to let the Task System pilot the Quest Journal, not intermix them and make them dependent on one another. I hope this did not read like gibberish :) |
Quote:
There are two types of task activity packet. One for completed and 'in progress' tasks which sends the details of the goal, and progress toward completion. The second type is really just a placeholder, which consists just of an Activity Number, but no details of what the task is. These show up as ??? in the Task Journal. It would be easy to alter the table and code to add a predecessor activity field. I know, (and you can see from the example in my first post), that it is possible to have more than one activity in progress displayed at the same time. As for your other points, I skimmed over them, but they sound interesting, and I will look them over again and see what's possible as I continue to implement the system :) |
I've been beavering away at this since Friday and thought I would provide an update on what I have functional so far:
Database Load routine for global task data Database Load/Save for character task data The database save is synchronous, but it only writes out anything that has been changed. I'll have to see if this can be done asynchronously like the saving of the other character data is. Active task information is sent to the client when it enters a zone and so is retained across logins and zoning. Initial Perl interface to bring up the Task Chooser with a list of up to 10 tasks: The way I have it working right now, is the NPC has a list of all the tasks he can offer ($tasklist). It then checks whether the player already has each task in the list already assigned, (quest::istaskactive) and thus builds up a list of tasks it will offer ($tasksoffered), not including any tasks already active. quest::taskchooser then brings up the task selector window. Code:
@tasklist =(1,2); Code:
sub EVENT_TASKACCEPTED { Two more Perl quest functions, quest::istaskactivityactive(taskid, activityid) and quest::flagtaskactivitycomplete(taskid, activityid). This code checks when you hand in the Elven Bottle of Wine to see if you are on activity 0 of the Children of the Fay task (task 1), and if so, accepts the item, and flags that activity complete, sending the 'Task Stage completed' message, and unlocking the next activity: Code:
sub EVENT_ITEM { As I see it, I can either put a limit on how many predecessors an activity can have (let's say 4), and then have four columns in the table, predecessor1, predecessor2, etc. Or, have a text field which could contain a comma separated list of predecessors, e.g. "2,3". I dislike this because it means I have to parse the string to get at the predecessor info. I'm leaning toward option 1 (a fixed, small number of predecessors and having a column for each). Still lots left to do! |
Quote:
Code:
CREATE TABLE TaskOrder ( Code:
taskid activityid step Hope this gives you some ideas, the whole task system seems REAL promising :-) |
Quote:
Anyway, I've hit upon another snag. I've just implemented the code to update 'Kill' and 'Loot' activities, based on NPCTypeID or itemid respectively, which works great, however ... I wanted to add a Kill activity to kill 5 Orc Centurions, but there are 40 entries for Orc Centurions in the npc_types table! As they say, no plan survives contact with the enemy! I would welcome ideas on this one. Doing a lookup against a list of 40 NPC IDs per kill seems a bit OTT. Maybe some sort of sub-string match again the NPC name may be a less expensive way to go. |
Hmm. Could be you just let any of them meet the requirements. Or you could just filter them out like you say. It probably makes more sense to filter them out and then let any of the resulting id's after you filter them to your satisfaction, meet the requirements for the task.
|
Quote:
As much as I like the first option, I think the "better" way to do it would be to create a similar lookup table like I mentioned above. Yes, it is another table, but it makes it much more powerful overall. That way, you could also include named mobs that are rare spawns to include towards the kill target. Yeah, it seems like more work in the database, but that's also what relational databases are for: creating complex relationships between data sets :-) |
Use quests for the kill component =p
|
Quote:
|
Quote:
I've now mapped out some more of the activity types: Code:
3 I already have handled by hooking into Corpse::LootItem, and I imagine 6, 7 and 8 should be done by hooking into the code as well. I'm guessing that the 'Touch' activity means clicking on a clickable-object, like a door or something. I found a task on Alla that has 'touch' as an activity: http://everquest.allakhazam.com/db/q...tml?quest=3151 But it's not clear what it means. |
All times are GMT -4. The time now is 05:19 AM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.