A look at various simple dithering algorithms in C++ [shorts #3]

The previous short article investigated a simple method for scaling images using standard C++. In that article, I mentioned that I was working on a way to shrink images for displaying them on the Mac Classic CRT. I also mentioned that, to display the images on the Mac’s CRT, I’d also need to employ a dithering algorithm to prevent losing too much detail. Therefore, this article takes a look at three simple and popular dithering algorithms implemented in C++.

Continue reading A look at various simple dithering algorithms in C++ [shorts #3]

How to resize bitmap images using C++ [shorts #2]

Since 2016, I’ve always returned back to my Macintosh Classic CRT build, constantly trying to refine the project and make it easier to reproduce my results. In my latest attempt, I used a Raspberry Pi to communicate with the monitor. While that method worked like a charm for me, others have reported a few problems they’ve encountered and possible solutions. In my next attempt to finally get this project right, I decided to go down another path. Without going into too much detail here, the new method required me to implement a simple scaling and dithering algorithm in C++. This short article discusses my image scaling solution in C++.

Continue reading How to resize bitmap images using C++ [shorts #2]

Writing a Quick and Easy Thread-Monitor (Watchdog) in Python [shorts #1]

A thread-monitor, often also referred to as a watchdog, is extremely helpful when building multi-threaded and reliable applications. In its simplest form, a watchdog should detect when one or more threads hang or crash, and it should restart the problematic threads if necessary. Depending on your use-case, you could implement this helper in a variety of ways, and you could add many more features such as a heartbeat function that allows each thread to report its progress to the monitor.

Continue reading Writing a Quick and Easy Thread-Monitor (Watchdog) in Python [shorts #1]

Building an Arduino based capacitive touch kitchen timer – Part 5

In this part of the Arduino capacitive touch timer series, I discuss the final working version of the project and what changes I had to make to the previous revisions. Towards the end of the article, I’ll have a look at what lessons I’ve learned while working on this project.

Continue reading Building an Arduino based capacitive touch kitchen timer – Part 5

Building an Arduino based capacitive touch kitchen timer – Part 4

The fourth part of the Arduino capacitive touch timer series discusses the case design of the project. It also outlines how to assemble the individual pieces of the enclosure and how I plan to improve the design in the near future.

Continue reading Building an Arduino based capacitive touch kitchen timer – Part 4

Building an Arduino based capacitive touch kitchen timer – Part 3

This part of the Arduino based capacitive touch kitchen timer series discusses the software that will make the capacitive kitchen timer come alive. It also talks about how I implemented the capacitive touch ring and some experiments I conducted to ensure good gesture detection and user experience.

Continue reading Building an Arduino based capacitive touch kitchen timer – Part 3

Use genetic algorithms to improve enemy AI over time in video games

I’ve played my fair share of video games in the past twenty years, and ever since I played for the first time, I was fascinated with how someone could make these games work. More often than not, a special mechanic in a game left me wondering how the programmers could implement a certain feature. However, i often notice patterns in enemy behavior. Therefore, it is way too easy for the player to predict how enemies might react to certain situations. While this might have to do with limited AI design, I recently had the idea to experiment with genetic algorithms to make enemies adopt to the player’s style over time to make it more difficult for the player to achieve his goals. My theory is that this way, enemies will adapt to the player over time, and this, in turn, forces the player to try different strategies to succeed. This article summarizes my experiments and discusses the results and how they could be applied in game development.

Continue reading Use genetic algorithms to improve enemy AI over time in video games