winzip icon

EVO Battle V5

Email
Submitted on: 2/20/2015 6:25:00 PM
By: reexre (from psc cd)  
Level: Intermediate
User Rating: By 4 Users
Compatibility: VB 6.0
Views: 1443
 
     EVOLUTION BATTLE v5 (Neural Network trained by genetic algorithm) Two teams; a Red one and a Cyan one fight to win battles. Orange one is the "previous battle" best of the Red team. Green one is the "previous battle" best of the Cyan team. (The nearest enemy shot of the "previous battle" best fighter of the Red team is yellow circled) At the End of each battle the team that loses Evolves (The winner team evolves with a Probability of 10%) Each fighter have 11 Inputs and 3 Outputs: Inputs Are: -Enemy Left (0 means Nearest enemy is in front. 0.5 Means Nearest enemy is At 90° Left. 1 Means Nearest Enemy is Back) -Enemy Right (0 means Nearest enemy is in front. 0.5 Means Nearest enemy is At 90° right. 1 Means Nearest Enemy is Back) -Enemy Distance -Enemy Shot Left (As Enemy Left but Refers to "Enemy Shot") -Enemy Shot Right (As Enemy Right but Refers to "Enemy Shot") -Enemy Shot Distance -Availbale Shots -Enemy Relative Orientation -My Velocity -Enemy Velocity -Enemy Relative Moving Direction Outputs Are: -Rocket Left -Rocket Right -Fire Shot (Less than 0.5 do not fire, more than 0.5 Fire) Each fighter have a maximum number of shots that can be fired simultaniously with a given delay. (Now it's set to 1 shot at a time) When fired shot reach the Boundary or hit an enemy it expires. If a fighter hits an enemy with a shot then the fighter Fitness Value is decreased. The hitten enemy is pushed by shot, his fitness increase and it can't perform normal movement for a given time (it's frozen) and his Fitness Value is increased (In this case It's drawn with a cross).(After a fighter has been hitten it becomes "Invisible" to the enemies for a time greater than the time he can't move [frozen]) The team that have the lower avarage fitness wins. (Fitness Value Start from 8000 for each fighters) Fitness is displayed with a line under the fighters. If it is good (low fitness), the line go to Right for the Red team, to Left for the Cyan team. If it is bad (high fitness), the line go to Left for the Red team, to Right for the Cyan team. Evolution is performed by genetic algorithm that modify the genes of fighters. The Genes are the values of a Neural Network wich have the above described Inputs & outputs. Neural Network activity of the "previous battle" best of the Red team (Yellow one) is displaied on a picture. Be patient, the Results of the evolution is noticiable after a long time running (a lot of generations). Program can be stopped and restarted. At the restart (both team) last Evolved fighters are loaded. (Files: Pop1.txt and Pop2.txt) One or both of these files can be deleted to start a new random team population. Enjoy!

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com


Other 30 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.