Working on IF Engine (Dragonfly)

Hello!
I’m Javier Candales (Jasón).
I’m currently working on a conversational interactive fiction engine called Dragonfly. It has its own simple and easy-to-understand language.
It’s browser-oriented, and you can use a local server to run games offline. I’ll go into more detail about that later.
Over time, I’ll be adding more features and demos. For now, it includes a sample and tutorials covering all the elements of a game, from events and actions to doors and darkness.
The engine is designed to support multiple languages and currently supports English and Spanish.

Dragonfly link:

Everyone is welcome, including issues and pull requests.
Thanks and best regards!

5 Likes

Hello Javier, welcome to the forum!

I took a short look and saw that your system provides parser-based gameplay. There’s a small example game in our community, called “Cloak of Darkness”, which has been ported to several development systems/languages. The idea is to be able to compare at a glance how to implement some common text adventure concepts in each language, and to get a quick impression what the syntax looks like.

If you’d like to, maybe you could port that game to your system, too, and post the source code in this thread.

Here are some links to the code for various systems, for example Inform 6 and 7, and a transcript of a playthrough.

More recently, Ryan Veeder’s “Craverly Heights” was also ported to several languages; here’s an overview page and a side-by-side comparison of the Inform 7 and Dialog versions.


Since there are several very good systems for IF game development already, it can be difficult to get people interested in a new engine.

Much of the attention in the community centers on competitions and game jams, so if you’d like to, you could consider writing a story in your system for one of those events, to get feedback on how well it works for players. Ideally, you’ll want to get beta-testers and try to publish a really solid, enjoyable game. If it’s well-received, then chances are that people will also be interested in how to use your engine to develop such a game, and you can write an accompanying tutorial, for example (in addition to the existing tutorials).

Here’s a list of events with further links: Event news - IFWiki.
I think the next upcoming comps are the Text Adventure Literacy Jam (though the time frame from now is probably too short to develop an entry from scratch), IntroComp (could be a good fit), ParserComp (could be a good fit), IFComp (biggest comp, most attention, toughest judging), and EctoComp (for horror-themed games).


By the way, there seems to be a bug in the current version of the Forest example game, whereby the “examine me”-response is printed before every “examine”-response:

> x trees

A curious adventurer, ready to explore the world around me.

The ancient trees stretch high above, their thick trunks partially covered in moss.

> x me

A curious adventurer, ready to explore the world around me.

A curious adventurer, ready to explore the world around me.


Thanks for presenting your system, and good luck!

5 Likes

Hi Javier, thanks for sharing your project.

I had some trouble getting started. I downloaded your git repo, but your setup instructions shows me a directory listing.

python3 -m http.server

Directory listing for /



Typically for a git repo I would expect to find a package.json containing project metadata, including shortcuts to run whatever local dev scripts are needed.

I found this url in your README.md but got a browser error trying to view it in Firefox:

Loading module from “https://jason80.github.io/dragonfly/base/output.js” was blocked because of a disallowed MIME type (“text/html”).

I tried it in Safari, where it worked. It seems like your basic parsing works - I can x things, move around, that’s good.

I found some parser irregularities:

The leaves cover the ground, crunching under your feet as you walk.
> dig in leaves
> dig leaves
You don't know what you are saying.
>
You don't know what you are saying.

I got no response to “dig in leaves” and then double responses to “dig leaves”.

When I was trying to copy text to paste here for example, I found that the page is insisting on keeping focus on the text input, which prevents users from selecting text on the page. I understand why you’d want to keep focus on the input, so the user can always type, but that piece might benefit from a rethink - perhaps reset focus on keydown.

More parser irregularities. I got no response to “listen to creek” (or even “listen creek”).

To the south, you can hear the soft sound of a creek.
> listen to creek
>

I can’t examine the creek, I guess because it’s in the next room, though it is mentioned in this room.

> x creek
There is none of that.

I get no response to “enter log”.

An old hollow log lies near the creek, its bark weathered and dark.
> enter log
>

When no response is given, the parser provides a new input line out of order, and then there’s some irregularities about how the parser handles text following the next input. Here, “enter log” left me with a blank input line followed by “You don’t know what you are saying.” and then when I typed “look in log” the lockpick text followed.

You can't take the hollow log.
> enter log
> look in log
You don't know what you are saying.
Inside there is: a lockpick.

But I can’t take the lockpick.

I guess there’s a combination of things going on - some issues with the parser, some issues with the particular game file. It seems like the parser has no response to verbs it doesn’t know.

> take lockpick
There is none of that.
> hit log
> Nothing happens.
> Kick log.
> 

Similarly, I can’t get into the cabin.

> enter cabin
>
You don't know what you are saying.
> go in cabin
>
> go cabin
> 
>
> unlock cabin
>

It seems like a nice start, and I’m impressed that you’re working with multiple languages.

4 Likes

Hi, StJohnLimbo. Thanks for the welcome.

And thanks for the info.

I really value it: I’m in a situation where everything feels brand new to me. I’ve only played a few random adventures here and there in Spanish. I don’t know if it was a mistake, but I was so fascinated by the mechanics of parser-based games that I just dove right in and started programming an engine.

Knowing me, it won’t be long before I port that game, along with several samples that will be published.

That’s the plan. I’m working on a long-form game called “Mi Sombrero” (My Hat). I’m short on time, but I hope to share some updates at some point.

The fix for that error in the ExamineObject action—specifically regarding when the event is sent to the player—will be included in the next minor release. Additionally, if you describe your player, your code will look like this:

describe-object() {
   if-direct-equals(instance: "-player") {
      "A curious adventurer, ready to explore the world around me."
   }
}

The examples will, of course, be updated.

Best regards!!

1 Like

Hi, Ivan:

Thanks for the issues: you have no idea how much they help the project grow, even though it’s still in the early stages.

For the time being, it is highly recommended that you set up a Live Server using VS Code by navigating to the .html file of the sample you want to test.

In the not-too-distant future, I’ll be adding instructions to the README on how to run the samples by cloning the project.

That’s strange… I’m going to test it with more browsers and across different operating systems.

Verbs and Actions:

As for the rest of the issues, you’re right. There is a bug in the UnknownVerb action that is causing it to fail. It will be fixed in the next minor release.

A typical issue with my fledgling engine is the lack of actions. I’ll be adding them one by one, along with their respective verbs. Don’t ever stop bringing them up to me. It’s incredibly helpful, and I’m adding them as we go!

Yeah, it’s not in the current room. Conceptual errors in the samples will also be fixed.

Yeah, it’s related to the UnknownVerb error.

Thanks!! I also thought it was ambitious; I bet on making it template-based.

Again: it’s incredibly helpful when people point out bugs to me. You’re more than welcome to leave issues and open a PR on GitHub.

1 Like