This story is over 5 years old.


Space Invaders But the Invaders Evolve Like Bacteria

Only the fittest attackers survive in this simple shooting game.
​Screenshot of InvaderZ
Screenshot of InvaderZ

InvaderZ is a simple open-source Space Invaders clone with a complex twist: The aliens genetically evolve like bacteria.

The goal is to make the next attack stronger than the next, in a “survival of the fittest” scenario. It’s Dr. Mario meets Space Invaders, plus evolutionary math.

Victor Ribeiro, a software engineering student at Federal University of Pampa, designed Invaderz to mimic how a genetic algorithm operates and replicates.

A genetic algorithm, in computer science, is a mathematical procedure that seeks to find a heuristic or solution to a problem when there’s incomplete information available. It’s inspired by natural selection, and was first based on Darwin’s theory of evolution.

In InvaderZ, your next batch of alien invaders depends on how well your current one fares. At the beginning of the game, it generates a random population of baddies. To launch the following batch and the ones after it, the game calculates how far the previous one got in the space—or how close each invader came to your ship. If you’re not great at nailing ones of a certain shape or movement, it reproduces more of those, making it harder. But after seven generations, a completely new wave is generated, with only the best of the seven past generations surviving to battle on.

The game’s plot on Ribeiro’s GitHub entry for the project reveals a fairly in-depth backstory for a simple pixel-shooter: “You are the last hope of the humankind as the defense against the InvaderZ. They are deployed by their mothership with the sole purpose of entering earth's atmosphere. Although they are not a danger for you as an individual, if 5 of them gets through, everything is doomed.”

The most challenging part is the shooting lag: You don’t get another shot until the last projectile hits a target or disappears from the frame.