Installing Hiro #
Prerequisites #
Before proceeding ensure that you have:
- Installed Nakama server
- Signed up for Heroic Cloud
- Set up the Go toolchain
- Set up your Nakama project with Go
Server #
We will provide you with an archive in the format
Hiro-"<version>".zip
. Un-zip and enter theserver
folder to find the Hiro binaries.Take the binary files and place them into your Nakama server’s directory.
Update your
docker-compose.yml
to use our recommended setup for Hiro:
|
|
- Update your
Dockerfile
to copy the Hiro binaries to the correct directory when setting up your Docker container:
|
|
- Add your
HIRO_LICENSE
key to yourlocal.yml
config.
|
|
- Run this command to add Hiro as dependency:
go get "github.com/heroiclabs/hiro@latest"
- Create a
main.go
file in the root of your project and add the following boilerplate code that will initialize Hiro and allow you to register the modules that you need for your game:
|
|
- Run this command to make sure that all dependencies are downloaded:
go mod vendor
- Finally, build and run your project:
docker compose up --build
- You should now see many logs that look similar to this, confirming that Hiro’s RPC functions have been registered:
game_backend | {"level":"info","ts":"2024-06-25T12:02:35.254Z","caller":"server/runtime.go:709","msg":"Registered Go runtime RPC function invocation","id":"rpc_id_base_set_device_prefs"}
game_backend | {"level":"info","ts":"2024-06-25T12:02:35.254Z","caller":"server/runtime.go:709","msg":"Registered Go runtime RPC function invocation","id":"rpc_id_inventory_grant"}
game_backend | {"level":"info","ts":"2024-06-25T12:02:35.254Z","caller":"server/runtime.go:709","msg":"Registered Go runtime RPC function invocation","id":"rpc_id_economy_donation_claim"}
Upgrading Hiro #
To upgrade Hiro on the server-side:
Download the Hiro release that you would like to upgrade to and replace the binaries in your server project.
Use the “go get” subcommand to download the same Hiro version in your Go code:
go get "github.com/heroiclabs/hiro@v<hiro-version>"
Check the Hiro compatibility matrix to see which
Nakama
version is depended on by your new version of Hiro.Open your
Dockerfile
and update any references from your previousNakama
version to the new version found in the previous step.Run this command to download the latest versions of your dependencies.
go mod vendor
- Finally, upgrade your client-side Hiro package to the same version being used on the server-side. All you will need to do is follow the same steps as you did when initially setting up Hiro, simply replacing your old Hiro package with the updated one.
Heroic Cloud #
If you wish to upgrade your Heroic Cloud deployment, then continue following these next steps, otherwise you can stop here and run your server locally as you usually would.
Add the previous changes you have made to your project’s repository.
Go to your builder’s edit page and select the same
Namaka Image
version as you have used in yourDockerfile
, then press update.Run a container build with your cloud builder.
Clients #
The clients are available from Heroic Labs. Contact us to request access.
Check out our Unity Client.
Check out our Unreal Client.
Check out our C++ Client.
Check out our Typescript Client.
Compatibility Matrix #
Hiro Version | Nakama Version |
---|---|
1.21.0 | 3.25.0 |
1.20.0 | 3.24.2 |
1.19.0 | 3.23.0 |
1.18.0 | 3.23.0 |
1.17.0 | 3.23.0 |
1.16.0 | 3.22.0 |
1.15.0 | 3.22.0 |
1.14.0 | 3.22.0 |
1.13.0 | 3.21.1 |
1.12.0 | 3.21.1 |
1.11.0 | 3.21.1 |
1.10.0 | 3.21.1 |
1.9.0 | 3.20.1 |
1.8.1 | 3.20.1 |
1.8.0 | 3.20.1 |
1.7.0 | 3.17.1 |
1.6.0 | 3.17.1 |
1.5.0 | 3.17.1 |
1.4.0 | 3.17.1 |
1.3.0 | 3.17.1 |
1.2.0 | 3.17.1 |
1.1.0 | 3.17.0 |
1.0.4 | 3.17.0 |
1.0.3 | 3.17.0 |
1.0.2 | 3.16.0 |
1.0.1 | 3.16.0 |
1.0.0 | 3.16.0 |