The objective of this thesis is to find and optimize the racing line of a vehicle with different non-player character (NPC) implementations using genetic algorithms. The racetracks in this case are tubes, defined by a spline and a radius. It is found that the genetic algorithm can indeed be used to optimize the lap times of NPCs around a given track, even though the resulting lap times strongly depend on the NPC implementation. This technique can be used to automate certain aspects of game-development. For instance, racing lines can be generated for each NPC, track and vehicle combination automatically, without losing unique characteristics of each NPC variation.