This tutorial goes over how to start using OpenSeed in your next Godot based game project. The code is written in GDscript and is designed to remove as many hurtles as possible for the game developer. This tutorial wont go over any of the finer points of making a game in Godot, but the reader should be able to glean information on how certain things are done based on the info given here.
- Godot: OpenSource Game engine we're using as a basis for development of OpenSeed
- Developer ID on OpenSeed*
- App ID on OpenSeed*
- STEEM Account to use as a master account (not your personal account)
- Private Posting Key of a STEEM account.
*At the time of writing there is no developer portal to create or manage your account. If you are planning on using OpenSeed for your game you will need to contact us on Discord by joining the OpenSeed Server.
Before we begin you will need to get the latest version of OpenSeed from the git repository here. If you don't know how to use git don't worry, you can just download the zip file.
Once the source code has been downloaded and extracted (if you used the zip file) you're ready to start.
Start by copying these files from the openseed-steem-godot folder to your game project's folder:
At the moment the scripts will look for each other in the root of the games directory (meaning the top most folder within the game project). If you would like to move the OpenSeed files to some place else you will need to update the gd scripts to point to the right place.
You will need to fill in some of the variables in the OpenSeed.gd script to make sure everything is pointing to the right place. You should leave everything else alone within the script to ensure everything works.
Please change the following to match your needs:
var devId = ""
var appId = ""
var dev_steem = ""
var dev_postingkey =""
Once these variables are set the program will be able to connect to the OpenSeed Server, and will be able to post things on behalf of the developer. Of course these fields are considered sensitive information and should be removed before uploading the data to a network source such as github. When you export your game this data is stored in the game itself and not easily accessible by those looking for the information.
Using the Scene Tree you can now drag and drop Login.tcsn and NewAccount.tcsn into your project. NewAccount is mostly self contained and will function as expected. The Login scene uses signals to tell the game or application if the login was successful and will need the app to do the appropriate actions to finish the login dialog.
Here is how Code Breakers implements these first steps within the main scene of the application.
var openseed = load("res://OpenSeed.gd")
var OpenSeed = openseed.new()
The above needs to be added to any script that you want to use the OpenSeed functions. This is useful if you want to create your own templates instead of using the ones provided.
The above will check for the existence of a user account within the game and if none exists it will prompt the user to log in using their OpenSeed account. However, if it finds a user it sends the signal that the player is logged in and their data has been loaded.
if status == 1:
Finally you need to connect a signal from Login to the script you added the above code to. This will allow you to communicate back and forth to the Login dialog via signals. As you can see from the code once the signal has been received and the status is 1 the prompt closes.
Note: I was unable to get the code block to indent correctly. Follow the code layout in Godot as necessary
In the next tutorial we will go over implementing a leader board so that players have bragging rights forever immortalized as long as the STEEM blockchain exists.
OpenSeed is being developed by @bflanagin for the steem community and indie game developers alike. The development of OpenSeed and any project developed by @v-entertainment or @bflanagin are community funded. If you would like to help with the development of OpenSeed please join the discord server to find out how you can help.