Feature - Implemented improvements to quest tracking

matt.chugg

Moderator
Thanks, Bale. Saves me some work.

roippi are you working on this? I can't find the patch I started making it may be on my other computer.

in my head (not always a clear place!) This could be a whole new class in java that has a (java equivalent) of a collection of questStatuses

A questStatus collection item (class?) would consist of an information string (what to look for), a setting name string, a value to set the setting if the string is found and a pagename

Several functions based on the page name could loop thorugh the relevant collection (eg the collection of concil responses, OR the collection of questlog responses, or the collection of adventure results texts) setting the preference IF its different to the one it is currently set to.

Then each request could call QuestTracker.ParseXXXXresponse (eg CouncilRequest.java could call questTracker.ParceCouncilResponse, and AdventureRequest could call QuestTracker.ParseAdventureResponse)

If questTracker.parseXXXXresponse checked the preference before updating it, would it be possible to add a hook to call an ash script like QuestStatusChanged(questname, new status) ?

I know how i'd write this in .net, but i'm afraid my Java knowledge just isn't good enough to set any of this up, although i'm happy to populate the collections if it was set up by someone better than me, also apologies if my terminology isn't right!

@rinn, i'm sure I have the patch in post #19 updated to the castle in the clouds quest, but it may not be the right way to do this
 
Last edited:

Theraze

Active member
Well, by level 6, I actually meant the stages of the Azazel quest, but I suppose you can check for the items and don't need another field for those. Nevermind. :)
 

roippi

Developer
I haven't started work on it yet, but yeah it's on my plate of things to do. I'll get the framework down and then it will be a lot easier for others to come in and flesh out the quests.
 

matt.chugg

Moderator
Mine too, but I don't want to work on something you might be, if you had a framework in mind (similar to how I mentioned above, where all quest tracking could be modified and updated) i'll be happy to help with updating, and I suspect rinn was also thinking of working on this if he asked for my patch
 

roippi

Developer
r10431 adds some architecture for doing this. It doesn't actually change any functionality. We still hit questlog.php on login, etc. I figured I'd share since it's mostly brute force copy/pasting and writing conditional checks from here on out to complete questlog parsing.

We are eventually going to need to tie disparate parts of mafia into this system. We may need to update quest when we:
-Hit questlog.php
-Talk to the council
- Receive an AdventureResult/item
- Use an item
- Some other stuff I'm probably forgetting

Fun!
 

roippi

Developer
r10447 adds all the preferences, and should parse -most- quests and set the preference appropriately when we parse questlog.php. For now, that only happens on login and "refresh all". I didn't add some of the intermediate steps for some optional quests because I got really, really tired of copy/pasting. Also, some of the data on the wiki contains typos or is missing, so that's a thing.

For the most part, these preferences will not yet update while adventuring, barring a manual refresh. Event hooks need to be added for every single entry.

ETA: We can preferentially add in the hooks we are most interested in first, of course. For example, if someone wants to make the spooky forest decoration tell you which of [mosquito larva, spooky mushrooms] you'll get, just need to update questL02Larva to finished when you turn in the larva to the council. Then you can properly write the logic for the decoration.

I'll be slowly adding these, but there's no guarantee I'll get around to adding every single interstitial step for the really long quests. Looking at you, macguffin.
 
Last edited:

Rinn

Developer
What are your thoughts on moving the strings in questLogData into a datafile instead of defining them in QuestDatabase.java? It would make it easier in the future for someone to change or add additional quests without needing to recompile mafia. I think it would be better to start moving stuff like this into external data files, and I'm willing to do the work to do so.
 
Last edited:

roippi

Developer
I wouldn't be averse to that, if the implementation is right. Might be a little tricky. Right now it's stored in a String[][], which is useful because the bottom-level array can be of arbitrary size when there are intermediate quest steps.
 

Bale

Minion
Started reviewing the new feature. This is very nice. Now that you've got all those nice preferences to tell me which quests are complete, I'm going to have to implement them in AdventureAdvisor to keep from showing completed zones. Sweet.

Surprisingly useful for a half-completed feature.

PS. I'm going to have to figure out if questG01Meatcar tells me if I've gotten to the beach with a bus pass or pumpkin carriage.
 

roippi

Developer
Glad it's useful to someone :)

r10462 adds in some council quest parsing for when we start and finish quests, and some other event hooks (like turning off the rat faucet, handing in ore, etc.) Probably one or two more commits at least before all the main quests are fully handled.
 

roippi

Developer
For my reference

questL02Larva: done
questL03Rat: done
questL04Bat: done
questL05Goblin: done
questL06Friar: done
questL07Cyrptic: done
questL08Trapper: done
questL09Lol: done
questL10Garbage: done
questL11MacGuffin: done
questL11Worship: done
questL11Manor: done
questL11Palindome: done
questL11Pyramid: done
questL12War: done
questL13Final: done up till chamber stuff
 
Last edited:

Rinn

Developer
I just committed the change to move the quest strings into data files with 10470. The strings should all be exactly the same, I basically just removed the escaped quotes and replaced the line breaks with tabs.
 

roippi

Developer
Cool. I'll leave off adding more of those and let other people work on them since they're extra-accessible now. There are numerous entries needed still for some of the non-ascension quests: nemesis, wizard of ego, etc.
 

roippi

Developer
With 10500, I think that rounds out all the ascension quests.

The various ascension-relevant quests should now update without needing to hit questlog.php. This gives us the option of not hitting questlog.php on login, but I don't know how comfortable I am going that route. Doing something like ascending your character outside of mafia will leave mafia in a state where it thinks it can access the friars, black market, etc. Bad.

Right now when we hit questlog.php, we set the status of any quests that we see, but we don't un-set quests that we don't see. If that makes sense. That could probably be changed. Maybe combine that with logic that will hit questlog.php when we fail to visit the friars, citadel, black market, etc. to update availabilities? Maybe then I could see removing the server hits when we log in. Thoughts?

Arg, and here I was all ready to mark this implemented.
 

Bale

Minion
There are a few on-ascension quests that are relevant to my own scripting (I was just adding them) so it would be nice if you could add these to automatically update as well.

questM02Artist
questM10Azazel
questM12Pirate

I think that other people like bumcheekcity would probably appreciate Azazel and Pirate updating as well, but I'm probably the only one crazy enough to make use of questM02Artist.


Maybe then I could see removing the server hits when we log in. Thoughts?

I think it is always best to hit quest.php on login, just in case.
 
Last edited:

roippi

Developer
Ah yes, forgot about those. Artist and azazel are easy. Pirate.. the only difficult bit might be the beer pong step. We'll see.
 

Theraze

Active member
I'd use the Artist property to save 2 server hits per execution of the Artist.ash script, and I'm not sure how many (but a bunch) of server hits for Azazel and Pirate.
 

roippi

Developer
As a reminder, the number of steps I add is directly tied to the number of steps in the quest log, unfortunately. In the case of azazel, it's just started and finished. :-/
 

Bale

Minion
Unfortunately questG01Meatcar is nearly useless. :( It doesn't tell me if I have Beach access and in Axecore it won't tell me if I have a meatcar since I never actually got the quest. Ah well. Don't waste time with live implementation of that one.

questG04Nemesis is probably more interesting to scripters though it'd be a real PITA to code up, expecially since it has an intermediate competed status that becomes uncompleted. WTF? And lets not forget the 6 different final completion texts.
 

roippi

Developer
Yeah, nemesis is.. yeah.

10504 adds artist and pirates. It adds azazel completion, but not starting. I'm actually not sure what the trigger is for the quest first showing up in the quest log. Wiki isn't much help.

ETA: I'm going to mark this implemented, mostly because I just want a green tag on something I've put this many commits into. There is a bit of polish left to do on some bits, but the core functionality is fully in place.

If anyone urgently needs live tracking for a particular quest, let me know and I'll consider working on it. Otherwise, take a look over the various commits I've made here and the methodology should all be there if you want to code it up yourself.
 
Last edited:
Top