
Show HN: InvaderZ is now available to play on itch.io - atum47
https://victorqribeiro.itch.io/invaderz
======
fxtentacle
I believe you should have mentioned the evolutionary algorithm, so that people
know why this is on HN.

BTW, here's my own retro arcade game: [https://fxtentacle.itch.io/space-
dance](https://fxtentacle.itch.io/space-dance)

~~~
atum47
you're right, InvaderZ implements GA to evolve the enemies.

source code:
[https://github.com/victorqribeiro/invaderz](https://github.com/victorqribeiro/invaderz)

~~~
fxtentacle
From what I understand, the GA is used for the shape, and then the shape
determines both where it can be hit and also its movement pattern.

[https://github.com/victorqribeiro/invaderz/blob/1e4512c336b9...](https://github.com/victorqribeiro/invaderz/blob/1e4512c336b9be8368b8b6ca476548312532c5c4/js/Invader.js#L26-L33)

My guess would be that the "ideal" invader is fully transparent. Can that
happen?

~~~
atum47
roughly speaking I guess there is a 1/(0,5^16) of that happening. I wrote the
code back in 2018. I don't fully remember it. I just decided to share on
itchio yesterday.

~~~
ouid
well if the genetic algorithm is good enough, you might imagine that it was
more likely.

~~~
atum47
after each 7 generations the game creates new enemies and kinda uses elitism
to preserve only the very best from the past 7 generations

------
haolez
This remembers me of a game called "Warning Forever"[1], which is immensely
fun and implements the same kind of approach seen here: your enemy evolves via
machine learning to exploit your weaknesses and protect itself against your
strengths.

[1][https://en.wikipedia.org/wiki/Warning_Forever](https://en.wikipedia.org/wiki/Warning_Forever)

------
frompdx
Interesting idea. I like the minimalist approach. My feedback is the firing
cool down period should be much shorter. As fast as the player can hit the
space bar. The enemies should move faster as well. At the moment the game
feels difficult in an arbitrary way because of the artificial latency while
firing.

~~~
riffraff
this was my same impression, I really wanted to see the evolution but it felt
too frustrating to play and I just gave up at generation 4.

~~~
atum47
if any of you could please open a issue on GitHub I'll take a look as soon as
I'm free

------
andrelaszlo
I tried two strategies:

1\. Kill the ones that seem to move the fastest, hoping it would lead to very
peaceful enemies over time.

2\. Kill them from left to right each round, hoping they would all start
gathering at the right hand side of the screen.

Neither seemed to do anything special, they seem to just be moving randomly
and I get to level 60 or so before I get too bored.

I don't understand what it's supposed to do. Am I doing it wrong? :D

~~~
atum47
after 7 generations I discard them all with the exception of the best one from
the past 7 generations. this so the player faces new enemies. you're probably
doing well killing them all.

------
bestest
Started feeling kind of boring at gen 20 — it was just the same all the time.

Maybe the pace is really too slow.

