You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 12, 2023. It is now read-only.
1) Donwload and run executable (for your OS) in Releases.
28
+
1) Application is hosted at `localhost:3000`.
29
+
1) Click start
30
+
1) Wait until some training is done (Calculations done is recommended to be at least 20,000)
31
+
1) Click stop
32
+
1) Click play to see results (game is played between two best bots)
33
+
1) Training can be resumed by clicking Start again
26
34
27
35
# compiling
28
36
## requirements
@@ -37,11 +45,47 @@
37
45
-```yarn ci``` or ```yarn install``` (if not called already)
38
46
-```yarn dev```
39
47
40
-
# Running
41
-
open Start.exe
42
48
49
+
## Application
43
50
44
-
## Usage
51
+
This project was changed from racing game into duel game of two bots. (See old).
52
+
53
+
### UI
54
+
55
+
Left side contains list of cards with best bots. Left side contains name of bot, blue bar with bonus and red bar with health. Right sides contains number of games bot played, number of bots wins, number of childrens (mutated compies of this bot) and steps from it's last game.
56
+
Right side contains player which replays duel of best two bots.
57
+
58
+
59
+
### Evolutionary algorithm
60
+
61
+
First version of this project used game for one player. Newer version introduces duel game, which cause problems with evolving bots. Instead of incrementaly improving bots fitness and approximating some theoretical fitness boundary, bots was oscilating in low and high values. It was probably caused by switching between two (or possibly more) strategies, instead of improving existing ones.
62
+
63
+
Problem with oscilating was so unexpected for me and I didn't manage to find online solution for this kind of problem using neural nets and evolutinary algorithms. So I have used method which does not use generation but is pruning and creating new bot's in one same population (method probably called _live learning_ or similar).
64
+
65
+
Despite the fact of using method of learning that better suits this particular game problem, training works best with used super parameters inside source of this project and even minor tweak in value of some of super parameters can make learning process fail. Suggested next step to improve learning process would be using some other machine learning method as meta learning to find best super parameters for this project.
66
+
67
+
Bot has _sensor*2 + 2_ neural net input values. Each sensor has type of detected object and range of that detection. Last two inputs are bots health and cooldown for shooting weapon.
68
+
69
+
#### Algorithm
70
+
71
+
Every bot has it's own health and bonus score. Bot's health is increased proportionally to health at end of each game. If bots health exceedes max-health, exceeding healths is added into bonus score instead. score is also increased when population is low (and lowered when population is high), so population can be kept in comfort range for training.
72
+
73
+
Algorithm step
74
+
1) Select two random bots ramdomly. Using weighted random -> weight is increased by: steps from last game, wins and other bot properties.
75
+
1) Play game with selected bots
76
+
1) Increase/Lower their health base on game result.
77
+
1) Transfer exceeding health into bonus.
78
+
1) Remove bots with no health.
79
+
1) Reset bonus metter and create mutated copy of bot for bots with maxed bonus
80
+
81
+
### Game
82
+
83
+
Each player is in his corner facing into center of map at start of each game. Bots has sensor attached asi inputs to their neural nets. Players health decreases each game step (motivation for bots to play aggressive -> faster the game is, lower the damage bot gets from game itself). Player can walk straight, rotate and shoot. Bullets can bounce and their damage is proportional to their speed. Motionless bullets are destroyed.
84
+
85
+
86
+
## old (racing) version documentation
87
+
88
+
Code documented in this section is already deleted. This documetation is only for comparisson with newer version of bot.
45
89
46
90
Learning steering car inside 2D using genetic algorithm
47
91
@@ -66,9 +110,3 @@ controls:
66
110
67
111
Pressing Start will start algorithmic calculations (can take some time). Plot wiht maximal fitnesses is shown when algorithm is done running.
0 commit comments