Skip to content
@tilegame

Tile Game

The Tile Game!

TileGame Overview

The TileGame is an experimental 2D online game chatroom, written with Golang and Javascript, where you can chat with anybody who goes to the same webpage in their browser. Everybody has a cat character, and can easily type in their chat message, which will appear above your character, and is visible to everybody else who is also online!

Example scene from the tilegame
Characters chatting in the TileGame

Motivation

I wrote this primarily for educational purposes. My goals were to learn about computer networking in general, and more specifically how to write and run servers. I also wanted to learn how to design APIs that can be accessed by a client that is written using different tools or languages than the server, to allow for different clients (including automated bot clients) to be built.

How It Was Made

In the beginning, I wrote a chatroom server in Go using websockets, that simply broadcast all of the messages to everybody else in the room. I wrote a simple interface in Javascript to interact with the server.


Simple chatroom interface

I realized that the concept of a chatroom could extend to character movements and locations. So, I created a grid of locations, and added some mechanisms for the server to move characters. The client clicks a desired location, and this sends a message to the server. The server updates character locations based on those destinations, and broadcasts its state to everybody in the room.


Blue Square: Client Request
Red Square: Server State

As I was building the game, I wanted to see what the network connection and speed under different conditions. To achieve this, I built a small tool that sent a burst of websocket packets to the server, which echoed them back to the client. I could use this measure the round trip time of the packets, and graph them to see what was happening.


Round Trip Time (RTT) of packets from mobile devices

Finally, I added some cat images to act as the characters, and made the text from the chatroom appear over the players head! I had a lot of fun creating this project, and I learned tons about networking, hosting on cloud servers, and lessons in programming in general!

Future Work

There are several future projects and experiments that working on the Tilegame has encouraged me to try.

  • I want to make a 3D game server, with more complicated movement features. One of the things I learned during this project is that using TCP (upon which websockets is built) can be limiting for real-time games, so in the future I would like to experiment with UDP.

  • The "round trip time" tool I made was very rudimentary, and didn't paint a full picture of what was happening. Making tools to test the network connections of clients can provide a lot of useful information, so in the future I want to improve in this area.

  • This game didn't have user accounts or a database, so in the future I want to have account management features, logins, and persistent storage, so that I can build more interesting features.

Pinned Loading

  1. gameserver gameserver Public

    The game server of tile game.

    Go

  2. TileExperiments TileExperiments Public

    experiments with tiling systems for web games.

    JavaScript

Repositories

Showing 7 of 7 repositories
  • TileExperiments Public

    experiments with tiling systems for web games.

    tilegame/TileExperiments’s past year of commit activity
    JavaScript 0 0 4 0 Updated Nov 3, 2022
  • gameserver Public

    The game server of tile game.

    tilegame/gameserver’s past year of commit activity
    Go 0 0 2 0 Updated Nov 3, 2022
  • .github Public

    TileGame Overview Repository

    tilegame/.github’s past year of commit activity
    0 0 0 0 Updated Jul 31, 2022
  • godot-client Public

    client for tilegame made with godot game engine

    tilegame/godot-client’s past year of commit activity
    GDScript 2 1 0 0 Updated Jan 3, 2021
  • docs Public

    Tilegame architecture documentation and ideas

    tilegame/docs’s past year of commit activity
    0 0 0 0 Updated Nov 8, 2018
  • core Public

    game core

    tilegame/core’s past year of commit activity
    Go 0 0 0 0 Updated Nov 8, 2018
  • tiledefs Public

    tile type symbols, definitions, and language hooks

    tilegame/tiledefs’s past year of commit activity
    Go 0 0 0 0 Updated Nov 8, 2018

Top languages

Loading…

Most used topics

Loading…