SilentWolf now supports Godot 4
March 9th, 2023
SilentWolf has been offering backend services for Godot engine since 2019. Today we announce that SilentWolf officially supports Godot 4.
Godot 4 is a major update to the Godot engine. It brings a lot of new features and improvements to the engine. We are excited to support this new version of Godot.
The new addon does more than just make SilentWolf available in Godot 4. It introduces type hints to every function signature, improves the performance of some functions, fixes some bugs and makes it even easier to start using SilentWolf. The code has also been refactored and is now cleaner and better organised.
You can find the documentation related to each SilentWolf feature on the website like before. Since we support both Godot 3 and Godot 4 we've introduced tabbed code blocks that you can copy and paste straight into your game's code to integrate SilentWolf.
Here's an example below.
Stay tuned for more improvements to the docs in the future.
Migration from Godot 3 to Godot 4
Others have written
about porting games from Godot 3 to Godot 4 and Godot will propose to change the code automatically when loading a Godot 3 game for the first time when opening Godot 4. If you want to migrate a game using SilentWolf to Godot 4 a lot will stay the same but there are some changes that you need to be aware of. We go to great lengths to ensure backwards compatibility between different versions of the SilentWolf addon for Godot engine, but changes to the Godot engine meant that we had to make some changes to the addon that will impact your game. We also took the opportunity to change a few function and signal names to make them more consistent.
These changes include:
- Coroutines: coroutine syntax has changed in Godot 4 (and the "yield" keyword has been replaced with "await"). Almost all SilentWolf functions are asynchronous, and SilentWolf makes extensive use of signals and coroutines so your code calling our functions will need to be updated accordingly.
- Signal names: we've reduced the number of signals by combining 'success' and 'failure' signals into 'complete' signals (e.g. 'sw_get_scores_complete'), indicating that the async function has returned a result, whether good or bad. By awaiting these signals you can get the full results in a variable called sw_result.
- Function names: we've modified a few function names for consistency and simplicity (e.g. 'SilentWolf.Scores.persist_score(player_name, score_value)' now becomes 'SilentWolf.Scores.save_score(player_name, score_value)'.
In terms of data, the following will be migrated automatically if you upgrade your existing game to Godot 4:
- Leaderboard definitions and configurations
- Player accounts
- Player data
The only data that will not be migrated automatically will be your scores. This is because we have revamped the way scores are persisted in SilentWolf, to make save and retrieving scores even more performant and future-proof the architecture. If you wish to have your scores migrated over to the Goot 4 version of your game please contact us
All the built-in scenes that were available for Godot 3 have been adapted to Godot 4 an we've designed a theme (available at res://addons/silent_wolf/assets/themes) that you can customise to your liking. Just like in the Godot 3 addon, we don't recommend that you use or moify the built-in scenes directly (although you can if you want to). Instead, we recommend that you copy the scenes into your project and modify them there. This way you can easily update the addon in the future without losing your changes.
The built-in scenes can be used as-is if you want to quickly get started with SilentWolf, or they can serve as inspiration for your game's own custom UI. They include:
- Leaderboard scene
- Alternate leaderboard scenes (for reverse leaerboard and multiple time-based leaerboards)
- Player account registration scene
- Email confirmation scene (if you ddecide to use email addresses or registration
- Player account login scene
- Reset password scene
We're excited about the future of SilentWolf and we're looking forward to bringing you more features and improvements. Even though we offer support for Godot 4 starting form now, we will continue supporting Godot 3.x games for many years to come.
We will always be a super indie-friendly service and SilentWolf remains 100% free as it has always been since its creation.
Stay tuned for more updates in the near future!