Making a Point and Click Adventure in Arcweave and Godot — Part 1: First Prototype and the Birth of a Plugin
How our project evolved and shaped the Arcweave plugin for Godot
You probably know the fabulous Godot game engine. You may even know our writing app, Arcweave. What you may not know is that we have just released a plugin for Godot, making integration between the two so much simpler.
Our plugin was under the covers for several months. Before releasing it, we wanted to test it by creating an actual game; a short demo that would showcase the ease with which you can use Arcweave to write, test, and export for Godot.
Requirements
In that demo game, everything having to do with writing would be done in Arcweave. Not only the dialogue trees and the replies, but also the logic had to be written in Arcweave, using variables and arcscript — Arcweave’s scripting language.
If there is a locked door and a check must take place, whether the player has the key, we would write that logic in Arcweave. Then, the logic had to be transferred to the game engine, along with all the other story content. The whole point is to decouple game writing from game development.
Moreover, we wanted to demonstrate how Arcweave can be used to create something different from the obvious choose-your-path experience we get in Arcweave’s play mode.
Therefore, we decided to create a point and click adventure. Something that would include enough game mechanics to show Arcweave can be used to create various genres, not only choose-your-path games.
In our game, the player navigates around the room following the mouse clicks, examines and takes objects, enters doors, has conversations with an NPC, and eventually completes the game and watches a simple finale.
The game is of course greatly inspired by the games of LucasArts, although the UI controls are greatly improvised.
Our first prototype
Element content, components, and image assets
Our first test was not a point and click. Unsurprisingly, we created a choose-your-path prototype, very much like a visual novel or Arcweave’s Play Mode itself: the player would read the content and click on options, while looking at images from the element’s cover and attached components.
It looked like this — with the wonderful art of Vaggelis Manousakas struggling to save the situation from the horrible UI:
We used the attached components to tell the game engine who the speaker is. In other words, the character delivering the line had to be a component attached to the element that contained the line.
No Logic
That first attempt was more than a year ago, when Arcweave’s only export option was a JSON file. Looking up content and following output connections using the JSON was easy.
What was not easy, though, was transferring logic from Arcweave to the engine. Whatever variables and conditional statements the project had, we had to do some serious thinking about ways to get them across the bridge, without driving people crazy.
Everything was — it still is — included in the JSON, of course. But an element’s content that looks like this:
… in the JSON looks like this:
"content": "<p>Yeah, why not. As long as you get out of my sight.<\/p><pre spellcheck=\"false\"><code>dragon_toenails = true<\/code><\/pre>"
One solution would be pretending to ignore the problem: give the game dev the JSON and let them parse and translate arcscript into GDScript or whatever other language they want. Get rid of the html tags, evaluate the expressions, and implore the writer to avoid using arcscript functions.
But that would have been just terrible. From our earliest discussions on the matter, we were against having the game dev do their own parsing. We had to find a way to make our users’ lives easier.
From JSON to Transpilation
Godot-Ready JSON
The next idea was to export an engine-specific JSON — in our case, a Godot-oriented JSON. Instead of getting an element’s content as a string, we would get a GDScript function.
This meant that an element content that looked like this (the example coming from our point and click game):
… in the Godot-oriented JSON it would look like this:
"content": "func content():\n\tvar contentResult: String = \"\"\n\tcontentResult += \"My reasons were not good enough. \"\n\treturn contentResult.trim_suffix(\" \")"
It looked even more chaotic than before — note that this example does not even contain any arcscript — but at least it was Godot-ready. Whatever the plugin would look like, it would have to load JSON’s content()
function to an instance of the GDScript class and evaluate it, getting in return the element's content, regardless of whether it included arcscript or not. We dealt with if-branches in a similar way.
The system worked and we built the first version of our point and click game with it. The logic came through; it was magical. We even implemented arcscript’s roll()
function. For the first time, we could write anything in Arcweave and get it across, to Godot.
But our dev team was itching to do better.
Transpilation upon export
Since we export for Godot, why even export to JSON? We can export .gd files, instead, ready to be used directly by the game engine and work organically with our plugin’s classes (Story, Board, Element, and Component).
This final version of the Arcweave plugin includes the static .gd files used by all projects, while Arcweave itself exports the project-dependent files data_export.gd
and state_export.gd
.
To export those, you go to Arcweave > Export > Game Engine > Godot. This saves a .zip file containing the files to be imported into the engine. It is the obvious, but not the only way.
Web API
Since Arcweave is a web app, why not use a web API? You can fetch the necessary project files straight into your Godot project, without even leaving the engine’s editor.
Suddenly, developing the game started becoming much more fun. The latest version of the project data gets passed straight from the source and on to Godot, by hitting “Refresh Project.” The writers do not have to send any project files to the dev and the team does not worry about which .zip contains the latest changes.
And so it happened. The plugin developed and our game developed with it. In the 2nd part of this series, we will talk about our quest for the dialogue’s starting element and how it evolved from a mundane iteration through element titles to something much more visual and user-friendly.
Until the next article in this series, you can find our plugin for Godot at its repository (with documentation) or the Godot Asset Library.
Play our point and click adventure demo Regrets on its itch.io page and download its source from its own repository.
For a simpler demo, why not try our Play Mode at Godot, which implements Arcweave’s play mode in a simple Godot project.
Finally, watch our Arcweave Integrations Series on YouTube, for a taste of how the plugin works.
And, of course, always… Let the games begin!