In the following section, we will be discussing our research and comparing the different solutions we have found. This will include looking at the different programming languages we have discussed, APIs, and libraries.
Currently, it seems as though the use of Minecraft is a new frontier for the NHS. From our clients, we have been given a prototype project from a previous student whom they worked with. This prototype also works to provide acceptance-committment therapy, however, it has been created in such a way that NHS clinicians are unable to create their own conversations through a platform such as Voiceflow; a conversation based on the ACT activity known as "drop the rope" has been hard-coded. Therefore, our client had requested we implement a way that the NHS clinicians are able to build out custom conversations rather than having to use one that is already pre-coded. This is a key feature of the MineACT system. Aside from this, there are existing chatbot plugins created for Minecraft that are very customisable, but do not serve the functions that we need such as having an interface to build out these conversations.
At the request of our client, we will be using Voiceflow as our platform to build out conversations. This is because it is common practice for NHS clinicians to use Voiceflow. Though, alongside researching around this platform, we also had a look at alternatives, in particular, IBM Watson. We compared the two, the benefits of each, but also their drawbacks. The two are no doubt very powerful tools.
Advantages | Disadvantages |
---|---|
Voiceflow is open-source and free to use. There is no need to pay for the premiums since clinicians can easily make simple conversations on their own without the need for collaborative features that the premiums allow. | There are some features that may be useful at some point that clinicians may want to use but are behind a paywall. Otherwise, the free version is more than enough. |
Voiceflow allows you to export the conversation diagrams in a JSON format which can be used for further manipulation or imported to continue building the conversation on another machine. | There isn't direct API access for developers. This means that requests and responses would have to be sent manually. Since we can export the diagrams as JSON, the implementation of a parser will be required. |
Voiceflow has a very simple and clean interface that clinicians can use to build out their conversation diagrams. It is very easy to use and has very minimal need for code. |
Advantages | Disadvantages |
---|---|
IBM Watson has API access for developers. This means we can get direct access to keys. We can send requests and get back responses from Watson. | IBM Watson is a premium tool. Users will have to pay for it and can get very expensive especially when many requests are made to it each day. |
IBM Watson allows you to export the conversatin diagram as JSON and therefore will let you edit the diagram on another machine. This is similar to Voiceflow. | The user interface to create these diagrams can seem quite clunky and hard to use. The diagrams are in fixed positions unlike Voiceflow which allows you to move the blocks around the canvas freely without worry. |
IBM Watson has the capability of natural language processing. This means that users will be able to input somewhat grammatically incorrect sentences and still receive an output from the bot. | IBM Watson requires a bit of knowledge of code to be able to use its full capabilities. Since our client has requested that clinicians should not have to write any code, this is a serious disadvantage. |
After much research, and at the request of our client, we have opted to use Voiceflow. While IBM Watson certainly has its advantages, the disadvantages cause it to be less desirable solution of the two. When considering wider deployment, it would cost NHS Trusts a lot of money to run the bots, especially while having to run Minecraft servers too. Voiceflow's problem regarding direct access to the API can be worked around since it is possible to also export the conversation diagram as JSON. This means having to produce a parser which is able to handle and manipulate the format given by Voiceflow themselves.
Spigot is an integral part to the overall MineACT system. It is the server API which allows us to install plugins onto Minecraft servers [3]. This also allows players to actually connect to a Minecraft server. The Spigot server will be handling all the requests and responses to and from the game. Essentially, the plugin that handles the parsing of the Voiceflow diagram will connected to the server and placed within an overall "plugins" folder. The plugin will be a .jar file after building the necessary Java files.
Our client has asked that we implement the use of spreadsheets. This is because the NHS clinicians will be storing all necessary intents in a particular spreadsheet
which will be referred to when the user enters a string through Minecraft. The plugin will check if the intent sent by the user is within this spreadsheet. Rather
than handling an Excel file on the machine or server, the best option would be to use Google Sheets. Google provides API access for developers through the Google Cloud Platform [4].
However, we have also taken a look at the use of NoCodeAPI, a service which will allow us to convert a Google Sheet into a JSON API with little to no code [5]. Rather than having to set up a
Google Service Account, an API can simply be set up by using the Sheet ID. This will also allow us to make GET requests to the API endpoints. From our research, we have decided that NoCodeAPI
would be the best route to take. This is because there will be less dependencies such as the Google Cloud libraries for Python. By using NoCodeAPI, we will not have to handle keys with the server files
and can use Python libraries such as requests
and json
.
Since Python is used to call the Google Sheets API, we have had to find a way to allow Python and Java to communicate. Java is necessary since this is the primary language used to create Minecraft plugins. Python, however, is not natively supported when creating plugins since you cannot turn a Python file into a .jar file. We have found various ways of allowing a Python script to work in Minecraft.
MCPI is a Python library created to support Python implementation into Minecraft plugins [6]. This can work on conjunction with RaspberryJuice, a plugin that implements the Minecraft Pi Socket API [7]. Upon further reading into this particular library, while it is no doubt a powerful tool, it would not be entirely necessary since we are not coding Minecraft mechanics in Python, but rather only the ability to pull data from Google Sheets. Furthermore, MCPI does not seem to have the ability to capture user inputs from within the game when running a server. From the prototype given by our client, RaspberryJuice was used. However, to capture text from the in-game chat function, the Python script had to enter external chat logs. This may not be the best way since Spigot libaries in Java already have methods which directly allow you to take user inputs from the in-game chat. MCPI can perhaps be used if we were programming actual Minecraft mechanics in Python. However, these core mechanics will primarily remain within Java.
Jython is a combination of Python and Java put together. It is a Java implementation of Python [8]. From our research, it certainly seems like a very powerful tool. It allows programmers to have a runtime of the Python interpreter, whilst also being able to use certain Python libraries. Essentially, this would allow us to have Pythons scripts directly within our Java code rather than having to create a separate Python file. It would also mean that we would be able to bundle everything together into a single .jar file when building for distribution of the plugin. However, it is unclear what Python libraries are supported by Jython. Since it is unclear if Jython can support the Google API libraries, and having researched around the use of Java to connect to the Google API, it would not be the best plan to begin using a new language implementation only to come across errors with limited documentation. Therefore, we had decided to opt with the final method of Python-Java communication we found.
ProcessBuilder is a class already built into Java. It is a very useful class which allows us to create and configure operating system processes [9]. ProcessBuilder will let us call the Python script and then return the data back to Java where it can be used and manipulated for any purposes we require. While it is certainly a simple library to use, it is due to the simplicity of it that we will be using it. Since our Python script will only be calling the Google API and retrieving data, there would be no need to use powerful tools such as Jython. Jython can be implemented if our whole system was built in it. Therefore, ProcessBuilder can simply be used to call the Python script and return back very simple data, such as a True or False statement.
After much extensive research, we had eventually decided on our final tools which we will be using. While there have been many options to use, we will be following the simplest tools to use, especially those that are open-source and well-documented. If this project was to be taken further and be released on a wider scale, perhaps developers for the NHS can see the use of tools such as Jython and RaspberryJuice.
[3]SpigotMC, "About SpigotMC", SpigotMC, 2017. [Online]. Available: https://www.spigotmc.org/wiki/about-spigot/ [Accessed: 10-Feb-2021]
[4]Google, "Python Quickstart", Google Developers, 2020. [Online]. Available: https://developers.google.com/sheets/api/quickstart/python [Accessed: 10-Feb-2021]
[5]NoCodeAPI, "Google Sheets API", NoCodeAPI, 2021. [Online]. Available: https://nocodeapi.com/google-sheets-api [Accessed: 10-Feb-2021]
[6]M. O'Hanlon, "mcpi", GitHub, 2020. [Online]. Available: https://github.com/martinohanlon/mcpi [Accessed: 10-Feb-2021]
[7]Z. Zhang, "RaspberryJuice", GitHub, 2021. [Online]. Available: https://github.com/zhuowei/RaspberryJuice [Accessed: 10-Feb-2021]
[8]Jython, "Jython", Jython, 2021. [Online]. Available: https://www.jython.org [Accessed: 10-Feb-2021]
[9]J. Cook, "Guide to java.lang.ProcessBuilder API", Baeldung, 2019. [Online]. Available: https://www.baeldung.com/java-lang-processbuilder-api [Accessed: 10-Feb-2021]