Online multiplayer board game server written in Go, using WebSockets.

BfH Server

The Battle for Hermannia is a board game created as a gift by the father of hermannm, a developer of this project. This digital edition of Hermannia is an online multiplayer implementation of the game. It consists of this server, written in Go, as well as a Unity client at immerse-ntnu/bfh-client.

Package Structure

  • The game package contains the game logic for The Battle for Hermannia, mainly the resolving of orders.
  • The boards package contains the JSON files for the game's boards, and functions for deserializing them.
  • The lobby package defines endpoints for finding, creating and joining lobbies, and manages WebSocket connections between players and lobbies. It is agnostic to the type of game played.
  • The messages package defines the game-specific types of messages sent between client and server, as well as the logic for sorting incoming messages.
  • The app package contains subpackages for each of the server's executables, and the common setup code for them.
    • The main package under local sets up a game server with a single, server-created lobby.
    • The main package under public sets up a game server where anyone can create their own lobbies through an open endpoint.
Similar Resources

FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022

MazePlay - a game powered by Go+ spx game engine

MazePlay - a game powered by Go+ spx game engine

MazePlay - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this g

Dec 16, 2021

A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!

A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!

galactic-asteroid-belt Overview A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy! Run To run, you will need Go

Dec 2, 2021

RundQuiz-Game - This is a Go exercise that implements and builds a quiz game from a list of math questions in a CSV file.

Go RundQuiz Game Exercise details This exercise is broken into two parts to help simplify the process of explaining it as well as to make it easier to

Jan 5, 2022

Simple 2D game to teach myself various things about game development and ECS, etc

2d-grass-game I really don't know what to name this game. Its a big grass field, and its in 2d so....2D Grass game This is a simple 2D game to teach m

Jan 17, 2022

a framework in golang for game server or app server

a framework in golang for game server or app server

einx a framework in golang for game server or app server. a example server for einx (https://github.com/Cyinx/game_server_einx) Features User-Friendly

Dec 8, 2022

A lightweight and efficient messaging gateway server for distributed game servers, written in Go.

Overview channeld is an open source, light-weight and efficient messaging gateway server designed for distributed game servers (typically MMO) and oth

Aug 8, 2022

A Game Server Skeleton in golang.

A Game Server Skeleton in golang.

A game server skeleton implemented with golang. 注意(NOTICE) 欢迎加入QQ群: 459420581 (Gopher成都,讨论一切与go有关的话题) gonet/2 gonet1已停止维护(I no longer maintain this, p

Dec 26, 2022

Scalable Distributed Game Server Engine with Hot Swapping in Golang

Scalable Distributed Game Server Engine with Hot Swapping in Golang

GoWorld Scalable Distributed Game Server Engine with Hot Reload in Golang Features Architecture Introduction Get GoWorld Manage GoWorld Servers Demos

Dec 25, 2022
Comments
  • refactor: reduce use of pointers in game package

    refactor: reduce use of pointers in game package

    Changes:

    • Eliminate most use of pointers in types from the game package.
      • Refactor dependent functions and other packages accordingly.
    • Implement concurrent resolving of game battles.
    • Restructure some of the files in the game package to make file names clearer.

    Rationale:

    Do not communicate by sharing memory, share memory by communicating.

    — Rob Pike, co-creator of the Go programming language

    The previous implementation of the game package relied heavily on pointers. This became a problem when trying to implement concurrency, as mutation from different goroutines could lead to race conditions. In addition, it was difficult to know where mutations could be made, and nil pointer dereferencing was a common bug.

    One solution may have been to use mutexes, but passing by value and using channels seems like the more idiomatic approach in Go. With this PR, board mutation is kept in one goroutine, which dispatches other goroutines to calculate results. Hopefully, this should reduce bugs and make it easier to implement more concurrency in the future.

Dedicated Game Server Hosting and Scaling for Multiplayer Games on Kubernetes
Dedicated Game Server Hosting and Scaling for Multiplayer Games on Kubernetes

Agones is a library for hosting, running and scaling dedicated game servers on Kubernetes. Agones, is derived from the Greek word agōn which roughly t

Jan 6, 2023
Chesscode - a way of encoding messages using a chess board and the starting set of chess pieces
Chesscode - a way of encoding messages using a chess board and the starting set of chess pieces

chesscode Are you a spy that needs to leave an urgent top secret message for an

Jan 3, 2023
Chesscode - Chesscode: a way of encoding messages using a chess board and the starting set of chess pieces
Chesscode - Chesscode: a way of encoding messages using a chess board and the starting set of chess pieces

chesscode Are you a spy that needs to leave an urgent top secret message for an

Jan 1, 2022
Simple rule based matchmaking for your online game with support of Redcon(RESP) protocol.
 Simple rule based matchmaking for your online game with support of Redcon(RESP) protocol.

Simple Matchmaking Simple rule based matchmaking for your online game with support of Redcon(RESP) protocol. 1- Simple Match Rule Easiest usage of sys

Jan 4, 2023
This is an extremely basic 2 player online game.

myba This is an extremely basic 2 player online game. How to play Player one moves with WASD, player 2 moves with UHJK. Once both players are either h

Dec 7, 2021
A terminal Snake game that supports multiple players to play together online.
A terminal Snake game that supports multiple players to play together online.

GoSnake A Snake game that supports multiple players to play together online. The game is written in go language and does not use other third-party lib

Jun 25, 2022
Arkanoid game in Go using Ebiten game engine with ECS.
Arkanoid game in Go using Ebiten game engine with ECS.

Arkanoid-go Arkanoid game in Go using Ebiten game engine with ECS. You must have Git LFS installed when cloning the repository to download assets. See

Oct 9, 2022
Play chess with Go, HTML5, WebSockets and random strangers!

ChessBuddy Play chess with Go, HTML5, WebSockets and random strangers! Demo: http://chess.tux21b.org:8000/ Hint: Open the page in two different tabs,

Nov 10, 2022
AircraftWar - a game powered by Go+ spx game engine
AircraftWar - a game powered by Go+ spx game engine

AircraftWar - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download thi

Jan 5, 2022
FlappyCalf - a game powered by Go+ spx game engine
FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022