Evolution Simulator

A Slide Rule, a Sundial, and a Physicist walk into a bar
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Evolution Simulator

Post by robly18 »

A Random Player wrote:

Code: Select all

            ^
            ^   S
            ^
  >>>>>>>>>>^  S
  ^
  ^ TX T  T  T  S  S
  ^  |
  ^<<<<<<<<<<
            ^
            ^
            ^
Key:
T,S: Towers
>^<v|X: Path
One problem I was thinking about: The enemies might follow the arrowed path, even after when you sell the S towers, because trying to modify the path a little bit gets too close to the T towers (see |X). Would this be solved by periodically bringing back old enemies, or keeping it in there as a "strategy"?
How about an inability to sell towers?
Convincing people that 0.9999... = 1 since 2012
User avatar
testtubegames
Site Admin
Posts: 1156
Joined: Mon Nov 19, 2012 7:54 pm

Re: Evolution Simulator

Post by testtubegames »

robly18 wrote:
A Random Player wrote:

Code: Select all

            ^
            ^   S
            ^
  >>>>>>>>>>^  S
  ^
  ^ TX T  T  T  S  S
  ^  |
  ^<<<<<<<<<<
            ^
            ^
            ^
Key:
T,S: Towers
>^<v|X: Path
One problem I was thinking about: The enemies might follow the arrowed path, even after when you sell the S towers, because trying to modify the path a little bit gets too close to the T towers (see |X). Would this be solved by periodically bringing back old enemies, or keeping it in there as a "strategy"?
How about an inability to sell towers?
Or we could keep this in (as a strategy), but occasionally have rounds with extreme mutations. That way the enemy could still overcome that strategy. The trick would be finding a nice balance of what 'extreme' mutations really mean.

At the moment, though, having un-sellable towers seems like a more straightforward solution.
User avatar
testtubegames
Site Admin
Posts: 1156
Joined: Mon Nov 19, 2012 7:54 pm

Re: Evolution Simulator

Post by testtubegames »

Since I'm apparently easy-to-distract... this evening I made a quick prototype of this game style. Very, very basic, just enemies that come in and have a path that evolves from one round to the next. There's even a 'goal' they're 'trying' to get to. The best path each round is shown in green, and that becomes the black 'seed' path for the next round.

For extra funsies, you can add in towers, too.

You'll find it here!

Note: The 'game' is nowhere near balanced or anything, you can easily win by placing a buncha towers. The enemies don't get stronger. I was just intrigued by this game idea and wanted to have something tangible for us to refer to/tweak.
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Evolution Simulator

Post by robly18 »

testtubegames wrote:Since I'm apparently easy-to-distract... this evening I made a quick prototype of this game style. Very, very basic, just enemies that come in and have a path that evolves from one round to the next. There's even a 'goal' they're 'trying' to get to. The best path each round is shown in green, and that becomes the black 'seed' path for the next round.

For extra funsies, you can add in towers, too.

You'll find it here!

Note: The 'game' is nowhere near balanced or anything, you can easily win by placing a buncha towers. The enemies don't get stronger. I was just intrigued by this game idea and wanted to have something tangible for us to refer to/tweak.
This is already amazing. However, the evolution could be a tad faster and more random as opposed to getting closer to the target.
Convincing people that 0.9999... = 1 since 2012
19683
Posts: 151
Joined: Wed Jun 05, 2013 12:15 pm

Re: Evolution Simulator

Post by 19683 »

testtubegames wrote:Since I'm apparently easy-to-distract... this evening I made a quick prototype of this game style. Very, very basic, just enemies that come in and have a path that evolves from one round to the next. There's even a 'goal' they're 'trying' to get to. The best path each round is shown in green, and that becomes the black 'seed' path for the next round.

For extra funsies, you can add in towers, too.

You'll find it here!

Note: The 'game' is nowhere near balanced or anything, you can easily win by placing a buncha towers. The enemies don't get stronger. I was just intrigued by this game idea and wanted to have something tangible for us to refer to/tweak.
You could also add enemies that go through towers.

You could also add "smart" enemies that "calculate" the shortest path, but don't reveal the path to normal enemies.
Binomial Theorem: ((a+b)^n)= sum k=0->k=n((n!(a^(n-k))(b^k))/(k!(n-k)!))
A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: Evolution Simulator

Post by A Random Player »

testtubegames wrote:Since I'm apparently easy-to-distract... this evening I made a quick prototype of this game style. Very, very basic, just enemies that come in and have a path that evolves from one round to the next. There's even a 'goal' they're 'trying' to get to. The best path each round is shown in green, and that becomes the black 'seed' path for the next round.

For extra funsies, you can add in towers, too.

You'll find it here!

Note: The 'game' is nowhere near balanced or anything, you can easily win by placing a buncha towers. The enemies don't get stronger. I was just intrigued by this game idea and wanted to have something tangible for us to refer to/tweak.
Cool! But it evolves a bit too slow (for me at least :lol:). Maybe send creatures faster, and add a few more per round.

And the fitness function is kind of weird.

Code: Select all

          v           |
          v           |
         /            |
T T T T T T T T T     |
        |             |
        |             |
        |             |
     T T|T T T T T T T|
       /
      / 
    G
The creatures refused to go right at all, and even putting a tower in their path made them go only enough to avoid it. Maybe larger mutations and more creatures? Or maybe using a non-grid-based-movement-system would fix some of it.

Overall, awesome!
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
User avatar
testtubegames
Site Admin
Posts: 1156
Joined: Mon Nov 19, 2012 7:54 pm

Re: Evolution Simulator

Post by testtubegames »

A Random Player wrote:And the fitness function is kind of weird.
Yeah, I think that's the core of the problem. At the moment, it is simply 'who gets closer as the crow flies.' But of course, that is very likely to bring the creatures to some dead-end that is near the goal... instead of getting them to wind around passages/towers to reach the goal. I could make the towers solid, then judge their fitness not as how-the-crow-flies, but as how-they-could-optimally-walk.

Still, there's probably a more innate problem here, too. We're also seeing what we were discussing before -- once the creatures evolve to find a local minimum (d to goal), it's unlikely they'll pass to another local minimum. (as in the selling-of-towers discussion) This is true for whatever fitness function we end up using.

(On another note, I can definitely throw a bunch more enemies into the game each round, too, to get them to evolve faster for us)
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Evolution Simulator

Post by robly18 »

Still, I always imagined the game would turn out to be a 2d game where creatures like the ones from the prototype would try to get to the end and your goal would be to place obstacles like boxes and the likes to try to stop them.
Convincing people that 0.9999... = 1 since 2012
User avatar
testtubegames
Site Admin
Posts: 1156
Joined: Mon Nov 19, 2012 7:54 pm

Re: Evolution Simulator

Post by testtubegames »

Alright, a new and improved version!

There are more creatures per round, they appear a lot more rapidly, and thus evolution speeds up a bit. Most importantly, I changed the fitness function. Now, instead of 'breeding' based on the as-the-crow-flies distance, the sim treats the towers as impassable obstacles (I also overpowered them, so truly they are impassable) and calculates the true 'walking' distance a creature is from the goal. That way we don't wind up with the same dead-end problems.

In fact, take a look at the creatures dodging a couple rows of towers.
evolutionShot.png
evolutionShot.png (52.49 KiB) Viewed 31384 times
Of course, it ah, ahem, took 57 rounds for them to find their way to the goal. The 'mutation' algorithm is still very basic, you'll notice creatures doing a lot of circles, or doubling back on their path. So once that's improved, it will certainly speed things up. But in principle, it's working. The creatures find paths to avoid (a couple rows of) towers.
robly18 wrote:Still, I always imagined the game would turn out to be a 2d game where creatures like the ones from the prototype would try to get to the end and your goal would be to place obstacles like boxes and the likes to try to stop them.
Me too! I'd like to polish that game up when I get a chance, I'm sure you all could help me bring that sim up to par (especially if I can get a version in front of you).
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Evolution Simulator

Post by robly18 »

This is pretty better than the old one! However, a slight issue I appear to run into EVERY SINGLE TIME I try to make them any sort of maze:
Image

EDIT: Okay, I appear to have it *kind of* figured out. If I block them from going to the end, they spaz out like this. However, the issue is that they keep spazzing out even after I pressed R. I had to refresh the page to have it work.
Convincing people that 0.9999... = 1 since 2012
Post Reply