Settlers of Catan
Start
Nov. 2020
Technologies
Java, NetBeans
Type
Online Game
Last updated
Oct. 2023

Settlers of Catan is a recreation of the popular boardgame made entirely in Java. The game was made primarily using NetBeans IDE 8.2. Originally the game started out as the final project for my grade 12 programming course ICS4U, but I enjoyed working on it so much it quickly became more. Originally the project began as a collaboration between me and a classmate Evan. The first ~2000 lines of code we evenly written between Evan and I. After the project for ICS4U was completed, I continued to work on the project solo adding the remaining ~8000 lines of code slowly over the last 2 years.

A cropped close-up of a game of catan.
A screenshot of the old menu used to connect to an online game of catan.

The entire code base is written without the use of an external libraries or frameworks. It's either all custom code or included java libraries. The graphics are all drawn with AWT or Graphics2D java libraries. Nearly all of the art assets and sprites were drawn by Alex Eckardt, whom I owe a huge thank you. One of the features I am most proud of is the online play capabilities. I'll admit it is definitely not the cleanest code, and barely works, but I am very pleased that I got it to work at all. The current net code makes use of Sockets and ServerSockets to set up communication. A lot of the connection and initialization is riddled with bugs, and I would like to rewrite large portions in the future. As of writing the current system sets up a hub server on the computer of player 1 (the red player) and auto connects a client connection for the red player. Then the remaining player create a client instance and connect to the red players Computer over the selected port.

As of writing (June 2023) I am currently transitioning all the remaining GUI elements away from NetBeans JFrame GUI builder. Legacy versions of Catan make heavy use of NetBeans' GUI builder. The most recent progress was made January 2023, where the full main menu was made using custom GUI elements. When I resume work on the catan project I will be completing the transition to my custom GUI menu elements. The next steps will then probably include a rewriting of the net code and the possibility of dedicated servers that take the hosting responsibility away from the players. I wish to achieve this by running special server code on my Raspberry Pi 3+ that hosts prepared and ready game servers that can be connected to by players and selected from an in-game menu.

Working on this Catan project is something I do intermittently, it is rarely a main focus. I have a strong burst of productivity here and there, but I often also let my focus wander to other projects too. I tend to work on Catan at times where I find I have more excess free time that I can dedicate to such passion projects.
A screenshot of the main menu.
The new main menu of the Catan game, using the new custom menu elements.
A screenshot of a game between 4 players.
A game between 4 players.