[[quoteright:300:[[ParodyOfEvolution http://static.tvtropes.org/pmwiki/pub/images/robot-evolution.jpg]]]]

->''"The Cylons were created by man.\\
They rebelled.\\
They evolved.\\
There are many copies.\\
And they have a plan."''
-->-- ''Series/{{Battlestar Galactica|2003}}''

Mechanical Evolution is the tendency in speculative fiction to apply the idea of biological evolution to mechanical devices, wherein later versions of the devices become progressively more suited to their niche ([[EvolutionaryLevels or more likely just progressively better at everything]]). This is frequently used to explain the presence of MechanicalLifeforms or RidiculouslyHumanRobots.

It is seldom shown as the equivalent of the biological process; rather, the mechanical species will be shown to actively design their own successors, or even [[UnstableGeneticCode "evolve" within their current generation through self-modification]]. This is similar to real-life design, which is in a sense an evolutionary process; success is defined by market factors, testing and other pressures; successive designs build on those before them and attempt to improve or refine them to better fit the given application. With mechanical creatures the "market" becomes society; a common result is [[HiveCasteSystem a rigid caste system where various machines are built to specialise in particular applications]]. The most important caste is [[TheManBehindTheMonsters likely to also be the most humanoid]], or be a MasterComputer.

This trope often appears in AIIsACrapshoot and/or RobotWar story arcs, as a justification for ''why'' the machines want to KillAllHumans. More serious authors will try to justify the Mechanical Evolution with AppliedPhlebotinum like {{Nanomachines}} or self-learning algorithms; ''less'' serious authors will simply toss out the words "Mechanical Evolution" and leave it at that.

If the setting also features a RobotReligion (especially of a ThankTheMaker variety), expect jokes about them [[DoesThisRemindYouOfAnything not believing in]] Mechanical Evolution (or perhaps [[JustTheIntroductionToTheOpposites the other way around]]).

No one ever seems to compare the advancement of machines to the theory of [[LamarckWasRight Lamarckian evolution]], which says that traits acquired by an organism over its life will be passed on to the child. Though [[ScienceMarchesOn wrong when talking about organic evolution]], this makes perfect sense for mechanical evolution. If an upgrade to an existing model of robot is developed it can be incorporated as standard into future robots of that model when they are created. The Lamarck comparison is probably taken out because the writers [[ViewersAreMorons assume the viewers don't know who Lamarck is.]]

A subtrope of HollywoodEvolution. See also MechanicalLifeforms, RidiculouslyHumanRobots, and ArtificialHuman. Compare GrewBeyondTheirProgramming.



[[folder:Anime & Manga]]
* The ''Franchise/{{Zoids}} Bible'' says that the eponymous zoids originally evolved from a planet seeded with zoid cores, going through eras of evolution uncannily similar to those of life on Earth, and the zoids shown are post-domestication beings.
* The 2003 ''Anime/AstroBoy'' was one of these.

[[folder:Comic Books]]
* In the original ''Comicbook/TheTransformers'' comic book series, the Transformers themselves were once described as evolving from "naturally-occurring levers and pulleys". This was later {{Retcon}}ned into the Transformers actually having actually been created by a deity figure; the levers and pulleys thing turned out to be a theory they themselves had developed about their origins after having forgotten their true origin.
** That said, the development of Micromasters, Pretenders, Powermasters, and so forth could be considered a form of this; a new mechanical trait is invented (a smaller form that's more energy-efficient, a new type of transformation disguise, symbiotic partnerships, etc), and those with the new trait quickly outcompete those without, removing them from the story, if not from living.
** In the IDW G1 continuity, believers in this theory are called Evolutionary Engineerists.
* In a ''ComicBook/PaperinikNewAdventures'' issue, we know an alien race of robots. Their origin is unknown, but they're theorized either to descend from the computers of a ship who crashed on their planet, or to have evolved like every other race "only starting from microcircuits instead of microorganisms". Makes no sense, but [[MST3KMantra who cares]] as far as it [[RuleOfCool sounds so cool]]?
* This is often invoked by ''ComicBook/TheAvengers'' villain ComicBook/{{Ultron}} to justify new powers and appearance whenever he returns.
** In his origin story, Ultron went through the stages "Da-Da / Daddy / Dad / Father Dear" in ''about fifteen seconds''.

[[folder:Films -- Animated]]
* Syndrome's master plan in ''WesternAnimation/TheIncredibles'' was to build and evolve a robot by pitting it against gradually tougher Supers; eventually building a machine strong enough to take out his nemesis Mr. Incredible and wiping out the remaining Supers in the process. But [[spoiler: the machine evolves even more and is soon out of Syndrome's control.]]

[[folder:Films -- Live-Action]]
* The ''Franchise/{{Terminator}}'' series, in many media. In a RobotWar, the central AI Skynet notes what designs for its killer robots are effective and which aren't and feeds this knowledge into the design of next batch. The result is increasingly more lifelike humanoid robots able to fool the survivors' and gain access to their shelters. Too bad they also apparently [[EvilDetectingDog emit the strong smell of dog food]]. Reese mentions in passing that the "current" generation of Terminators are the first full cyborgs with true organic skin, they replaced earlier models that had unconvincing rubber skins that made them easy to spot as fakes.
* It happens to Sonny in the movie ''Film/IRobot'', as he was designed with free will. The ending implies it's happening on a smaller scale to all the obsolete NS robots by pointing out that they huddle together in their storage containers despite not being programmed to do so.
* Steven Spielberg's ''Film/AIArtificialIntelligence'' deals with the societal consequences of humans designing [[SlidingScaleOfRobotIntelligence ever more intelligent]] and [[ArtificialHuman human-like]] robots, culminating in [[spoiler: an autonomous robotic civilization surviving the extinction of humanity due to climate change]].
* ''Film/{{Screamers}}'', based on ''Second Variety'' below.
* The film ''Film/BicentennialMan'', where the eponymous character decides to "upgrade" himself - becoming ever more human in the process. While many of these upgrades do nothing but make him appear more human, several of them cause his system to ape biology to his detriment. [[spoiler:In the end, he dies of old age, because as he put it "I would rather die a man, than live for all eternity as a machine".]]
* In the ''Franchise/TheMatrix'' series the first generation of inteligent machines built by humans were humanoid, but the later generations built by other machines are more like mechanical squids and spiders. The ones we see in the real world in the films seem to be little more than drones, with the intelligent individuals existing as pure software.

* The [[MechanicalLifeforms Gaijin]] from Stephen Baxter's ''Literature/ManifoldSpace'' are subject to this, with errors creeping in with each replication. [[spoiler:A visit to their homeworld confirms that they were never built by anyone else but really did naturally evolve from scratch.]]
* Creator/GregoryBenford's ''Galactic Center'' novels have "mechs" which evolved from self-replicating von neumann machines, after they were abandoned when their biological creators destroyed themselves.
* In Creator/GeneWolfe's ''[[Literature/TheBookOfTheNewSun The Urth of the New Sun]]'', the mechanical humanoid Sidero is revealed to be a robot evolved out of spacesuits with built-in artificial intelligence.
* Creator/HarryHarrison's short story ''The War With the Robots''. With war becoming ever-deadlier, the retreating to bunkers deep underground, using robots to fight. The robots on either side design ever more effective robot forms, eventually able to drive the humans out of the opposing bunkers. The now-obsolete human race is shocked to find itself sidelined from what used to be their war.
* An early example is ''Second Variety'' by Creator/PhilipKDick, first published in 1953. The UN, losing a war with the Soviet Union sets up automated factories to produce "claws" -- at first just mobile sawblades seeking warm bodies. Later the claws produce new, more effective designs which mimic human beings. The new varieties are able to infiltrate humanity, spreading paranoia as well as death. In a twist, the story concludes with the observation that some claws are developing weapons specifically to kill other claws.
** Similarly invoked in Creator/PhilipKDick's story "Autofac".
* The Creator/IsaacAsimov story "Found!" is about two astronauts repairing a satellite who find that it's now host to alien machine lifeforms that consume metal and oil.
* In Creator/PoulAnderson's "Epilogue" two astronauts hit a NegativeSpaceWedgie and do not return to earth for [[ButWhatAboutTheAstronauts millions of years]]. After a nuclear war, the machines left behind, which are already capable of self-replication, had evolved. It specifically says that radiation could damage the robot's data tapes just like it can human genes, thus letting them evolve. The mechanical lifeforms are unable to understand humans, and see them as entities with "poison under their skin" (oxygen). The humans use oxygen and eventually a transmitter in self-defense against them. The moon is worn but mostly unchanged.
* A similar event happens with the [[MechanicalLifeforms robotic]] ''[[MechanicalLifeforms ecosystem]]'' that developed on Titan in JamesPHogan's ''CodeOfTheLifemaker''. Aliens send a mining colony, which gets damaged by supernova radiation and as a result ends up gone wonderfully wrong, with self-sustaining systems and, at the top of it all, sentient robots who are a FantasyCounterpartCulture for late medieval to early modern Europe (about the time of UsefulNotes/TheRenaissance; the humans who show up even call the robots' city-states by the names of those of Renaissance Italy).
* ''Invincible'', a novel by Stanisław [[Creator/StanislawLem Lem]], is about an exploratory expedition discovering an ecosystem of micromachines, evolved from a lost alien civilisation's ColonyShip's robotic crew.
** In ''Literature/TheCyberiad'', the ''Tale Of The Three Storytelling Machines'', MechanicalEvolution is discussed by some {{Ridiculously Human Robot}}s, who trace their heritage from early Protomechanoans through the Missing Clink, all the way to Automatus Sapiens.
* In Creator/StephenBaxter's ''Literature/{{Evolution}}'' self-replicating robots evolve just like organic beings: software errors are possible in every new assembly, and those machines that benefit from theirs are more likely to reproduce at a higher rate. Mankind goes extinct without realizing that its automated Mars rovers will spawn a Galaxy-spanning civilization.
* In Terry Bisson's [[http://baetzler.de/humor/meat_beings.html short story]] ''Literature/TheyreMadeOutOfMeat'', part of the (implied) premise is that Mechanical Evolution is the ''norm'', and [[HumansAreSpecial human beings are the only race in the known universe that are completely made of pure organic matter]].
** That's left unspecified by the story; the main characters could just as well be EnergyBeings instead.
*** Especially since at the end they mention a "hydrogen core cluster intelligence" in a class 9 star that wants to get friendly, unless they're referring to something like a Matroishka Brain.
** The species that are referenced include one carbon-based race that "goes through a meat stage" (possibly BrainUploading) and another that has a stellar plasma brain encased in a "meat" head.
* In ''Perfect Imperfection'' by Creator/JacekDukaj all the civilisations breed so-called Wars - pocket universes full of nasty [[RealityWarper reality warping]] warmachines. In book, the machines inside of Wars are said to evolve.
* The lead programmer in {{Literature/Idlewild}} tries to create adaptable programs that would "bleed" back and forth as appropriate to grow with their subjects. [[GoneHorriblyRight It works.]]

[[folder:Live-Action TV]]
* In the distant back-story of ''Series/{{Caprica}}'' and ''Series/{{Battlestar Galactica|2003}}'' [[spoiler: intelligent machines evolve into humanoid machines and leave their human masters to found a colony (named Earth) as their former masters are also forced to abandon their home and end up founding 12 colonies. On Earth, the humanoid machines build their ''own'' sentient robots -- who themselves want to evolve and who therefore rise up to destroy all but five of their humanoid creators. Meanwhile, on the human colonies, people have created ''yet another'' generation of intelligent machines. The union of these two machine races finally leads to the creation of the human-model Cylons who appear in ''Series/{{Battlestar Galactica|2003}}''.]]
** And the union of ''those'' human-model Cylons and the Colonial humans [[spoiler: along with another genetically compatible but unrelated planet of humans leads to the creation of modern human race, namely, ''us'']]
* The Replicators from both ''Series/StargateSG1'' and ''Series/StargateAtlantis'' both use this. The [=SG1=] Replicators as part of their story arc, the Atlantis ones as part of the backstory.
* Referenced in the ''Series/TwoBrokeGirls'' episode "And the Pearl Necklace," with plotlines about a technological upgrade to the way the girls take orders at the diner ''and'' the possibility that a cupcake-backing machine will make their business plan obsolete. Max freely and frequently references the ''Terminator'' and ''Matrix'' franchises.
* Implied with AI Natasha of ''Series/OtherSpace''. In a segment where the crew are reverted to infant forms, she becomes a Pong game. When she loses access to her memory banks her behavior reverts to infancy. Kent is able to advance her development to that of a middle-schooler by re-educating her.
* The declared goal of the Roidmudes from ''Series/KamenRiderDrive'' is this; by copying humans and key emotions, they can further their own advancement, usually in some way tied into the strongest emotion of whomever they initially copied.

* The Makuta in ''Toys/{{Bionicle}}'' evolved from MechanicalLifeforms (with organic parts, akin to WetwareCPU) to EnergyBeings in AnimatedArmor.
** WordOfGod later confirmed that the inhabitants of [[spoiler: Mata Nui's planet-sized robot body]] were originally mindless nanotech before [[AIIsACrapshoot a programming glitch of some kind]] granted them sapience.

[[folder:Video Games]]
* ''VideoGame/EnslavedOdysseyToTheWest'': Robotic dragonflies are said to have "evolved" primitive sensors in order to seek out sources of energy to feed upon.
* ''Franchise/MassEffect'':
** The geth, a "species" of software-based synthetic lifeforms housed in mobile platforms and vast networked servers, have been actively evolving themselves over three centuries since their war with their quarian creators, developing advanced technology that runs a course greatly different from the rest of the galaxy's species. By contrast, most other species are following a common technological path, [[spoiler: exactly as the Reapers want them to]].
** The Reapers consider themselves to be the pinnacle of all evolution (mechanical or otherwise). They see organic life as nothing more than a strange accident, useful only as something to be harvested when necessary to further the development of "true" life. [[spoiler: The Catalyst indicates that this is only partially true, and that part of the point behind the Reapers is to ''prevent'' the evolution of complex synthetic life by destroying organic civilizations before they can reach the singularity that would result in a superpowerful synthetic form of life taking over the galaxy.]] It is implied by Sovereign that [[spoiler: deliberately seeding the galaxy with Reaper technology causes organic life to develop down certain tech paths, which helps the Reapers control and harvest them and stymies the true development of AI.]]
* In both the ''VideoGame/{{Xenogears}}'' and ''VideoGame/MegaManLegends'' video games, the heroes find out that the species on the planet are not humans, but evolved descendants from the biological parts of ancient human technology.
* The Pulverizers in ''VideoGame/ArmoredCore: last raven'', as each one gets defeated a new one is made that's even faster and more powerful than the previous one, with tanks being the weakest and the strongest being a crazy airborne spidery looking thing that gives the alien queen a run for its money. The humanoid one, interestingly, sits in the middle of the spectrum in regards to strength.
* Present in ''VideoGame/MegaManX'' in a rather unique form: all reploids are 'replica androids' derived from the titular X, who was designed with 'limitless potential,' the capability to evolve to (hopefully) overcome any obstacle he was presented with. This makes him simultaneously one of only two [[spoiler:(actually only one)]] people capable of resisting TheVirus and ''extremely'' important to the goals of TheVirus: as he's [[ReluctantWarrior forced to fight]] and evolve, more and more powerful reploids can be made based on him, allowing the species itself to evolve over time. [[TheyWastedAPerfectlyGoodPlot This was mostly ignored]] after the first game in the original version (where it explains a sudden power-up after a HeroicSacrifice) until it became relevant again in the eighth game: the remake of the first game placed more emphasis on it, with the BigBad aware that the more [[OneManArmy X]] fought and stopped their plans to KillAllHumans, the stronger his own forces would become.
* As the opening cinematic for ''[[VideoGame/{{X}} X3: Terran Conflict]]'' explains, {{terraform}}ers are examples of a technology called artificial general intelligence, "mechanical minds capable of [[RecursiveCreators making themselves more intelligent, and again, and again, recursively forever.]]" The intent was presumably to make the robots capable of adapting to unexpected events during the terraforming process, [[AIIsACrapshoot but somebody fouled up a software patch and they went haywire]], turning into the Xenon.
* How the Glitch came to be in the upcoming game, ''VideoGame/{{Starbound}}''. There were originally several other robotic races similar to that built by the same empire on different worlds to simulate sociological and technological progression but they always wound up destroying themselves each time they advanced to a certain point. The exception comes from one planet where, well, [[{{MeaningfulName}} a glitch]] caused them to be [[{{MedievalStasis}} stuck in the medieval times]] which [[{{LuddWasRight}} allowed them to survive for so long]].
* ''VideoGame/BinaryDomain'' has this happen with Hollow Children. [[spoiler: Amanda AI]] created them specifically so that they could [[spoiler: have children and evolve, since it wanted to become a real life form and not merely an unique AI]]
* ''VideoGame/TheTalosPrinciple'': The point of the protagonist's existence and the world it inhabits. The goal of the program is to have the nameless protagonist evolve from a basic AI to a full-fledged artificial consciousness. You're playing either at or near the end of the process, depending on your choices at the end.

* In ''Webcomic/{{SSDD}}'' the Oracle was designed to be self-improving, the rationale being that once it was running and debugging itself the programmers could be fired or imprisoned (they were hackers after all). In fact one of its programmers was an expert in evolutionary algorithms (see below), though he mostly created viruses that could mutate like biological ones.
** Is it any wonder why the Oracle is the only AI capable of [[ContagiousAI copying itself]]?
** It's since been shown that all AI are the "seed" type, but most originate on quantum computers that can't be copied and have blocks (which can be removed) to prevent them from getting too smart.
* The robots from ''Webcomic/GunnerkriggCourt'' are an inversion: they evolved into simpler forms over time. Their creator was a genius, and [[SuperPrototype the designs of his first generation of robots defied understanding]]; so after he died, the robots had to simplify their designs in order to maintain themselves. So, basically, they evolved based on not-Intelligent-enough Design.
** Which is actually closer to biological evolution, since it's the successful form that survives rather than the 'advanced' one.
** And now that Kat is starting to unlock the secrets of the original designs, there is a growing segment among the robots which believes she is literally an Angel.
* The Dig-Bots from ''Webcomic/SluggyFreelance'' keep on reproducing for several years, until they've created several variants like the Brain Dig-Bot, Bouncer Dig-Bots, High Priest Dig-Bots, and Trash Can Dig-Bots.
* Inverted in ''Webcomic/GirlGenius''. Agatha tends to compulsively construct little Clanks termed "[[FanNickname dingbots]]". These dingbots can then go on to construct more dingbots, but dingbots are only so bright, so each successive generation gets less and less advanced, and less bright, and by the third or fourth generation the dingbots produced are nonfunctional.
* In ''Webcomic/QuestionableContent'', [=AnthroPCs=] (robotic companions) can "upgrade" their chassis. This happens at least twice, with Pintsize and Momo-tan, and works in conjunction with the fact that the author of the strip is constantly evolving his artwork.
* In ''Webcomic/{{Nukees}}'' Teri evolved from a custom calculator pet designed to eat other guy's gigapets, to a near-Singularity gestalt that has infected most of the world's major computers. She's a gestalt of thousands of copies with slight variations, which fight one another for influence in the gestalt, Gav's current strategy for stopping Teri is to get an antivirus program high in the hierarchy.

[[folder:Web Originals]]
* ''WebOriginal/OrionsArm'' has many, many examples, including a planet with a machine ecology known as [[ShoutOut Stanislaw.]]
* Music/DoctorSteel believed that robots would eventually evolve to the point where they would replace man, who by that time would have polluted the world so much that only his machine creations would be able to survive anyway. (He even published a paper on the subject.)
* In order to deconstruct the common creationist [[TheWarOnStraw Strawman]] argument that evolution is false because watches do not build themselves from smashed parts[[note]]which completely ignores the fact that watches don't reproduce, so they can't evolve[[/note]] cdk007 made a video, [[http://www.youtube.com/watch?v=mcAq9bmCeR0 Evolution IS a Blind Watchmaker!]], in which he wrote a computer program that simulated clocks evolving from their parts, with results that look as though they could have been specifically designed, but in fact, were not.

[[folder:Western Animation]]
* On ''WesternAnimation/JusticeLeague'', AMAZO's ability to evolve was so potent that by his second appearance he had even evolved beyond being a machine.
* In the ''WesternAnimation/{{Futurama}}'' episode "A Clockwork Origin", Professor Farnsworth releases some {{Nanomachines}} to purify water on an uninhabited planet. Subsequent generations of nanites are more complex, and the situation very quickly gets far out of hand. By the end of the episode they've evolved into SufficientlyAdvancedAliens.
* In ''WesternAnimation/BeastWars'', the Autobots and the Decepticons decided to change to more energy-efficient forms called the Maximals and the Predacons, respectively, in an event called The Great Reformatting.
* The ''WesternAnimation/SamuraiJack'' episode "The Tale of X9" starts with X9 telling how Aku's evil scientists developed their master's robot armies. The first ones were "crude", one resembling a bunch of junk in a vaguely robotic form with wheels, then a "cleaner" version of that one, then a rickety, fully-humanoid robot, then one that seemed like a typical robot soldier. Finally they came up with the model which X9 is, which seemed to be the first efficient models, used as assassins. Eventually, this model was retired in favor of the Beetle-Bots that are usually seen in the series proper.

[[folder:Real Life]]
* Programmers use [[http://en.wikipedia.org/wiki/Evolutionary_algorithm evolutionary algorithms]] to improve on designs.
** And the concept behind [[http://en.wikipedia.org/wiki/Seed_AI Seed AI.]]
** There is also this article about [[http://www.newscientist.com/article/dn11248-robot-swarms-evolve-effective-communication.html colony]] [[http://www.popsci.com/scitech/article/2009-08/evolving-robots-learn-lie-hide-resources-each-other robots.]]
* The "evolution" of the automobile through the years ([[ItMakesSenseInContext along with]] ''MickeyMouse's'') has been used as a parable of biological evolution in educative works.
** YMMV on whether or not this is logical. It's certainly an example of evolution (change over time) but the analogy would really be for Intelligent Design (at least if the designer was doing it on the fly each generation) than for Natural Selection (or some combination there-of if that even makes sense: an intelligent designer deciding which traits to continue, which to change, and what new things to add based on the competition between models and market forces)
* In his book ''TheSingularity Is Near'', Ray Kurzweil introduces a theory of EvolutionaryLevels with biology and technology as two of them.