Storylets and Love2d

Showcase your libraries, tools and other projects that help your fellow love users.
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Storylets and Love2d

Post by pauljessup »

Was wondering if anyone has already built an engine/library/module for using storylets in Love2d...

I was thinking about using something similar to storylets in my upcoming game Monster Heart. Basically, I wanted a dynamic narrative that would evolve and react to the player's actions and various world states. I was thinking something like, the player and NPC's all have variables that hold both overall story position (chapter, etc), as well as character emotional states, subplots, and various events and happenings (a new monster arrives at the island, it's raining, the player's character hasn't gotten enough sleep this week), and that it would also effect the player's response texts and game choices in conversations.

Realizing someone else had probably already done this, I took a look around and discovered the idea of storylets. It's mostly in use in the interactive fiction community, so there are a lot of Inform, AGS, and Twine extensions and modules that do this, but I wasn't sure if anyone had done something similar already in Love2d...

My meager searches around the net and the forum haven't really led to any results. Just wondering if anyone here has seen anything like that...

If not, I'll end up building a general use one for myself that I'll probably post around here.
User avatar
dusoft
Party member
Posts: 635
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Storylets and Love2d

Post by dusoft »

I am not aware of such lib, but try here:
https://github.com/love2d-community/awesome-love2d
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Re: Storylets and Love2d

Post by pauljessup »

Thanks! I looked through it, nothing that is specifically made to do this, but I think I can combine a few modules to get the effect I need.
User avatar
dusoft
Party member
Posts: 635
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Storylets and Love2d

Post by dusoft »

pauljessup wrote: Fri Feb 03, 2023 4:28 pm Thanks! I looked through it, nothing that is specifically made to do this, but I think I can combine a few modules to get the effect I need.
Sure, don't forget to share / post on Github, if you feel it can be useful to others.
User avatar
Nikki
Citizen
Posts: 86
Joined: Wed Jan 25, 2017 5:42 pm

Re: Storylets and Love2d

Post by Nikki »

Nice, I had never heard of the term 'storylet' before, seems like a nice solution.
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Re: Storylets and Love2d

Post by pauljessup »

Hey, yeah! That was the Emily Short blog that led me down the storylet rabbithole. It is a nice solution, I'm still working on it, getting it to fire off different storylets based on various world variables/stats/etc. It's kind of interesting and robust. Right now, my code is pretty much for this engine only, not sure if it would work if I moved it outside for others to use as a library/module. But maybe in the future I can abstract it enough for any Love or Lua users
tourgen
Citizen
Posts: 53
Joined: Sat Mar 18, 2023 12:45 am

Re: Storylets and Love2d

Post by tourgen »

I'm not exactly clear on storylets. Is the basic concept not to use a rigid tree structure to store and progress a story, but to present events based on a 'soup' of various variables stored in player and world state?
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Re: Storylets and Love2d

Post by pauljessup »

Yes, so it's basically a systemic, open world style of game but applied to narrative. It allows you to co-create a story with the player based on player's actions in worlds, rather than a simple dialogue tree.

So, for example, it's raining, the character visits the ruins, an NPC is only there, when it rains, and thus it changes the interaction. If the player was mean to the character or nice in the past, it will change the interaction, etc. All of these interactions add up to little stories that can interweave with each other, and make for interesting, surprising narratives, with some even being unplanned by the game creator.
tourgen
Citizen
Posts: 53
Joined: Sat Mar 18, 2023 12:45 am

Re: Storylets and Love2d

Post by tourgen »

OK, I think I understand. I'm thinking about implementation details too, of course.

So NPCs respond to a limited set of world state variables, and what they say is selected based on the NPC's internal state as well as these external 'world state' variables, and not a pre-defined dialog tree of responses. So I suppose part of the NPC's internal state could track your conversation so far, and so a loosely-defined dialog tree could also be implemented in this system. or a collection of small, fragmented dialog trees depending on world state.
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Re: Storylets and Love2d

Post by pauljessup »

Sort of, it's kind of like breaking away from dialogue trees, and think about it more like firing events like in Visual C++. So, according world states, a story event happens in the background, and then effects the NPC and how they speak to the player, but also, how the player's dialogue choices appear as well. It can create some interesting stuff,and even have interacting/overlapping stories that the player experiences that you probably didn't even plan.

The downside is, there is a bit more writing (though not as much with dialogue trees, which can get messy and spiral out of control very easily) and there might be quite a few things that you put into the game that a player doesn't experience. I know some devs don't like that last bit, personally I don't mind. I think it makes each experience special to the player.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests