Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment  (Read 3590 times)

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« on: August 29, 2015, 05:04:36 pm »

I'm sure many of you have fiddled with boxcar2d at some point or other. Well, the Genetic Algorithm 2d Car Thingy is just like that, except it's written in HTML5, so it can be run on virtually anything (even mobile phones without Flashplayer support).

For those that haven't, it's more or less what it says on the can. It makes little two wheeled cars with varying attributes, runs them over a length of terrain (with bumps and hills, etc), finds which cars got the furthest, keeps them, breeds them together and mutates them slightly, and then runs the whole simulation over again. If the next generation of cars did better, then great. If not, it keeps doing it until they do.

So yes, genetics with cars. It's quite fascinating.

But now, onto the challenge (or experiment really, since you can't make user changes in this version, unlike boxcar2d).

You can use a string to seed the initial track along with other options available. In time honoured tradition, we could use "bay12" as our initial seed and compare distances travelled by our own mob of genetically (im)perfect cars, just for giggles.

You can leave it running on your PC or phone overnight (just set the dev options on your phone to Stay Awake while charging). You can save results locally and run the sim later as well. And if we're all using the same track, then we can compare results. For, umm, science? I don't know. Mainly just to see how alike the better cars are, or how different.

So yes. I chose this version of boxcar due to compatibility, ability to save locally, and because it works. It's not as "good" as boxcar2d, isn't interconnected like another version, but it works.

So settings:

Go to "Create new world with seed". Enter "bay12", without the quotes, all lowercase.

Make sure the "Floor" option is set to "fixed".

Gravity set to Earth 9.81

Change whatever other options you'd like. It's probably best to save every few hours or so, in case it crashes.

Compare results, and take screenshots if possible.
------------

The track isn't bad, but like all of them, it gets worse the further your cars make it.

Here's the website url to try it out:

http://rednuht.org/genetic_cars_2/

Why waste all that computing power on your table or sitting in your pocket all weekend, when you could be breeding boxcars with them?
« Last Edit: August 31, 2015, 10:53:46 pm by sambojin »
Logged
It's a game. Have fun.

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge
« Reply #1 on: August 29, 2015, 05:11:27 pm »

So far my best is:

Top Scores:
#1: 139.01 d:134.01 h:0/7.6m (gen 24)

And I'm running generation 29 as I type this (it's slow on a phone, but it works).
Logged
It's a game. Have fun.

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #2 on: August 29, 2015, 06:21:22 pm »

And, a genetic breakthrough is achieved. The track gets worse. Much worse.

Top Scores:
#1: 149.68 d:144.41 h:0/7.86m (gen 34)
#2: 139.23 d:134.58 h:0/6.92m (gen 33)
#3: 139.01 d:134.01 h:0/7.6m (gen 24)
#4: 138.35 d:133.01 h:0/6.76m (gen 30)
#5: 138.15 d:132.71 h:0/6.67m (gen 28)
#6: 137.7 d:132.96 h:0/6.5m (gen 29)
#7: 136.78 d:132.69 h:0/6.5m (gen 21)
#8: 135.71 d:130.63 h:0/7.02m (gen 22)
#9: 133.12 d:128.01 h:0/6.55m (gen 25)
#10: 132.99 d:127.94 h:0/6.27m (gen 26)

A combination unicorn/banana car seems the best out of my lot so far.

((and... it didn't save properly. So I'm back to gen 20: Banana Cars only. At least I'll get to see if there are several types possible for good distances.))
« Last Edit: August 29, 2015, 06:36:44 pm by sambojin »
Logged
It's a game. Have fun.

My Name is Immaterial

  • Bay Watcher
    • View Profile
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #3 on: August 29, 2015, 06:27:39 pm »

Top Scores:
#1: 159.44 d:156.05 h:0/10.11m (gen 48)
#2: 159.25 d:156.24 h:0/9.36m (gen 47)
#3: 156.94 d:150.23 h:-0.16/9.63m (gen 39)
#4: 156.44 d:150.37 h:-0.16/9.81m (gen 42)
#5: 156.3 d:150.37 h:-0.16/9.84m (gen 37)
#6: 155.4 d:150.32 h:-0.16/9.67m (gen 43)
#7: 155.16 d:150.47 h:-0.16/10.46m (gen 38)
#8: 154.85 d:150.31 h:-0.16/10.14m (gen 45)
#9: 154.81 d:150.39 h:-0.32/10.06m (gen 35)
#10: 154.77 d:150.25 h:-0.16/10.14m (gen 50)
Only at Gen 50. Will update as I continue.

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #4 on: August 29, 2015, 07:03:40 pm »

Eh, you usually end up with the same thing every time, especially if the terrain changes each time.

Fun fact: I once bred cars so far on a static track that eventually one got over a big wall made by the increasing randomness and fell down several kilometers, where the terrain just disappeared.
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #5 on: August 29, 2015, 07:48:05 pm »

Well, I've got mine up to about the same bit as they were before. Except the car looks quite different (modified banana/igloo car), the wheels are very different sizes, and it got there quicker (generation 20->30 instead of generation 1->38, same gen 20 point though), so there is at least some variance on how you get there.

The end result may be the same though.
Logged
It's a game. Have fun.

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #6 on: August 29, 2015, 08:31:29 pm »

Generation #34: No retards allowed.

Everyone made it to 80+ metres, a rarity, and I've almost caught up to Immaterial. A highly ridiculous overall blue average of about 130 metres.

Top Scores:
#1: 154.97 d:150.36 h:-0.35/6.92m (gen 34)
#2: 151.15 d:146.11 h:-0.03/8.15m (gen 31)
#3: 148.94 d:143.96 h:-0.35/6.63m (gen 33)
#4: 148.92 d:144.3 h:-0.35/6.77m (gen 32)
#5: 148.61 d:144.53 h:-0.35/6.85m (gen 30)
#6: 138.46 d:133.83 h:-0.35/6.7m (gen 28)
#7: 137.99 d:134.07 h:-0.35/6.74m (gen 27)
#8: 137.43 d:132.56 h:-0.02/6.6m (gen 29)
#9: 136.49 d:132.54 h:-0.35/6.44m (gen 26)
#10: 135.74 d:132.32 h:0/6.58m (gen 22)
Logged
It's a game. Have fun.

Itnetlolor

  • Bay Watcher
    • View Profile
    • Steam ID
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #7 on: August 29, 2015, 09:35:26 pm »

Mutation Rate: 30%
Mutation Size: 50%
Elite Clones: 3

As of Generation 30:

The dirt bikes are dominating the competition.
Average die-off is between 100-110 meters, and it's because of that obnoxious double-hill. (10 cars are left by this point)

Top Scores: (Gen 30) (Dirt Bikes (Skinny Cycles))
#1: 149.48 d:143.98 h:0/7.28m (gen 25)
#2: 149.46 d:143.93 h:0/7.28m (gen 19)
#3: 149.39 d:144.29 h:0/7.23m (gen 15)
#4: 140.67 d:134.89 h:0/6.73m (gen 13)
#5: 140.6 d:134.9 h:0/6.68m (gen 27)
#6: 140.59 d:134.91 h:0/6.69m (gen 29)
#7: 139.73 d:134.94 h:0/6.68m (gen 17)
#8: 139.64 d:134.92 h:0/6.68m (gen 23)
#9: 137.71 d:131.89 h:0/6.46m (gen 24)
#10: 137.39 d:132.55 h:0/6.63m (gen 16)

Top Scores: (Gen 50) (Fat Cycles)
#1: 153.81 d:149.71 h:0/9.26m (gen 49)
#2: 151.54 d:145.76 h:0/7.35m (gen 43)
#3: 151.31 d:145.75 h:0/7.63m (gen 39)
#4: 151.23 d:145.56 h:0/7.32m (gen 35)
#5: 150.9 d:145.7 h:0/7.5m (gen 47)
#6: 150.75 d:145.72 h:0/7.91m (gen 38)
#7: 150.43 d:145.65 h:0/7.39m (gen 44)
#8: 150.22 d:145.61 h:0/7.99m (gen 42)
#9: 150.1 d:144.14 h:0/7.56m (gen 50)
#10: 149.48 d:143.98 h:0/7.28m (gen 25)

EDIT:
Given the amount of acrobatics the fat bikes are attempting, I figure this theme is appropriate.
« Last Edit: August 29, 2015, 10:09:21 pm by Itnetlolor »
Logged

Cthulufaic

  • Bay Watcher
  • whats a touhou
    • View Profile
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #8 on: August 29, 2015, 09:48:39 pm »

Mutation rate: 5%
Mutation size: 100%
Elite Clones: 1

It is generation 102 and farthest distance has dropped from around 150 to usually 110 or so.

#1: 152.69 d:148.72 h:0/7.39m (gen 47)
#2: 150.56 d:146.25 h:0/7.23m (gen 54)
#3: 149.46 d:145.79 h:0/7.56m (gen 46)
#4: 149.34 d:144.63 h:0/7.29m (gen 55)
#5: 148.53 d:144.18 h:0/7.34m (gen 43)
#6: 148.4 d:144.13 h:0/7.19m (gen 44)
#7: 148.37 d:144.13 h:0/7.44m (gen 53)
#8: 148.11 d:144.11 h:0/7.44m (gen 48)
#9: 148.07 d:144.13 h:0/7.44m (gen 51)
#10: 148.06 d:144.27 h:0/7.34m (gen 52)

I will leave this on overnight, so huzzah for evolution.
Logged

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #9 on: August 29, 2015, 10:32:23 pm »

Gen 42: The meaning of life. Some retards allowed.

I upped my mutations to 10%/75% for a few generations, because I thought they were stagnating a bit. 4 elites still. I dropped it back to 5%/50%/4E after gen 42.

Noticed that there were some unicorns appearing, and rhino-cars. Currently not top tier though. Still can't get over that second (broken) hill. The one beyond it looks even worse, and may not physically be possible to cross. Damn this is slow on a phone.

Top Scores:
#1: 155.67 d:150.41 h:-0.18/7.73m (gen 42)
#2: 155.15 d:150.36 h:-0.22/7.6m (gen 35)
#3: 154.97 d:150.36 h:-0.35/6.92m (gen 34)
#4: 154.8 d:150.32 h:-0.34/7.61m (gen 40)
#5: 154.79 d:150.37 h:-0.35/6.73m (gen 41)
#6: 154.7 d:150.38 h:-0.35/6.87m (gen 37)
#7: 153.98 d:150.35 h:-0.35/6.82m (gen 38)
#8: 151.15 d:146.11 h:-0.03/8.15m (gen 31)
#9: 149.29 d:144.49 h:-0.35/6.61m (gen 39)
#10: 149.2 d:144.87 h:-0.35/7.23m (gen 36)
Logged
It's a game. Have fun.

Itnetlolor

  • Bay Watcher
    • View Profile
    • Steam ID
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #10 on: August 29, 2015, 11:33:22 pm »

Still genning fat-cycles. Data is still consistent, and after 80  generations, no significant progress.

 Top Scores: (Gen 80. I am disappointed.)
#1: 155.46 d:149.8 h:0/8.23m (gen 66)
#2: 155.26 d:150.11 h:0/8.41m (gen 64)
#3: 154.51 d:150.48 h:0/10.12m (gen 73)
#4: 153.84 d:150.17 h:0/9.77m (gen 57)
#5: 153.81 d:149.71 h:0/9.26m (gen 49)
#6: 151.54 d:145.76 h:0/7.35m (gen 43)
#7: 151.31 d:145.75 h:0/7.63m (gen 39)
#8: 151.23 d:145.56 h:0/7.32m (gen 35)
#9: 150.9 d:145.7 h:0/7.5m (gen 47)
#10: 150.75 d:145.72 h:0/7.91m (gen 38)

EDIT:
Beach Buggy designs lead the pack now.

Top Scores: (top 100)
#1: 155.46 d:149.8 h:0/8.23m (gen 66)
#2: 155.26 d:150.11 h:0/8.41m (gen 64)
#3: 154.6 d:151.08 h:0/8.06m (gen 96)
#4: 154.51 d:150.48 h:0/10.12m (gen 73)
#5: 153.84 d:150.17 h:0/9.77m (gen 57)
#6: 153.81 d:149.71 h:0/9.26m (gen 49)
#7: 153.26 d:148.13 h:0/9.24m (gen 80)
#8: 151.54 d:145.76 h:0/7.35m (gen 43)
#9: 151.31 d:145.75 h:0/7.63m (gen 39)
#10: 151.23 d:145.56 h:0/7.32m (gen 35)
« Last Edit: August 30, 2015, 12:09:16 am by Itnetlolor »
Logged

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #11 on: August 29, 2015, 11:41:55 pm »

The second hill is possible to get over, by using the scientific art of awesomeness. I just watched one of my cars do loop-the-loops from the lip of that one, back to the downslope of the first hill, and repeat it 3 times. Just missed catching the front wheels over the lip while bouncing. Still wasn't my longest run for some reason. I'm hoping that's how I manage to get over it though, just so I can brag about genetically obscure back-flip requirements of the bay12 track :)
Logged
It's a game. Have fun.

Itnetlolor

  • Bay Watcher
    • View Profile
    • Steam ID
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #12 on: August 30, 2015, 12:11:15 am »

The second hill is possible to get over, by using the scientific art of awesomeness. I just watched one of my cars do loop-the-loops from the lip of that one, back to the downslope of the first hill, and repeat it 3 times. Just missed catching the front wheels over the lip while bouncing. Still wasn't my longest run for some reason. I'm hoping that's how I manage to get over it though, just so I can brag about genetically obscure back-flip requirements of the bay12 track :)
Wow. Beat me to it. I noticed something was up about that.

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #13 on: August 30, 2015, 12:24:29 am »

I'm not sure if that's how My Name is Immaterial's car did it, but I really hope it was. It's almost like emergent behaviour due to an extremely horrible environment to live in.

So, very dwarvish if it is. Hope he's got screen capture software to take a vid of the front runner.
« Last Edit: August 30, 2015, 12:29:09 am by sambojin »
Logged
It's a game. Have fun.

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Genetic Algorithm 2d Car Thingy: bay12 challenge/experiment
« Reply #14 on: August 30, 2015, 12:35:11 am »

Tada! Full loop-the-loop required (but only 1).

Car is unstable as, looks like it'll end up on its back early on, even rolls just before the loop. But it gets over that damn hill after the loop by teeter-totting over it.

The next hill may be impossible, but the one after that looks easy.

Mutation currently at 3%/50%/5 Elites, because I don't want to lose it all. Big front wheel, medium/small back wheel, vaguely looks like a toucan laying down frontwards with wheels at head and tail.

Top Scores:
#1: 159.78 d:155.92 h:-0.12/8.64m (gen 53)
#2: 155.67 d:150.41 h:-0.18/7.73m (gen 42)
#3: 155.18 d:150.38 h:-0.18/7.61m (gen 43)
#4: 155.15 d:150.36 h:-0.22/7.6m (gen 35)
#5: 154.97 d:150.36 h:-0.35/6.92m (gen 34)
#6: 154.9 d:150.44 h:-0.37/7.13m (gen 46)
#7: 154.8 d:150.32 h:-0.34/7.61m (gen 40)
#8: 154.79 d:150.37 h:-0.35/6.73m (gen 41)
#9: 154.7 d:150.38 h:-0.35/6.87m (gen 37)
#10: 154.49 d:150.52 h:-0.27/10m (gen 51)

When we evolve shit, we evolve shit good :)

Does anyone know of any good and free screen capture apps for an Android phone? I'll youTube it.
« Last Edit: August 30, 2015, 12:47:54 am by sambojin »
Logged
It's a game. Have fun.
Pages: [1] 2 3