Catan!! Having 128 displays & 768 WS. Evolving code attached.

My family was introduced to Catan back in winter of 2015 and we've been hooked ever since. Currently I am using a completely 3D printed setup w/ magnet so the hexes all snap together. It's great but setup is a pita and breakdown takes time. I'd like to up my game.

For those of you not familiar with Catan it's a game of resources where the board is made of separate hexagon tiles. In general the hexes are Lumber, Brick, Ore, Wool, and Wheat. There are some additional hexes such as Lake (Fish resource), Gold, Jungle, Volcano, and Ocean. Each hex, minus Ocean, is assigned a number between 2 - 12 with the exception of 7. Players place settlements on the corners of hexes and when their number is rolled the player gets those resources. More resources = expansion = points = winner.

I've envisioned upping my game experience through either

  1. a tabletop LCD connected to a laptop with some sort of hex mapping software but the programming is beyond my skills. So lets leave this option out for now.
    Or
  2. Arduino!! I've made some pretty cool stuff in the past but my skills are somewhat limited to code plagiarism and tweaking. I only dabble with it here and there but I compensate with my lack of code skill with an abundance of preservation or stubbornness.

Alright... lets get to my vision. A large piece of plywood with hexagons routed into it. Each hexagon has a fogged acrylic cover and under this against the acrylic is a display indicating the hexes number. Then along the inside wall of each hex is 6 WS2815s shining the light to correspond to the resource of the hex. (ie. green = lumber, yellow = wheat, red = brick, purple = ore, light green = wool, blue =ocean, and gold, jungle, lake, volcano I'll have to figure out colors). Nothing moves, setup is turning it on, hitting random, and then the ability to make tweaks through serial or Bluetooth communication to the arduino for some fine tuning.

With me so far? Hope so. Now comes the complex part. I want to control all of this from a single Arduino Mega 2560 and there's going to be a total of 128 hexes, 768 WS2815s, and communication for tweaking. Does this sound possible? I've been researching this project and it seems in order to get this happening I'm going to need to rely on I2C for this massive data dump. It seems TCA9548A multiplexors for communicating with all 128 of these displays is going to be the trick. The displays I'm eyeing are either quad alphanumeric or SSD1306 displays. Personally, I'm leaning towards the alphanumeric displays for the clean look and simplicity. I'll express my findings at the end.

For the arduino it will not need to constantly refresh or change the hex values unless I initiate a change through communication. So essentially once it does all of its business it will sit idle. I have plans down the road to add some features such as...
-Controlling four dice on a master display (two normal 1-6, one indicating yellow/blue/green//pirate/pirate/pirate, and a small one which controls the direction of iceberg pieces that travel along ocean pieces). This would be initiated by a button press.
-Depending on the dice roll the hex could flash if its number was rolled or the display could go blank on all of the non-rolled number

Any direction or understanding if this is possible would be much appreciated.

Quad Alphanumeric Displays (my ideal direction)
In my research I found that the Quad Alphanumeric Displays are capable of 8 different addresses. Couple this with a single TCA9548A I2C Multiplexer and I now have the capability of handling 8 of these display boards on each of the 8 channels leaving me with 128 controllable individual I2C.
Pro: Cleaner look, bright, seen from any angle
Con: ~11 amps

SSD1306
I've only been able to find these with two configurable addresses (0x78/0x7A). This would leave each TCA9548A to only have 16 displays and requiring 8 total TCA9548A multiplexors to handle the full 128 hexes.
Pro: Can display much more than numbers, ~3-4 amps
Con: Needing more multiplexors, extra complexity, more wiring, less reliable (imho), not as bright, would be an issue to see from extreme angles.

96d9a667-159c-4fc1-8c4e-a2438ae27e13.jpg

96d9a667-159c-4fc1-8c4e-a2438ae27e13.jpg

Catan-14Segment.ino (19.2 KB)

You seem to be overthinking this project.
You can control many hundreds of WSx LEDS individually with a single GPIO port. Heck, an ESP8266 can do it. Your only limitation is the RAM on board because you need an array of CRGB datatype. So 1000 WSx LEDs would need an array of 3,000 bytes.

Your biggest disappointment is the color rendition. While WSx LEDs can represent color in 24 bits, you cannot tell the difference from yellow or gold. (I've tried).

Make a prototype of your game board, buy a sheet of WSx LEDS, and any Arduino or Arduino compatible board (my go-to board is the Wemos D1 Mini because it's only $5 each) and start experimenting with the fastLed.h library.

GOLD.... is a texture, not a colour.
You might get away by experimenting with patterning adjacent LEDs with YELLOW, dark yellow (brown) etc.
It won’t be perfect, but might work for you.

I understand the complication I might have with the colors. I have a few strips of WS2812 leds and will make a few prototype hexes before I start really getting picky in what shade and such. My problem is really how to manage controlling 128 displays be it quad alphanumeric or SSD1306 displays. I don't want to hit a road block after investing the $300+ into this to find that I'm going to have to make drastic compromises to keep the end goal the same.

Physically I can handle the wiring but I am unsure if the Mega has memory capacity.

GOLD.... is a texture, not a colour.
[/quote]

CRGB Gold =0xFFD700

But it’s the reflection of adjacent light and surfaces that makes it dazzle.
It’s just a muddy yellow if it’s a flat surface.

Silver is the same... white & various shades of grey in the same circumstances.

I spent days figuring this out in the early days of computer graphics for TV !

Spent some time working on the beginnings of my code which is now attached to the first post in the topic. It's too long for the 9000 limit in the forum posts.

I still have to add the WS and ponder the ability to tweak the hexes number and color after the generations are all complete. But hell, it compiles and that's a win for me so far. I have some quad displays and TXA9548As on order for a small scale testing in a few weeks.

I'm sure this code could be cleaned up drastically as it feels overly complex right now. I'm more than welcoming to some suggestions as I'm always learning.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.