• Stars
    star
    132
  • Rank 268,664 (Top 6 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A sample game called Pirate Panic for Unity engine built with Nakama server.

Unity Sample Project

Welcome to "Pirate Panic" !

This Unity sample project demonstrates the features of the Nakama server by Heroic Labs.

Nakama is an open-source server designed to power modern games and apps. Features include user accounts, chat, social, matchmaker, realtime multiplayer, and much more.

These docs provide everything you need to download the Unity game, run the Nakama server, and play "Pirate Panic".

Table Of Contents

Nakama Docs

  • Nakama (Docs) - High-level overview
  • Unity Client Guide (Docs) - Unity setup

Scenes

Pirate Panic Game

The repo includes these scenes for the sample game project.

  • Scene01MainMenu (Source) - This is the main entry point for the game. Play this scene first.
  • Scene02Battle (Source) - The core game loop.

Constants & Configuration

Pirate Panic Game

The game centralizes some values which are intended for tweaking and experimentation by game developers.

  • GameConfiguration (Source) - Stores commonly used values which may be changed at edit-time and runtime.
  • GameConstants (Source) - Stores commonly used values which may be changed at edit-time.

Getting Started

1. Setup Docker

The Docker Engine is required. Follow the Heroic Labs quickstart guide.

To start the game server and database once Docker is setup navigate to the .\ServerModules folder and run:

docker-compose up

2. Setup Unity

The Unity Editor is required. Download it from Unity3d.com/get-unity/download.

  1. Open the Unity Project of ./PiratePanic/ in Unity Version 2020.3.7f1 or higher.
  2. Open the Unity Console Window (Unity → Windows → General → Console). Confirm there are no warnings or errors.
  3. By default, the game will attempt to communicate with port 7350 of localhost, which is the default Nakama HTTP port. If you'd like to change your host or IP, you can do so when constructing the client: https://github.com/heroiclabs/unity-sampleproject/blob/master/PiratePanic/Assets/PiratePanic/Scripts/Scene01MainMenuController.cs#L101

3. Play Against Yourself

Standalone Build Play Session

  1. Open the project in the Unity Editor
  2. Make a Unity Standalone Build (e.g. WindowsStandalone)
    • Mac OS users will need to temporarily change the bundle identifier prior to building. On Mac OS, Unity shares .plist files between the editor and the standalone build.
  3. Run the Standalone Build of Pirate Panic
  4. Click "Battle"

Unity Editor Play Session

  1. Open the project in the Unity Editor
  2. Open the scene of ./PiratePanic/Assets/PiratePanic/Scenes/Scene01MainMenu.unity
  3. Run Unity Editor for Pirate Panic
  4. Click "Battle"

Now the Standalone is playing against the Unity Editor. Enjoy!

Contribute

GitHub issues and pull requests are welcome. If you're interested in enhancing the code please open an issue to discuss the changes or drop in and discuss it in the community forum.

To modify the Typescript remote procedure calls (RPCs), install Node Package Manager (NPM), run npm install and npx tsc from the ServerModules folder, and restart the server.

More documentation on working with the Nakama Typescript runtime can be found here: https://heroiclabs.com/docs/runtime-code-typescript-setup/

License

This project source code and documentation is licensed under the Apache-2 License. All images, graphics, and other non-code resources are licensed under CC BY-NC-ND. Please reach out on a GitHub issue if you have any questions.

All 3rd-party assets and libraries used in this project retain all rights under their respective licenses.

More Repositories

1

nakama

Distributed server for social and realtime games and apps.
Go
7,860
star
2

nakama-godot

Godot client for Nakama server written in GDScript.
GDScript
510
star
3

nakama-unity

Unity client for Nakama server.
C#
363
star
4

nakama-godot-demo

A demo project with Godot engine and Nakama server.
GDScript
265
star
5

fishgame-godot

"Fish Game" for Godot is a 2-4 player online multiplayer game created as a demo of Nakama; an open-source scalable game server, using the Godot game engine.
GDScript
205
star
6

nakama-unreal

Unreal client for Nakama server.
C++
171
star
7

nakama-js

JavaScript client for Nakama server written in TypeScript.
TypeScript
164
star
8

fishgame-macroquad

"Fish Game" for Macroquad is an online multiplayer game, created as a demonstration of Nakama, an open-source scalable game server, using Rust-lang and the Macroquad game engine.
Rust
136
star
9

nakama-dart

Pure Dart Client for Nakama Server
Dart
131
star
10

nakama-dotnet

.NET client for Nakama server written in C#.
C#
99
star
11

nakama-project-template

An example project on how to set up and write custom server code in Nakama server.
Go
81
star
12

nakama-defold

Defold client for Nakama server.
Lua
74
star
13

nakama-cpp

Generic C/C++ client for Nakama server.
C++
67
star
14

nakama-rs

Rust
65
star
15

nakama-common

The runtime framework for Nakama server.
Go
44
star
16

nakama-docs

Documentation for Nakama social and realtime server.
Shell
43
star
17

fishgame-unity

"Fish Game" for Unity is a 2-4 player online multiplayer game created as a demo of Nakama; an open-source scalable game server, using the Unity game engine.
C#
43
star
18

nakama-java

Java client for the Nakama and Satori servers.
Java
29
star
19

nakama-cocos2d-x

Cocos2d-x client for Nakama server.
C++
27
star
20

nakama-examples

A mono repo with project examples for the Nakama client libraries.
C#
24
star
21

nakama-swift

Swift client for Nakama server.
Swift
24
star
22

pulse

Service registration and discovery library for Elixir. Relies on etcd as an external service registry.
Elixir
16
star
23

hiro

The server interface for the Hiro game framework.
Go
14
star
24

sonic

etcd library and bindings for Elixir.
Elixir
10
star
25

nakama-cocos2d-x-javascript

Cocos2d-x client for Nakama server written in JavaScript
JavaScript
7
star
26

reconstructing-fun

C#
6
star
27

xoxo-phaserjs

JavaScript
5
star