{"id":29200046,"url":"https://github.com/deontologician/evofighters","last_synced_at":"2025-07-02T10:03:50.172Z","repository":{"id":2675223,"uuid":"3667197","full_name":"deontologician/EvoFighters","owner":"deontologician","description":"Genetic evolution of little fighting AI's","archived":false,"fork":false,"pushed_at":"2018-04-04T15:30:52.000Z","size":923,"stargazers_count":15,"open_issues_count":12,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-04-13T20:31:16.671Z","etag":null,"topics":["evolution","rpg-game","rust","simulations"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deontologician.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-09T03:42:04.000Z","updated_at":"2021-12-29T19:06:49.000Z","dependencies_parsed_at":"2022-09-16T03:40:24.280Z","dependency_job_id":null,"html_url":"https://github.com/deontologician/EvoFighters","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/deontologician/EvoFighters","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deontologician%2FEvoFighters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deontologician%2FEvoFighters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deontologician%2FEvoFighters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deontologician%2FEvoFighters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deontologician","download_url":"https://codeload.github.com/deontologician/EvoFighters/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deontologician%2FEvoFighters/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263117999,"owners_count":23416350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["evolution","rpg-game","rust","simulations"],"created_at":"2025-07-02T10:03:49.448Z","updated_at":"2025-07-02T10:03:50.143Z","avatar_url":"https://github.com/deontologician.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n   __             ___\n  /              /    /      /    /\n (___       ___ (___    ___ (___ (___  ___  ___  ___\n |     \\  )|   )|    | |   )|   )|    |___)|   )|___\n |__    \\/ |__/ |    | |__/ |  / |__  |__  |     __/\n                       __/  1.0\nJosh Kuhn \u003cdeontologician@gmail.com\u003e\nEvolving fighting bots\n\nUSAGE:\n    evofighters [OPTIONS] [SUBCOMMAND]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -f, --file \u003cSAVEFILE\u003e    Name of save file [default: evofighters.evo]\n\nSUBCOMMANDS:\n    cycle-check    Does a cycle detection on the given bases\n    help           Prints this message or the help of the given subcommand(s)\n    simulate       Main command. Runs an evofighters simulation\n```\n\n## What is this?\n\nThis is a simulation I've written on and off over several years. It's\nfundamentally about little bots with a very simple fighting\nsystem. They attack, defend, pick up items, and occasionally try to\nmate with each other.\n\nWhen they mate, they combine their dna similar to how sexually reproducing\norganisms in real life do, randomly selecting genes from each of the\ntwo parents. There's a chance of different kinds of mutations like\ngene swaps, transcription errors and the like.\n\nOnce you have replication, a competitive environment, and mutations,\nyou get evolution. It's not super sensitive to starting conditions, it\njust works and is kind of fun.\n\n## How it works\n\nThere are some rough phases the simulation occurs in for each creature:\n\n1. Creating a new creature, which randomly chooses between each pair\n   of genes from the parents. It also has a chance of random mutation.\n2. Compiling/Parsing, which iterates through the bases of the\n   creature's dna, and builds an ast with the creature's program for\n   how to behave in an encounter. The parsing process is very\n   forgiving: if the next base isn't a valid value for the next term,\n   we just skip it and go on to the next base. If we reach the end of\n   the dna, we wrap around to the beginning. If parsing takes too many\n   steps we abort.\n3. Evaluation, when the creature is in an actual encounter with\n   another creature. The parsed ast is evaluated in the context of the\n   fight (some variables depend on the opponent, some are random, so\n   can't be done ahead of time). The outcome of this is a decision for\n   which action the creature should take.\n4. The creature takes an action. The 3 most interesting actions are\n   attacking, defending and mating. Mating requires some reciprocity\n   and some spare energy (otherwise you could create something from\n   nothing and mating constantly would be the best strategy to pass on\n   genes). Fighting allows you to gain energy if you win, but if the\n   opponent is smart and defends correctly against you, you will\n   expend resources fighting and not get anything in return.\n\nThere is an initial population of creatures, with a bootstrapped DNA\nthat parses out to \"Turn 1: Try to mate. Turn 2: Flee\". This is a\nreasonable starting point since it ensures mating gets off the ground\n(can't evolve if you don't reproduce), but it also ensures short\nfights since they flee right afterward (and don't waste all of their\nenergy trying to mate over and over again).\n\nFor each encounter, two random creatures are selected from the\npopulation, and pitted against each other. The fight is given a\nrandomized maximum number of rounds to last. Then the creatures go at\nit, fighting or mating as their dna instructs them.\n\n## History\n\nI initially wrote a version of this in python. Being a simulation\nthough, it needed to run fast, so I made it work in pypy. I left the\nproject alone for a while.\n\nWhen I came back about 3 years later, I rewrote the main portion of it\nin pre-1.0 rust. It used several experimental extensions which were\nnever standardized. But I made some advances over the initial python\nversion. Mostly in speed, but also I wrote a clever compiler that\nallowed precompiling and simplifying a creatures genes. Previously,\nevery time a fight was run, some evaluation/parsing occurred. Then I\nleft the project alone for a while.\n\nWhen I came back about 3 years later, I fixed almost all of the\npre-1.0 problems and got it almost working in standard rust. The only\nissue was that standard rust still didn't have box pattern syntax,\nwhich was really useful for digging through deep recursive data\nstructures. So, we're on nightly rust, and only using two language\nextensions (`box_syntax` and `nll` which is actually expected to be\nstandardized).\n\n## Contributing\n\nThis is mostly a fun project for me. I don't actually think it's\nuseful for anyone else, nor is it very interesting to watch. The fun\nof it is developing it and seeing what kinds of strategies the\ncreatures come up with after millions of generations.\n\nSo, since the goal isn't actually to create useful software, but to\nenjoy the process, I don't really forsee a need to accept\ncontributions. That being said, if you want to fork this, be my guest,\nand if you feel like contributing, feel free to open up an issue and\nwe can talk!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeontologician%2Fevofighters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeontologician%2Fevofighters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeontologician%2Fevofighters/lists"}