7 ms·
While this is very cool, using the distance each invader survives as the fitness score seems like maybe not the best choice for this scenario. With so many inv
by NickBusey 8y ago
While this is very cool, using the distance each invader survives as the fitness score seems like maybe not the best choice for this scenario.
With so many invaders spawning at the same time, and the 'bullet' you shoot moving so slow, the last invader to be destroyed seems to me to be a result of random choice (which one did you get around to shooting last) rather than it being any 'healthier' than the other invaders.
I don't really have a suggestion on how to improve it other than maybe slow down the vertical progress of the invaders and speed up the bullet so that distance made vertically is actually tied more closely to it's ability to evade your shots.
- atum47 8y agoYes, and the last one who survived moved in a way that helped it survive. It's not the best one the ones who reproduce, they all can reproduce, the ones who got closer or went through have more chance.
- NickBusey 8y agoNo, I'm saying even if they didn't move, there would still be a last one to survive, just based on the time it takes to shoot them.
- atum47 8y agoNo, their fit score is how close they got to crossing the finish line. If they don't move, they got no score. If they move in a straight line and still manage to win, hey, that's life. I've observed that the ones who jiggle around are the ones that wins the most.
- NickBusey 8y agoIf they didn't move left to right I mean.
- atum47 8y agoBut do you agree that if they don't move, they will the ones easier to shoot? So, unless you are sparing them, they won't go very far and will have less chance of reproduction.
- NickBusey 8y agoOf course, but I'm just saying there are so many of them and they are so hard to shoot due to the slow bullet time and only one bullet, that the left to right movement is not making as big of an impact as it could. I would say just give a try at slowing down the vertical progress, remove the one bullet at a time restriction, and see how that goes. Not trying to be negative at all, I think it's a great project and the code looks to be very clean. Nice work.
- mrtnmcc 8y agoOn average, over many plays, the random aspects of the scoring you are concerned about will average away and the useful traits will be reinforced. Just like evolution.
- NickBusey 8y agoOver many plays, sure, but how long should one person have to sit there to see results? As far as I can tell, there is no persistence between sessions. I'm saying making the game 'easier' for the player would decrease both the number of plays needed to get better evolutionary results and also decrease the time between each evolutionary cycle.
- tenken 8y agoWho said evolution was fast?! ... Or easy?! :D I've used GAs before in school. One example way to do even session-less evolution faster would be a distributed client/server model where the indivual survivors across all game instances who are lasting the longest are crossbred but that would take longer to code ....
- thaumasiotes 8y ago> using the distance each invader survives as the fitness score seems like maybe not the best choice for this scenario > With so many invaders spawning at the same time, and the 'bullet' you shoot moving so slow, the last invader to be destroyed seems to me to be a result of random choice (which one did you get around to shooting last) rather than it being any 'healthier' than the other invaders. I couldn't disagree more. The fitness score is correct, because the invader wins by covering distance. What happens by chance early will happen by design late -- that is nearly the entire concept of evolutionary approaches. They always improve on their fitness function, and what matters is that you chose the right one. In this case, improving on the distance invaders travel is the point of being an invader, and the point of the game, so that distance is very obviously the correct fitness function.
- NickBusey 8y agoI said 'for this scenario', I suppose I should have been more clear. In my post I go on to list ways to change the scenario so it does fit the fitness function. I do agree the fitness function is probably correct, but the rest of the implementation doesn't match it.
- flashman 8y ago> the invader wins by covering distance The invader wins by crossing the baseline. This fitness function lets me use evolution against the invaders by letting the dumbest ones approach the baseline before killing them, making future waves easier than if I killed the easiest invaders first. Perhaps the fitness score could include the number of projectiles that passed nearby without impacting, as a measure of difficulty to hit.
- thaumasiotes 8y ago>> the invader wins by covering distance > The invader wins by crossing the baseline. Both are true, but covering distance is a better fitness function because it is continuous and crossing the baseline is discrete (and not just discrete -- binary). Your strategy can make the difficulty rise more slowly than otherwise, but it can't make the difficulty plateau or drop.
- Someone 8y ago”the last invader to be destroyed seems to me to be a result of random choice” There’s a simple strategy that guarantees you won’t be the first to die: hide behind the back of your biggest buddy. I think that would be my strategy, plus “if a bullet that’s going to kill your ‘shield’ is on its way, figure out whether you can find a new shield; if not, make a run for it. The existence of such a strategy shows the result isn’t completely random. (Of course, there also is a prisoner’s dilemma here: if everybody follows that strategy, the swarm would run away from you, and nobody would gain any fitness)
- ReverseCold 8y agoYup, it seems like you can game it by looking for the easiest one and waiting till the very end to hit it.
- caf 8y agoIsn't that part of the... game?
- drivers99 8y agoIn other words, AI domestication. Interesting concept! (Allowing it to live longer being the equivalent of breeding.)
- middleman90 8y agoWell... they could learn to look "stupid" and be smart at the very end of the game
- tgirod 8y agoI agree with you. When I play, the "best" invaders tend to be the easy targets that have drifted to one side of the screen. Here is a proposal for another fitness score: everytime a bullet is shot, raise the score of every survivor, weighted by the distance between the survivor and the bullet. The closer the bullet the better the fitness. Intuitively, I think this would select for better dodgers.
- Hei1Fuya 8y agoBut dodging is just a subgoal and margin is not all that relevant. The actual goal is to defeat the player, if dodging by a slim margin happens to be the best strategy then that should not be penalized.