Skip to content

Loading…

Quest log #10

Closed
NemesisDD opened this Issue · 30 comments

3 participants

@NemesisDD

As included in most of modern RPGs I've seen, also here a quest log should be added. The quest log will track all main and side quest with an overall description of the the quest and the actual status (the next task to do).

The quest log can be included in the status window of the main game. When the quest log is selected, the left side (character list) is replaced by the list of quest. In the right part, the description and next tasks are shown.

Update of quest can be included in the map codes with a new type of event (or a modified version of existing GlobalManager:SetEventValue).

Also, a text can be shown in the standard game mode when an specific task of a quest is done (something like "Update of quest: quest_name").

@Bertram25
Valyria Tear member
  1. Agreed with the way the quest log could be displayed.

  2. The update of quest should be based on the "story" event table. (As I'm using that already.)
    A quest log should appear only if its mother dependency is done, and disappear once the corresponding event in the story table exists.
    Quest logs should be read from a script file, using its own namespace (see map files first lines) as an array, i.e.:

quests = {
-- Quest name = { mother quest event dependency in the story table, quest event in the story table once done, text } 
 hide_n_seek = { "hide_n_seek_started", "hide_n_seek_done", hoa_system.Translate("Orlinn is hidden in town. Find him so he can tell you where Georges' pen is.") }, 
...
}
  1. I must disagree about the text shown in map mode: "Also, a text can be shown in the standard game mode when an specific task of a quest is done (something like "Update of quest: quest_name")." Cluttering and useless. On the contrary, and what is done in many RPGs, when a new unread quest log is here, one can add a "!" in front of it in the list, for instance. But even that is not really necessary.

Thanks for your participation!

@IkarusDowned

anyone working on this? thought I'd give it a go...

@Bertram25
Valyria Tear member

@NemesisDD was willing to but I have no news about this since some times now. (He seems to be very busy). Give him a couple of days to give a status about this, but if he doesn't, go ahead. :)

Note also that I added as prerequisite of this task to move into the formation menu option the stats info you can see in the status menu option and then get rid of the status one, making room for a new 'Quests' option.
The details are up to you, of course. :)

@NemesisDD

@IkarusDowned you can go ahead. I very sorry to be so silent in the last weeks but as I explained in he Allacrost forum to roots, I will spend my spare time with my wife and my daughter. For now it is much more important for me. I hope to finish my thesis next year, after that I will join again.

Generally, as @Bertram25 has stated, reworking the status window (cf. issue #11) is the more important step in the beginning.

@Bertram25
Valyria Tear member

@NemesisDD I can understand how family is important, so don't be sorry. :)
Thanks for the heads up, I wish you the best for you and your family starting with an approaching Merry Christmas. ;)
And good luck with your thesis.

@IkarusDowned
@IkarusDowned

@Bertram25
quick question: do you delete the story events as they complete? or can I assume that events will stay forever?

@Bertram25
Valyria Tear member

@IkarusDowned I do think events will stay forever in a list we usually see in many RPG. I guess new ones should maybe be shown first? thus, making such events sorted reverse-time based?

@IkarusDowned
@Bertram25
Valyria Tear member

@IkarusDowned
"if you do plan to, i can work around it by using a static counter and just keep the list sorted that way. Ok, I'll assume that the events will be permanent."
Yeah, the static counter is the way to go. I guess you're taking that one?

@IkarusDowned
@IkarusDowned

How do you plan to load the quest items? do you want to load them off a flat file as a seperate item? Alternetavely, you can add them in from the map lua script, after a game "event" that you decide. so, for instance, if I make a AddQuestLog() function for you, you could just insert the line in your lua scripts when you want them and it will update dynamically. The benefit of that is that you can time the quest with the event, and you don't realy need to have the "mother event" dependency any more.

The other option is a flat seperate list of just quest log entries which would be loaded at start and scanned every time the user opens the "quest" menu for "mother events" that are available.

Personally, the first option makes more sense to me, and you can save it right into the save game file and make it opaque that way, but its your call

@Bertram25
Valyria Tear member

Interesting! I like the stream line way the proposal is making the thing happen :)
(I'll assume for now, even without having a clue, that we'll use string based event keys)

I guess, along with the AddQuestLog(string_id) you'd also need to do some kind SetQuestDone(string_id) function, right?
As for storing it into the savegame, why not making it into a separate table, to make simpler to debug, for instance?

I might have missed certain details here, since you're the one in the work now, so feel free to point irrelevant thoughts on my own end.

And thanks a lot for your help on this. :)

@IkarusDowned

time for some screenshots! (I'll answer your questions at the end Bertram :) )

Here's a shot of the "Quests" option in the main menu:
mm_quest

and here's what it looks like when you are scrolling through quest entries:
quest_viewing

things to add:
1) darkening of the entry name upon completion of quest
2) a "!" png icon on the left if the item is unread

(1) i plan to put in on this push, its trivial
(2) is up to you all -- if you want it in this push, i would need someone to possibly supply a "!" png file, or i can supply a placeholder

ok, onto how quest log entries are stored.
after looking around, the most direct solution seems to be to put it in its own table in the save game. In fact, the images you see here are all from in-game quest entries! (albeit, they are all fake). So, the table looks something like this:

quest_log = {
    sample_key1 = {"complete_event_name", "A Quest Log Entry", "This is a basic description of the quest", "9"},
    sample_key10 = {"complete_event_name", "Balls!", "!#&%", "0"},
    sample_key2 = {"complete_event_name", "Another Quest Log Entry", "Yet another quest log entry", "8"},
    sample_key3 = {"complete_event_name", "Guess what this is", "Yep, its another quest log entry!", "7"},
    sample_key4 = {"complete_event_name", "Not another quest entry", "Fooled you! haha", "6"},
...

My suggestion was to allow you to programatically add these in view a call to AddQuestLogEntry() that takes the completion event, the title and description. number will be handled in the code itself.
I can also provide a CompleteEvent if you want, but with this setup thats a matter of inserting the completed even in the events table.

in the menu, the code checks for completed events to "grey out" the quest entry.

so, a couple things:

  • what do you guys want in this push
  • what do you guys think of the entry method?
  • any other feedback is always welcome

the current state is available on my /working branch

@Bertram25
Valyria Tear member

Hi @IkarusDowned ,

Excellent work so far!!

(2) is up to you all -- if you want it in this push, i would need someone to possibly supply a "!" png file, or i can supply a placeholder

You can reuse that one for now, IMHO:
https://github.com/Bertram25/ValyriaTear/blob/master/img/effects/emotes/exclamation.png

I can also provide a CompleteEvent if you want, but with this setup thats a matter of inserting the completed even in the events table.

Ah, no. I was speaking of a QuestCompleted() kind of function. Nothing to do with events.

in the menu, the code checks for completed events to "grey out" the quest entry.

Interesting. And very well thought :)

I'll have a look at the code before telling you more.

Thanks a lot!

@IkarusDowned

Sorry, i mean to type CompleteQuest(), or QuestCompleted(). I can provide it, if you wanted to do something like a batch-completion of quests when a player hits a certain trigger or something.

Also, where can I get samples for how to bind the functions into LUA?

@Bertram25
Valyria Tear member

I'll have a look at the code before telling you more.

Done. Wow, excellent work done on the menu in general. Just take of adding spaces after commas,
adding a new line between functions, and don't add extra useless newlines in functions.
I'm eager to see this in action.

Also, where can I get samples for how to bind the functions into LUA?

About that, I guess you can have a look at this file:
https://github.com/Bertram25/ValyriaTear/blob/master/src/common/common_bindings.cpp#L80

It should be quite explicit how to add some bindings there. If not, feel free to ask an example. :)

@IkarusDowned

Just take of adding spaces after commas,
adding a new line between functions, and don't add extra useless newlines in functions.

went through and looked through it, I think I got most of them

ok, i'll add item (2) this push then if we already have a resource for it

@Bertram25
Valyria Tear member

Excellent, thanks for the hard work :)

@IkarusDowned

huh, as it turns out, (2) isn't as trivial as i thought. we would need to make some significant changes to the OptionsBox / Options code, so I am going to leave this out of the release. (1) however, looks like it can be done VIA option text formatting relatively easily. Is my understanding there correct?

@Bertram25
Valyria Tear member

to me graying some text can be done by simply disabling the entry. Don't forget to not set skip disabled to true so people can still have a look at them. ;)

As for (2), I know that somewhere else in the code (was this in the battle command or in the shop) but I remember that they used the trick to setup two option box one next to another with one having the cursor hidden, and send the scrolling event to both. Would this do the trick? Anyway, it's not urgent at all.

@IkarusDowned

Also, is there a good way to deal with "\n" being outputed? for instance, do you guys have a tokenizer that can go through and take '\n' and say, replace them with
or something?

@IkarusDowned

to me graying some text can be done by simply disabling the entry. Don't forget to not set skip disabled to true so > people can still have a look at them. ;)

bingo, that should do it!

@Bertram25
Valyria Tear member

Also, is there a good way to deal with "\n" being outputed? for instance, do you guys have a tokenizer that can go through and take '\n' and say, replace them with
or something?

Huh? Weird, in option box? EDIT: This is definitely becoming some kind of chat ;)

@IkarusDowned

ah no, so what is happening is in the description section, you'll probably want to have paragraphs and stuff, so you'll put a \n into the description field. but when i output this to save it, it breaks the LUA code format since the \n outputs a new line. i need to convert those to something that i can later change back when loading

@Bertram25
Valyria Tear member

Hmm, why would you want to save something that has \n in it?
I thought you would store string base id or something like that, right?
EDIT: I think I guessed, but let me say that the description should be read from a flat file. Only the string id should be added and set to done through the streamlined scripting part, IMHO.
REEDIT: Er, maybe we had it wrong from the start? In that case, my apologies. :) Because I could have told you about this problem before. The joy of working live, I guess.

@IkarusDowned

ok that makes sense. Lets move the description and the title entry to a seperate script / file, and the entry will just store the key id. I'm a little vague on how this part will work since i'm not sure exactly how lua manages this / how you want the folder structure managed. I'd like to keep things simple when looking for quest description information--a single string ID to a single lookup would be nice.

the "simplest" thing i can think of is it have a folder called "quests" and just make one huge file with all the quest entries in it.

what is your ideal structure for this?

@Bertram25
Valyria Tear member

In something like dat/quests/quests.lua or in dat/config/quests.lua, it would be fine :) thanks!

@IkarusDowned

screenshot time!
Here's (1) and (2) added:
unread_finished

remainig:

  • string ID change
  • lua binding
  • testing
@IkarusDowned IkarusDowned added a commit to IkarusDowned/ValyriaTear that referenced this issue
@IkarusDowned IkarusDowned Quest Log as refered to in #10 is added!
The total changes in this push:

+ Added Quest view in menu
+ Added scrolling of quests and viewing the description
+ Quets can be added based on user-preference directly from LUA code /
logic thanks to an AddQuest lua binding
+ Quests will grey-out when completed, and have a "!" on the left if you
have not read them yet
+ dat/config/quests.lua holds the quests. I have added a couple sample and
some "test" quests there and left them on purpose. You are welcome to add
/ change / destroy as you please, but i wanted there to be a sample in the
beginning
+ added a "Get Barley" quest and "Get Pen" quest as samples into the the
game

A Couple miscelaneous additions:
+ Added "help" information for players when they navigate the menu

A bug fix:
- A bug where selecting Items when there was no inventory has been fixed.
751ef19
@Bertram25
Valyria Tear member

Done with @IkarusDowned killer work :)

@Bertram25 Bertram25 closed this
@Bertram25 Bertram25 pushed a commit that referenced this issue
@IkarusDowned IkarusDowned Quest Log as refered to in #10 is added!
The total changes in this push:

+ Added Quest view in menu
+ Added scrolling of quests and viewing the description
+ Quets can be added based on user-preference directly from LUA code /
logic thanks to an AddQuest lua binding
+ Quests will grey-out when completed, and have a "!" on the left if you
have not read them yet
+ dat/config/quests.lua holds the quests. I have added a couple sample and
some "test" quests there and left them on purpose. You are welcome to add
/ change / destroy as you please, but i wanted there to be a sample in the
beginning
+ added a "Get Barley" quest and "Get Pen" quest as samples into the the
game

A Couple miscelaneous additions:
+ Added "help" information for players when they navigate the menu

A bug fix:
- A bug where selecting Items when there was no inventory has been fixed.
ff5cfd7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.