Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (748)
Games in Android Showcase (226)
games submitted by our members
Games in WIP (834)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  LibGDX Yarn Interactive Dialogues!  (Read 568 times)
0 Members and 1 Guest are viewing this topic.
Offline Kyperbelt
« Posted 2018-02-09 19:29:59 »

Just to clarify: This is a lib for creating interactive dialogues(conversations);

Yo!

Recently while working on a project I was searching for a way to create dialogues using a third party tool and then import them into my game. I came across a  really cool language/tool called Yarn. This is the same tool used for games like Night in the Woods and Knights and Bikes.

It checked out everything I was looking for, and then some:
  • Easy Syntax
  • Branching Node based Dialogue
  • Conditional Statements(e.g <<if visited() >> do this line<<else>>do this<<endif>>)
  • Variable Continuity
  • Very Extensible


I created a port of an existing Yarn library for use with libgdx projects.

Here is a link to the YarnGDX github


Here is a link to Short Demo.

Its still not perfect , but currently gets the job done. I am trying to add documentation whenever i get the change but there is basic stuff in the getting started and also a simple example Test Class.

Hope someone finds it useful Smiley
Offline zngga
« Reply #1 - Posted 2018-02-10 19:16:28 »

This is interesting. I am currently trying to do dialogs as well, GLFW doesn't support dialogs (or any model / child windows for that matter) yet. I am not using libGDX, do you think this would be a non trivial thing to integrate directly with LWJGL?

My code never has bugs... it just develops unexpected features!
Offline Kyperbelt
« Reply #2 - Posted 2018-02-10 22:36:23 »

I think all it would entail is switching all the libgdx classes like Array - ObjectMap ect. to Your own implementation or java's implementation like ArrayList and HashMap(althought i dont think these are as good for gamedev as the optimized libgdx versions). Ill put this in my todo list - to decouple libgdx and create my own set of similar collections classes.


EDIT:

This is interesting. I am currently trying to do dialogs as well, GLFW doesn't support dialogs (or any model / child windows for that matter) yet. I am not using libGDX, do you think this would be a non trivial thing to integrate directly with LWJGL?

I just re-read your post. Im afraid this is not a graphic "dialog" library but instead a library for creating interactive dialogues(the conversation type) . Sorry if there was any confusion.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline zngga
« Reply #3 - Posted 2018-02-11 14:52:38 »

I suppose I could have clicked your demo link, I feel dumb. lol

My code never has bugs... it just develops unexpected features!
Offline Kyperbelt
« Reply #4 - Posted 2018-02-11 18:29:55 »

I suppose I could have clicked your demo link, I feel dumb. lol

haha no man, dont feel dumb. I only added the demo link after I replied to you; to avoid further confusion Smiley
Offline zngga
« Reply #5 - Posted 2018-02-11 18:33:33 »

Oh! haha! Well, less dumb now!

So are you working on something that needs this? RPG or something?

My code never has bugs... it just develops unexpected features!
Offline Kyperbelt
« Reply #6 - Posted 2018-02-11 20:57:08 »

Yes i am working on a game that has a narrative and i wanted to make sure i had the tools for better workflow. I could have just written everything in code but then it would become very hard to change or scale it in the future.

YarnGdx can be used for much more than dialogues though since it does provide an extensible scripting platform. You can create "Functions" in java and add them to the Dialogue library and in your scripts you can call on those functions. The possibilities are endless.

Ill be adding more documentation to the wiki as soon as i am able. Smiley
Offline unenergizer

Junior Devvie


Medals: 3
Exp: 5 years


Work hard, practice often, and you will succeed!


« Reply #7 - Posted 2018-02-12 17:06:03 »

Project looks great!

I have a question though. If making a RPG game with this with a lot of tree's, does the code and variable tracking become overwhelming long?  Looking forward to seeing more of it and possible a clean solution to implementing a system with a big story.

JGO is AMAZING!
Steam: unenergizer
Offline zngga
« Reply #8 - Posted 2018-02-12 18:15:43 »

What they said ^

This looks like it has a ton of potential!

My code never has bugs... it just develops unexpected features!
Offline Kyperbelt
« Reply #9 - Posted 2018-02-12 23:35:27 »

Project looks great!

I have a question though. If making a RPG game with this with a lot of tree's, does the code and variable tracking become overwhelming long?  Looking forward to seeing more of it and possible a clean solution to implementing a system with a big story.

So basically right now the dialogue loads all your nodes and parses them - you then call a start("nameofnode") method and you can specify what node to start from("Start" by default). You then step through the dialogue by consuming results with the dialogue.getNext() method kind of like an iterator. These results are things like your Lines/custom commands/options(these link to other nodes which can be in the same file) ect.

I could go into more depth which i think ill save for the wiki(unless requested here) , but basically once you implement the dialogue into your game and are able to read the results - it becomes really easy and scale-able.

The Variable continuity that comes with the lib comes with built in functions so that you can serialize it into a json string: this makes it easy to save it. Also you may use the same variable continuity for different dialogues so you could make the continuity a global variable that you access from anywhere in your game that your dialogues interact with.

To clarify: all the variable continuity is(UserData.java) , is a <String,Value> object set(objectmap).


TLDR: Keeping track of your variables should not be an issue - i think the hardest part will be implementing it to fit your needs and then its just a matter of loading your dialogues and using the results. Saving the variables is really easy with the toJson(), and fromJson() methods; and you can use the same variable storage for multiple dialogues.

Hope that cleared some stuff up.
Feel free to ask any more questions i am happy to help Smiley
Pages: [1]
  ignore  |  Print  
 
 

 
xxMrPHDxx (306 views)
2017-12-31 17:17:51

xxMrPHDxx (94 views)
2017-12-31 17:15:51

xxMrPHDxx (146 views)
2017-12-28 18:11:33

Ecumene (310 views)
2017-09-30 02:57:34

theagentd (492 views)
2017-09-26 18:23:31

cybrmynd (528 views)
2017-08-02 12:28:51

cybrmynd (463 views)
2017-08-02 12:19:43

cybrmynd (446 views)
2017-08-02 12:18:09

Sralse (405 views)
2017-07-25 17:13:48

Archive (1312 views)
2017-04-27 17:45:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!