Monika-After-Story / MonikaModDev

DDLC fan mod to extend Monika
http://www.monikaafterstory.com/
Other
1.18k stars 685 forks source link

Much more dialog and stories very quickly. Let me know what you think. #10015

Open Delcos opened 1 year ago

Delcos commented 1 year ago

I trained an LLM of my own on this project and all of the dialog from the game and this mod, and now it can not only write dialog but in the code form needed. This is also viable for whatever else related to this project and can generate new idle dialog or whatever at around one set of new dialog ever 20 seconds or so. From testing they all stay thematically correct which is expected since that relies on the people here being a good source of data. Let me know what you think.



init 5 python:
    addEvent(
        Event(
            persistent._mas_story_database,
            eventlabel="mas_story_cavern",
            prompt="The Explorer and the Cavern",
            category=[mas_stories.TYPE_NORMAL],
            unlocked=False
        ),
        code="STY"
    )

label mas_story_cavern:
    call mas_story_begin
    m 1eua "In a land far from ours, lived an Explorer known for his relentless curiosity."
    m 1eub "One day, he stumbled upon a cavern, standing solitary in a vast barren landscape."
    m 2euc "An intense darkness shrouded the cavern, so he lit his lantern and proceeded with caution."
    m 2rksdlc "The deeper he went, the more unusual things became. He saw structures that seemed man-made, yet he knew no man could have reached this place."
    m 3eud "Then, he came upon a lake, clear as crystal, in which he could see his own reflection. However, the reflection in the water was not of the man he once was, but an older version of himself."
    m 3esd "He realized then, that this cavern was not just a physical space, but a journey into his inner self."
    m 1euc "Every step he took deeper into the cavern, he was delving deeper into his consciousness and understanding aspects of his life better."
    m 2ekd "The structures represented his built-up defenses and fears, and the lake reflected not his physical appearance, but the maturity of his soul."
    m 1eub "The moral of the story, [player], is that sometimes the answers we seek in the external world, actually lie within us."
    m 3hksdlb "And it takes the courage to delve into our inner selves, confronting our fears and insecurities, to truly grow as individuals."
    m 1rksdla "But remember, [player]...{w=0.5}always carry a light in the darkness. Even if that light is just hope."
    m 3hua "That was quite the journey, wasn't it? I hope you enjoyed it as much as I did."
    return

init 5 python:
    addEvent(
        Event(
            persistent._mas_story_database,
            eventlabel="mas_story_the_lion_and_the_mouse",
            prompt="The Lion and the Mouse",
            category=[mas_stories.TYPE_NORMAL],
            unlocked=False
        ),
        code="STY"
    )

label mas_story_the_lion_and_the_mouse:
    call mas_story_begin
    m 1eua "Once upon a time, a mighty lion was resting, when a little mouse disturbed him."
    m 1tfb "The lion caught the mouse, who begged for his life, promising to repay the lion's mercy in future."
    m 1hksdrb "The lion laughed and let the mouse go."
    m 3eud "One day, the lion was caught in a hunter's trap. The mouse, hearing his roars, gnawed through the ropes and freed the lion."
    m 3hua "The moral of this story is, even the smallest can help the mightiest."
    m 1hub "I hope you liked the story, [player]~"
    return

init 5 python:
    addEvent(
        Event(
            persistent._mas_story_database,
            eventlabel="mas_story_the_boy_who_cried_wolf",
            prompt="The Boy Who Cried Wolf",
            category=[mas_stories.TYPE_NORMAL],
            unlocked=False
        ),
        code="STY"
    )

label mas_story_the_boy_who_cried_wolf:
    call mas_story_begin
    m 1eua "There was once a boy who was bored as he sat on the hillside watching the village sheep."
    m 1euc "To amuse himself he took a great breath and sang out, 'Wolf! Wolf!'"
    m 3eud "The villagers came running up the hill to help the boy drive the wolf away. But when they arrived, they found no wolf."
    m 1tfb "The boy laughed at the sight of their angry faces."
    m 3hksdlb "Then one day, a wolf really did come, and the boy cried out 'Wolf!', but the villagers didn't come."
    m 3eua "The moral of this story is, nobody believes a liar, even when he is telling the truth."
    m 1hub "I hope you enjoyed the story, [player]!"
    return

init 5 python:
    addEvent(
        Event(
            persistent._mas_story_database,
            eventlabel="mas_story_the_clever_fox",
            prompt="The Clever Fox",
            category=[mas_stories.TYPE_NORMAL],
            unlocked=False
        ),
        code="STY"
    )
multimokia commented 1 year ago

While this is cool and all, ultimately it has a similar problem to a discussion we had with another user in the past -- namely that this would serve mainly as a decent brainstorming tool and not too much more, since it's all code that needs to be compiled instead of being able to interpret and inject on the fly cleanly.

Likewise without direct access to the model, this is less useful as we'd constantly need to run things through another to get more results which may be more hassle than its worth as it effectively puts you as a middleman. With all respect this isn't something we are interested in.

Furthermore, how competent is the model when generating basic topics or songs? Is it only trained on story code or is there more to it?

Booplicate commented 1 year ago

Did it generate the expressions a well or did you add them after?

Delcos commented 1 year ago

Did it generate the expressions a well or did you add them after?

Everything in the code snippet is generated.

Delcos commented 1 year ago

It's a 30b model so it is very competent at anything related to this mod. It could rewrite the entire thing right now, the only reason I only used parts for this post is the length but it would be more than able to generate whatever. The thought would be not to have it used all the time but just let it generate hundreds or thousands of lines for something like idle dialog, then it looks through and picks out the best 100-200 and could then add them or expand on them, etc. You can also add whatever topics and just tell the model what sorts of stories, idle dialog, tone, etc and it'' change accordingly.

Delcos commented 1 year ago

While this is cool and all, ultimately it has a similar problem to a discussion we had with another user in the past -- namely that this would serve mainly as a decent brainstorming tool and not too much more, since it's all code that needs to be compiled instead of being able to interpret and inject on the fly cleanly.

Likewise without direct access to the model, this is less useful as we'd constantly need to run things through another to get more results which may be more hassle than its worth as it effectively puts you as a middleman. With all respect this isn't something we are interested in.

Furthermore, how competent is the model when generating basic topics or songs? Is it only trained on story code or is there more to it?

The above was for you sorry, it didn't' tag.

Booplicate commented 1 year ago

Neural networks isn't my specialisation, say, can this model remember the context? For how long if so? How do you see it being used, as what the process would be like if we wanted to make a new topic? Can this model hallucinate? What are the chances?

I'm not so much interested in code generation as having good dialogue and expressions. I ran through the dialogues you provided, generally impressive and I'd say it's not bad. I do have a few things to point out. The expressions look off and they violate some of the rules we use when choosing the expressions. The dialogue itself felt a bit rushed, like if she tried to tell the story in one minute. I'd change some wording here and there, but I'm not a writer, generally she didn't sound bad. Those 2 things would require manual edits, which restricts its usefulness. Although, I believe the expression issue could be fixed if the model respected both previous and next expressions.

I also noticed that it generated the story we already have - your mas_story_the_boy_who_cried_wolf is our mas_story_lies, and it can be both good and bad, depending on the use case. If you want to use it to generate new conversations, it wouldn't really work. I'll also point out that your version is shorted than the original story, and I think it cut important context.

Another thing to remember about, topics consist of more than just init code and the label, we often include python and renpy code in the events, and I don't trust a neural network to write code (especially when it's in the context of MAS/renpy).

Delcos commented 1 year ago

Neural networks isn't my specialisation, say, can this model remember the context? For how long if so? How do you see it being used, as what the process would be like if we wanted to make a new topic? Can this model hallucinate? What are the chances?

I'm not so much interested in code generation as having good dialogue and expressions. I ran through the dialogues you provided, generally impressive and I'd say it's not bad. I do have a few things to point out. The expressions look off and they violate some of the rules we use when choosing the expressions. The dialogue itself felt a bit rushed, like if she tried to tell the story in one minute. I'd change some wording here and there, but I'm not a writer, generally she didn't sound bad. Those 2 things would require manual edits, which restricts its usefulness. Although, I believe the expression issue could be fixed if the model respected both previous and next expressions.

I also noticed that it generated the story we already have - your mas_story_the_boy_who_cried_wolf is our mas_story_lies, and it can be both good and bad, depending on the use case. If you want to use it to generate new conversations, it wouldn't really work. I'll also point out that your version is shorted than the original story, and I think it cut important context.

Another thing to remember about, topics consist of more than just init code and the label, we often include python and renpy code in the events, and I don't trust a neural network to write code (especially when it's in the context of MAS/renpy).

Any rules for dialog can be left here in plane english instructions and I can just tell it to keep that in mind. It can also generate just dialog much faster so if that could just be stored in a google doc and then whenever a new topic whatever was needed it could be referenced.

multimokia commented 1 year ago

Given the current dev team, it's most likely the model would be used exclusively for brainstorming ideas or getting a baseline on a new topic which would then undergo additions to suit the needs. Outside of that I don't think we'd really make use of it, much less so without a copy of the model to run ourselves.

Simply put we're not interested in going through another party.

Delcos commented 1 year ago

Given the current dev team, it's most likely the model would be used exclusively for brainstorming ideas or getting a baseline on a new topic which would then undergo additions to suit the needs. Outside of that I don't think we'd really make use of it, much less so without a copy of the model to run ourselves.

Simply put we're not interested in going through another party.

I dont plan on keeping it. It's a huge model that I'm not dedicating a data center GPU to. The thought would be to let it generate a set of each, so stories, idle, etc, a few hundred of each and then just have a text file/docs/whatever else as a one time directory. Think of it as an offer for me to pre-write you thousands of lines of dialogue and not offering an AI for the community.

multimokia commented 1 year ago

I mean, chances are some of us could potentially run it locally or spin it up as needed rather than needing a whole datacenter, even if slow it's easier for us to do than have to keep up with a member who is outside the dev team and may not always be around. Likewise given the nature of our use, a one time approach simply doesn't work for us.

Of course I completely understand you not wanting to keep a model with this use in mind on a data-center GPU as that incurrs costs that can be better spent elsewhere -- That's the last thing we want to ask of you.

In short, if you were willing to share the model in terms of its checkpoints/etc., that would be the most beneficial approach. If not, no big deal.

Delcos commented 1 year ago

I mean, chances are some of us could potentially run it locally or spin it up as needed rather than needing a whole datacenter, even if slow it's easier for us to do than have to keep up with a member who is outside the dev team and may not always be around. Likewise given the nature of our use, a one time approach simply doesn't work for us.

Of course I completely understand you not wanting to keep a model with this use in mind on a data-center GPU as that incurrs costs that can be better spent elsewhere -- That's the last thing we want to ask of you.

In short, if you were willing to share the model in terms of its checkpoints/etc., that would be the most beneficial approach. If not, no big deal.

If having a model released is actually something of interest I can just train a lora on the dialogue I have from the mod and you could use it with something like WizardLM-7b-uncensored which is a pretty common one. The reason for the scale I used is because since it was meant to be left alone it needed to be almost perfect but if someone's actually sitting there to generate it then that shouldn't be too much of an issue.

9a9o commented 10 months ago

Hi, is there any update to this? Was any lora developed, or model released?