-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea: Bundle Yarn - a dialogue editor for interactive stories #511
Comments
I guess that if you can get the parsing done to JSON, it's easy then to manipulate this in Javascript and write a few conditions/actions to expose it to GDevelop :) The main thing to consider when wanting to "bundle" a software or feature like this is:
So enlarging the surface covered by a software like GDevelop is always tempting, but here I'm afraid that it will make things harder to maintain, especially if the other project is not evolving or used a lot. |
Feel free to make me reconsider things though :) But I think other part of GDevelop would need some love first. |
I can see the potential in this for making none linear dialogues but in case it is no longer maintained I don't think it worth it. It might be easy to hook it up to GD and read the texts from it, but in my opinion each scene should have it own Yarn editor so we can keep the dialogues separated for each scene, then we definitely need some dialogue events to kick off and switch between dialogues using a node name. For example I could have a dialogue to talk with Mark about picking the carrots then an other set of dialogue to talk to Mary about to feed the cows. When I talk to Mark or Mary, I need to be able to set which dialogue to start by entering the node name or something. Then I also need to be able to pass information to Yarn, because Mark want me to pick 10 carrots, but what if I have only 6 and I want a different Node to be triggered if I never talked to Mark, if I have 10 carrots or in case I talked to Mark but I have less than 10. The dialogue system need to process that and switch to the corresponding node. Finally, it should also display the dialogue and options to choose from, using the Text object would make it even more work. I think it should have it own text object with this node system in mind to display the text and options to choose from. Wondering if it would be the same effort to make one from scratch that integrates perfectly with the event system and create the dialogues directly in the events editor similar to how it works in RPG Maker. |
Hi, It is maintained, but not as often as Piskel is. The last update to the codebase was 2 months ago. I am actually thinking of making my own fork, since it required some changes to get it to work with electron. The main version was designed for nwjs, so I amended some code to port it over to electron on my build - get it to load and save files. I will try to get them to migrate the app to electron and see how that goes. I also added a new feature to make it easier to create links to other nodes: I added a few new features to the js parser to help my project a bit (bondage.js): So I am at a point where I have some understanding of both and am genuinely interested in using them both beyond my personal project. If you are interested in allowing to bundle it, I am vouching to help maintain the electron fork of yarn- hopefuly geting the original developer to migrate to it as well. In the last 10 years there has been no alternative to Yarn that is as good and simple as Yarn, while also being web based, open source and battle tested on released games. The goal with this is to make gdevelop a better tool for storytellers - on par with game maker and renpy Alot of the work to get it to work with Gdevelop has been done and tested on my project that is also electron based, but getting it to be userfriendly on gdevelop consists of also creating a new "Story scroll" behavior that prints and advances text from the yarn object, using bondage.js @ddabrahim you can check and set yarn story variables inside yarn- that makes it very easy to set what you require straight in it. |
I'm not a dialogs guy, but I would really like to know how GD events would look using this feature, which kind of conditions / actions are we talking about? |
In RPG Maker we can make dialogues using simple if-else statements right in the event editor but in RPG Maker each object has it own event sheet which make it more simple to keep it organised. in GD we can use external events in a similar fashion for dialogues, at the moment I'm not convinced if Yarn on it own would make a huge difference to be honest, except in case each scene would have it own instance of yarn. One way I could imagine the events with Yarn is to simply have an action to start a dialogue and pass a node name to it, For example StartDialogue("Mark") then it would get the instance of Yarn for the current scene and look for the Node "Mark". Once found the node, Yarn should compare the story variables then to see where are we in the story and kick off the corresponding node in the node tree of "Mark" and return the text. But, in my opinion it should not only return the text that we can display but it should also return the options and we should have a new text object dedicated for dialogues to do less condition checking manually and let the dialogue system do the heavy lifting. We would just write the dialogues in yarn, pick options, set values and the dialogue system should take care of the rest. |
@Lizard-13 The text contents - will be replaced by the yarn data resource's text during runtime. So they are updated by bondage.js technically- having the text scroll out of the box, All of the below could be set/get during runtime (via event sheet logic) or within the properties editor:
Only for the event sheet (conditions):
Only for the event sheet (Actions):
Basically we are exposing the functionality of bondage.js to gdevelop editor. Bondage.js is a library to communicate with and control yarn story objects. Setting and starting it is actually very similar to what @ddabrahim is describing. Its super easy, but very powerful/flexible So it's quite sweet in the end - because with very little work you can get an npc talking and storing your choices in the yarn data resource itself during runtime. The event sheet in general is only needed to set up how text scrolling is handled by input, or for special cases to trigger some sprite animation |
Update on this: I updated the first post to add a gif of it in action with some description. It still needs some polish, but its almost there now |
It is looking promissing actually. I did actually requested recently (yesterday) to make GD projects modular, instead of having everything stored in a single json file, would be better if the content would be divided in to separated modules/files. I don't expect this to happen overnight for the existing features but would be nice if we would go in to this modular direction with any new features from now on if possible. Thanks. |
A few idea/notes:
|
@4ian That is also an option :) We can just use the text object. But having a richtext label should be its own object imo- if that ever becomes available in gdevelop. |
If you guys are interested I can give it a go and make some pull requests - to integrate my electron ported yarn with new features and bondage.js into gdevelop - similar to how we did with piskel - but its actually much simpler this time. |
@4ian on game saving - bondage.js can interpret story data from standard json files or straight from an array. It has an online demo here: example files here It keeps track of user choices and that can also be exported/saved |
Yes the idea is to favor small reusable objects over a large "do-it-all" yarn specific objects that would be a pain to maintain and could not be reused for other creative things :) Before going any further, please remember that all of this is experimental and for now I don't plan to maintain it in the long term. This should still be considered as a third party extension should it be created (contrary to particles or Piskel, which I consider "officially" part of GD5 and maintained by me if necessary).
For now, you would need to add a folder with some C++ sources files in By "hacking" things into the runtime, I mean use an existing objects and tweak/modify it (maybe the text object ;)), and same for conditions/actions (try to find some that are not used a lot to do your tests).
use json - avoid specific format as much as possible |
@4ian another option is to use javascript straight in a gdevelop project and keep it separate- expose it that way. If that is planned, I will wait for it, before trying anything |
This is not planned for now as there was not much demand. I do agree that it would be great still :) So you can start with Javascript straight into a GDevelop project. Who knows, maybe we can innovate and see later how to package custom Javascript as modular "lightweight" extensions providing conditions/actions or even objects/behaviors. |
@4ian perhaps we should check on the community forum if people would like to see it in gdevelop? I will continue to develop it for my personal project and contribute to yarn's development anyways :) |
A dialogue system if done right would be definitely welcomed by the community, the trouble is, as long it doesn't cost money and got it for free I don't think anyone would say no for it but in case you want feedback I think you should try the forum, Not sure how many users are on GitHub. Considering GDevelop targeting people who don't know or don't want to code, my guess is that you find more users on the forum than here. Would be nice to see indeed a plugin system that would allow us to use JSON and JS to add new events, objects and behaviours maybe even expressions and even modify existing ones without need to recompile anything. This way, if people would like to play around with things don't need to worry about that the feature they are working on never going to make it in to a public release. Also in case multiple people would like to make their own implementation of the same feature, can do and people can choose which one is better. People could also make money by selling their plugins which would definitely also help to bring more devs to GD. An other note for the end, GD4 compatibility should be not a priority any more in my opinion. We have technically sacrificed years of work made by the community in forms of tutorials, documentations and examples in favour of a new IDE, new workflow, new design and better Linux and MacOS compatibility, Makes no sense in my opinion to try to keep compatibility between the two version under the hood. Anyway, Good luck I hope for the best. |
I think that a big part of both construct2 and clickteam fusion's success is due to the fact they have addon systems that are easy to develop for. Hell, their community could integrate a whole 3d engine in both - and those are proprietary apps |
Beware of the "feature creep", which is very easy to get as a developer or contributor: it means to always being added new features for the sake of "this would be nice if gdevelop could do xxx...". Don't be wrong here: the only thing GDevelop really need is new tutorials. (edit: I'm not even sure we can consider the MMF extension system as being "super easy to develop". They were successful because everybody know about it - while GDevelop is not advertised a lot). Don't get me wrong: contributions are super useful and I do hope to see again things like Piskel or all the contributions from other contributors recently. That's super cool. |
Also note that I say this because I was very focused when I was younger to add new features because it was cool. It was also a mistake. People do want new features, but first people need tutorials. Edit: the data are very clear. More than 50% of the feedback I get about GDevelop is "cool but where can I find tutorials?". More. than. 50% 😱 That's the reason behind my question at the beginning of the thread:
Even for Piskel, we almost have no mention of this on the wiki. We should at least have 4 or 5 different pages telling about this feature and how to use it!! :) (again that being said, I'm super open to new features like this one, just trying to find the right balance so that we're all successful in what we're doing for GDevelop :) I also don't want to discourage you or anything - just that we are all aligned about what is the current state of GDevelop and that we don't make false assumptions about success just because we do like something) |
@4ian One thing I was thinking about - if this gets more interest to integrate in the newIde - is to create a new example/template project for the newIde that demonstrates how to use Yarn in the context of a gd game. I was thinking of a small rpg game room where you walk around a village and talk to the npcs - demonstrating all the features of bondage.js Since rpg maker users are the main target demographic I want to lure to gdevelop- I will also make a video where I explain how the project is structured and how to create a new npc in the newIde - demonstrating how easy it is and how much better the story editor is. I didnt think that piskel in the context of gdevelop needs a tutorial, but it does need some coverage. The reason I mention the plugin system in other engines is to note that construct2 exposes the engine's ide to javascript and their addon system makes it easy to extend the engine without recompilation- thus why it has so many community made addons. But you are right, a big part of our problem is the lack of video tutorials on youtube for the newide. We need to come up with some sort of an initiative. One thing I would suggest is to put all demo games we have so far on itch.io - and put gdevelop's logo on the title/splash screen with a link to gdevelop. |
Yeah sure, that's a great idea! Let me know if you need anything.
Yes, I mean that's not even optional, it's a must have! Most people that want to try something new just launch the examples to see how it works. Having more examples would also be an easy way to improve GDevelop audience I think :)
I do agree that it's a good way to have more community made addons as it's more approachable. |
On the topic of examples - somebody has uploaded gdevelop examples on itch.io: But there are two problems with that :
We need to create an official presence on itch.io to help increase the user base imo |
I would be happy to help with examples, what do you think would attract new
users?
…On Sat, 9 Jun 2018, 10:34 am Todor Imreorov, ***@***.***> wrote:
On the topic of examples - somebody has uploaded gdevelop examples on
itch.io:
https://gametemplates.itch.io/gdevelop-examples
But there are two problems with that :
- They are not a part of an official gdevelop group
- They are not running embedded in the browser- so people can't get a
quick demonstration of gdevelop's capability.
We need to create an official presence on itch.io to help increase the
user base imo
Would you like me to create a gdevelop group? That is another way I can
help
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#511 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQ8mi9k2iJ2cBx16KKWQraAuwQvsmYkwks5t65algaJpZM4UX10x>
.
|
The only thing I don't understand what sort of tutorials would help? @4ian When you see people asking for tutorials, what sort of tutorials they would like to see? In the platformer and the tank shooter tutorial we have covered a lot. @zatsme I have shared tons of examples, no one cared to download them |
@zatsme More variety of 2d games running in the browser. and create a small game room, then uploaded it as a web game to itch.io with a zip file of the project of the game and a link to gdevelop in the description |
@ddabrahim it will help if you create an individual itch page for each example you have - embedded like this: |
@blurymind this is what I did. I was dedicated the itch.io page to GDevelop, Each example had it own page and I have also embeded the examples in to the page so people can try before download.. No one cared :( So I moved all the GD examples on to a single page, and now I decided to dedicate the pages to complete games only. But when I asked the community what sort of game they would be interested in, I got no answer... GD community simply has no use for examples the way I see it. Tutorials, step by step explanations maybe but there is all the basics explained in the platformer and tank shooter already. I have no idea what else to do... |
Strange, the script should copy recursively all JS files that are in |
It says But when I platest the game, the yarn folder is gone - it doesnt exist in |
Normally if you run
This should indicate that files are copied in C:\Users\blury\AppData\Local\Temp\preview
Yes it's normal as only the files that are needed by extensions are copied. Can you double check if you can have CopyRuntimeToGD.bat make the copy directly inside C:\Users\blury\AppData\Local\Temp\preview? |
Running this
Unfortunatelly when I playtest, gdevelop wipes them out, as it decides it doesnt need them So I guess the only way to include them is by writing an extension and recompiling gdjs? |
No need for this. Launch the preview, launch the script and reload the game (Open Developer tools in the preview and hit Ctrl+R). |
@4ian it works that way - but every time I launch the game I have to open developer tools,run the script and then update? :) |
Yes. Note that if you're working on JS files, you'll probably just end up launch the script, hitting Ctrl+R to see if it works, then do it again. If you want to export the game you have to manually copy |
Would be nice if we had some way of including js script files in the project and calling their methods inside the event sheet :D It would make the event sheet so much more hackable without need to recompiling .. |
There is something called |
I guess it would be a step towards having a more accessible js extension system that doesn't require any recompilation of gdjs :) You can already kind of access the runtime via the JS event. Add ability to include external js files and we can kind of do it in the event sheet. But the event sheet can not modify the editor itself. Godot engine does it in a very interesting way where anything inside project/addons/myaddon is automatically detected by the engine as an addon to interpret. But anyways- I am going offtopic with this :) |
@4ian That would be a quite useful feature. Specially if there are 5-6 line js functions which need to be called multiple times in a game then writing the whole thing in events editor multiple times isn't a very convenient option( I am currently facing this). Instead if there is an external js file where we write the function and just call it in javascript section in the events editor,then that is a better option. |
@4ian I can move this to a sepparate issue if you like the idea :) |
@blurymind Yes please do :) Please write something quite specific in this separate issue because it's still vague for me and I'm not sure we're all talking about the same thing. Also include precise examples of what it would help to achieve. I ask all of this to avoid feature creep - don't want to spend hours and hours working on something that will end up being too complicated and used by no one (which has been the case in the past for GDevelop 4).
Not sure if it's a problem. Events sheet are part of the game. It's not their role to be used to modify the editor. I think you're mixing your need of creating some new feature for the game with another need which is to be able to change the editor. |
@4ian I created it here: In any case, I am going to try to create a yarn extension by forking the shopify one. Hacking the index.html file is unsustainable imo |
Ok thanks :) I've answered on the thread. Hope I don't feel too harsh when reading me - it's not the case 😇 It's just that the issue is complex and we have to be VERY precise about what is really needed to avoid losing a huge amount of time into working on an extension system that will complexify the whole software. |
@4ian quick question - in my extension I want to point to a json file in the project folder path. Should I use a "string" parameter of the action? :) Also would you like me to submit the progress I make in the form of a pull request? Can I skip recompiling and copying If my only changes are to the js files somehow? If so , which js files should I edit for testing? Seems like a lot of steps between itteration |
Compiling GDevelop.js exposes the C++ extension code in the IDE, so the IDE knows about the actions, conditions and the .js files it has to export. If you'll modify the .js files only there is no need to recompile GDevelop.js (it just stores the filenames). |
@Lizard-13 thank you for explaining. So really recompiling gdjs is only required to register the actions/conditions in the editor? That means that after I get the c++ part right once, I no longer need to recompile it :) I think that we need better documentation on writing js extensions with the newide in mind, but I will try to stop requesting that and get on with getting this to work 👍 |
Yes and yes :) |
@4ian thank you for clarifying! But anyways, with this knowledge now, developing this as an extension doesnt seem that intimidating to me :) |
Some progress with this - it looks likely the electron port I made on Yarn will get merged - the reviewer has some notes that I will address tonight. I also got contacted by an Australian game developer interested in my work on porting yarn to electron. They said that they have also been working on a tool+parser similar to Yarn - using Reactjs. I think the intent was to steer me towards their project - as its overlapping with some of my goals: After a quick look at the source code and comits - their tool seems more advanced but less polished. Unfortunately due to its architecture - it would be harder to integrate and use in other projects.
The part of preparing yarn to bundle with other electron software is largely solved, now what is left is to do is write the extension to parse yarn files during runtime :) I wonder wether to keep the yarn data inside sepparate json files - to be used as a resource. Or should the yarn data be kept inside game objects. I really want to make this competitive with the popular rpg game maker engines for the storytelling aspect of it. Keeping it in external files will make games easier to translate to other languages, also allow for cleaner project tracking on github for gdevelop game projects using it |
Hey 👋 I've put this issue on the roadmap (so that anyone can vote for it!) there: https://trello.com/c/vcRqzoGk/74-bundle-yarn-a-dialogue-editor-for-interactive-stories I'm closing this issue as open issues on Github is now be dedicated to bugs only :) (But it's still possible to continue the discussion on this issue even if it's closed) |
I am getting a bit closer to making this a reality- recently added the missing parts to communicate between the yarn data and gdevelop.js to bondage.js - the parser. See: Now I need to also update the debugger I implemented in yarn-electron to display them - get that merged. Then see how to read/write to the runner state of bondage.js - for save/load game states After that is all done the next step is to try to write a yarn data parser for gdevelop.js that will use bondage.js |
I would certainly need a tutorial or more features in GDevelop to make story driven game. @blurymind could you please tell me what was the consensus on this matter? Would it be possible to have a simple system that fit in the GDevelop roadmap ? Are you making something as a tiers features maker that you would maintain ? Is GDevelop working on new features that would make it possible to develop narrative game ? Because, at this time, people have tried and it makes the event sheet a mess and it doesn't accomplish completely the goal : be able to make something like Night in the Wood with a lot of text and actions according to text conditions (click, store variable, input, character sprite animation according to line like line happy = sprite animation happy etc...). Maybe as Florian says, it just that there's no tutorial for such a game or maybe GDevelop needs some new features. Let me know your thought on this @blurymind and @4ian please :) |
The main element required to do this is not Yarn itself. I can add yarn's editor to gdevelop in a weekend. It's the runtime parser that parses the yarn file during the game's execution. Unity has such a parser and it's called yarn spinner. It's what was used for Night in the Woods. Now, there is a parser written in javascript. It's a parser that I have even contributed some code to - in order to make it more flexible. I have used that parser both on a personal project and inside Yarn itself - to preview stories in Yarn-electron. It's called Bondage.js. So the only option is really to write it as a pure js extension - not using the new behaviours and in it to import bondage.js and create a wrapper for it to communicate with GD. This is the exact same blocking issue for mod files and bundling bassoon tracker with GD. I have no way of actually treating the mod files as a new resource and read them during gameplay. When I figure out how to do that on some weekend and have the yarn json data parsed inside a GD game, then I will bundle Yarn with GD and it will be super easy to make story driven games in GD. To add to all this- there is another problem to overcome. Gdevelop can not treat json files as a resource. This means that all the yarn data you write will have to be stored as metadata inside project.json. Until then, you have to do it with what's available. You can still make a story type game in GD, you will just have to do it from scratch with the event sheet. |
@blurymind You can still write a classic JavaScript extension and include the library file right? For JSON, it's true that it's hard to add them in the file resources, but if you work around this (by for example, pasting the JSON in a JS event to use it), I'm happy to help adding some capabilities to avoid this work around. :) |
Hi. @4ian I aggree, a feature must be added if it used by many. As a user i love GDevelop for its approach on game development but when it comes to make dialogs for story driven narrative game with conditions, variables and actions based on user clicks to display lines that condition the display of sprites and events before, during and after a line, like some narrative game engine do, it's very difficult and the event sheet can become a mess for a complete narrative game. I think the work around for this is to produce an example of a powerful dialog system with new GD core features if necessary working along with an extension if needed to make something working for any dialog based game/scene like adventure game, rpg game, visual novel games etc... But i think a powerful dialog system will be a great attractive feature for people like me who want to add complex narrative scenes in their game. Some one helped me on the french community forum with a dialog example. If @4ian could check here. It does basically a small percentage of what i need but it seems to me very complex to work with for a entire game. In the example the condition for the dialog to appear is when the player collide with a png, but sometime you just want the condition to be a click on space key, and actions should be fired line after line like following a series of line > actions > line > action > line etc.... So, that was just to say that if @blurymind solution can improve productivity for dialog based games on GD, it would be so cool ! |
Description
Stories,often told through text are a very common thing in games. Especially indie games- be it rpg, action rpg, visual novels or even simple platformers. This is so common that every time I start writing my own dialogue/story system- it feels like I am reinventing the wheel rather than making my game fun.
Some engines are built for telling stories- the rpg maker engines (http://www.rpgmakerweb.com/) for example are very popular for that reason. But so is renpy (https://www.renpy.org/) and others like twinery (http://twinery.org/)
They all have very vibrant communities, full of creative people with stories to tell
Looking at gdevelop- its a very good and user friendly engine- but it doesnt have a strong storytelling toolset like the others listed. The user has to do a lot of work to create and manage a dialogue tree system and the editor has no tools to write non linear stories
Solution suggested
A few years ago I discovered YARN - a story system and editor already used on some commercially successful games:
![welcome-1](https://user-images.githubusercontent.com/6495061/40880851-9c6217c0-66b0-11e8-920a-14a4a2380183.jpg)
https://github.com/InfiniteAmmoInc/Yarn
The yarn editor is all web based, very tiny (500 kb) and super easy to use. Its written in javascript/nodejs and the story files it outputs are simple json format.
Now the editor hasnt seen much updates officially, but the indie game community has been quietly using it on more and more games-focusing more on developing more implementations of the story parser.
While the official yarn story parser was written for the Unity3d engine, recently I found out that somebody has rewritten it in js and released it as an npm package here:
![screenshot2](https://user-images.githubusercontent.com/6495061/40880854-aa724060-66b0-11e8-95c7-c2ebf71bd757.png)
https://www.npmjs.com/package/bondage
There is already an npm library that interprets yarn story files that we can use - bondage.js. I was able to succesfully integrate it with yarn itself and add the capability to test the story
https://github.com/jhayley/bondage.js
The library takes care of remembering user made choices (storing and checking yarn variables without leaving yarn or having to write event sheet logic in gdevelop)
![yarnrunner](https://user-images.githubusercontent.com/6495061/41129474-0aeddef2-6aaa-11e8-87f0-d7e1873130e6.gif)
I added text scrolling and support for bbcode ontop of it. My code is embeddable, so in theory should be easy to integrate into gdevelop as well. The only bulk of the job is exposing all of this to gdevelop as an object and event sheet actions/conditions to trigger it.
My suggestion is to bundle Yarn editor and the bondage.js yarn story parser with gdevelop. It will make creation of story based games much easier on gdevelop.
The reason I am suggesting it is that I already had looked into its source code and ported Yarn to electron for another personal project that integrates it with three.js :p
The question is - is there any interest in having Yarn bundled with gdevelop? I know it's kind of becoming my shtick to glue open source projects recently, but after playing some of the games made with Yarn editor and using it myself - I definitely see a lot of value in it. It might help us attract some twinery users to gdevelop imo
What would be hard and new for me in the case is implementing a yarn parser behavior for gdevelop - to print out text on the screen. I am not sure how this is done and would appreciate any examples or code that might help me understand this :)
Getting yarn editor itself inside gdevelop and have it communicate with gdevelop would be easy- as I already know how to do that.
In any case, are you interested in this? Without approval from @4ian I wont even attempt it
The text was updated successfully, but these errors were encountered: