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

Simple Swinging Power Lines and Ropes in Unity

I wanted to create dynamic power lines for a game that I’ve been working on in Unity for the last few weeks. I couldn’t find a solution that satisfied my requirements, and so I decided to implement a custom solution, which I wanted to share with you.

Continue reading Simple Swinging Power Lines and Ropes in Unity

How to program an arcball (orbiting) camera in Unity using spherical coordinates

A while ago, I wrote this article about a simple implementation of an Arcball camera in C++. In it, I described how that could get done without using Quaternions, spherical coordinates, or a lookAt function. Anyway, just out of curiosity, I decided to create a minimal implementation of an orbiting arcball camera in C# using spherical coordinates.

Continue reading How to program an arcball (orbiting) camera in Unity using spherical coordinates

Simple collision avoidance AI in Unity3D

I’m currently working on a small 3D arcade game inspired by classical top down races in Unity3D. The game will feature enemy opponents, which means that they have to have at least some kind of AI. This AI consists of simple collision avoidance algorithm, so that the enemies don’t crash into walls constantly, and a very simple path following algorithm so that the opponents can find their way around the racetrack. I’ve built a quick prototype with simple boxes and a path. Continue reading Simple collision avoidance AI in Unity3D