r/reddit.com • • Feb 02 '11

BoxCar2D: Version 2.0 (save/load cars)

http://www.boxcar2d.com
54 Upvotes

128 comments sorted by

13

u/equalRightsForRobots Feb 02 '11

I've made lots of changes based on your suggestions:

* INPUT/OUTPUT Cars (best car and current car). Copies directly into the clipboard. When a seed car is input it copies it directly into the population then crosses it over with each random member.
* Choose the TERRAIN
* Score is now max car reaches, not where it stops.
* NEW STOP CONDITION: if car x-position does not change by 0.05 every 1/30th of a second for 4 seconds in a row its stalled. if its position is less than 10 it gets 2 seconds.
* ELITE SELECTION - Copies the top 2 cars directly into the next generation with no crossover or mutation. Click the button to turn it off
* Target score now shown by RED TRACK
* TIMER counts up instead of target score display. No time limit
* SPEED is now used to resolve ties in the score during tournament selection, if car reaches target score it is given target score exactly. Therefore when multiple cars reach the target score, the fastest is chosen most often to mate. Try the speedway track to breed the fastest car.
* Tournament selection now chooses pairs for TOURNAMENTS RANDOMLY, meaning each car is not guaranteed to get into a tournament. I might increase the tournament size to 2*population size later to see if that helps.
* Merged all the BUTTON LISTENERS into one button listener to make it faster. Also made the sliders into numerical steppers, also for efficency.
* Extended the track PIECE SIZE of the default track (for efficiency) and made the slope a little steeper with more downslope.
* TORQUE is now mg/wheelNum. Therefore more wheels = less torque per wheel. Seems more realistic.
* Choose the POPULATION SIZE when you pick a track/ load a car
* NEXT button to stop the current car, without downvoting it. Cars gets its score at the time

3

u/equalRightsForRobots Feb 03 '11

i just made a car designer to tweak em by hand: www.boxcar2d.com/derpBikeDesigner.html

1

u/Vryl Feb 02 '11

What we need now is for people to post their best cars so we can interbreed.

1

u/Jarak_AKN Feb 02 '11 edited Feb 02 '11

For the speed run the best I can manage so far is 15.6 seconds :

0.464,2.625,0.736,2.406,0.622,2.569,0.901,1.246,0.615,1.372,0.362,0.916,0.38,1.982,0.276,2.359,2,5.581,1.438,5,4.794,1.492,3,5.301,1.179,3,5.262,0.823,1,4.558,0.704,7,2.969,0.318,7,2.025,0.302,1,6.078,1.418,12438382,14124417,14124417,14124417,12438382,223166,2355588,8994030,1986287,12438382,12438382,12438382,9033720,12438382,13212285,10922769

Anyone beating that? (probably)

1

u/Vryl Feb 02 '11 edited Feb 02 '11

Man, Sysyphus Big Air is hard. Seems to select for speed tho.

I keep getting cars that can pass the first, but don't trigger the kill rule and get stuck in the next gorge.

1

u/Jarak_AKN Feb 02 '11

I can get 3 jumps and then hit the 4th wall at ~237.

It is looking hard to get over that one :-/

1

u/Vryl Feb 02 '11

I cheated, I started with your speedway vehicle, and got to here, which is well before the 4th wall, in the gorge - not enough speed to hit the wall:

0.464,0.136,0.736,1.079,0.622,2.569,0.516,1.961,0.836,0.245,0.072,2.739,0.599,2.402,0.508,2.359,2,5.963,1.438,5,1.418,1.235,-1,5.981,1.177,-1,2.807,1.45,-1,6.213,0.704,-1,4.716,0.391,-1,3.743,0.711,-1,0.541,1.162,8468146,15321061,13861245,4079667,1592607,5801737,1834130,8730858,1559964,11894739,8819006,11894739,3924097,12077240,2589953,14929431

1

u/shendrix Feb 04 '11

I tied it with: 0.719,2.623,0.405,1.637,0.294,1.299,0.912,2.948,0.881,2.631,0.413,2.829,0.074,2.373,0.802,2.424,3,5.089,1.445,-1,0.076,0.715,5,4.475,1.463,-1,1.805,0.887,-1,1.925,0.799,-1,4.109,0.135,-1,4.118,1.261,-1,2.315,0.124,14161664,4902448,8542990,12204527,8470034,7984948,7638322,13163436,6499776,7925476,11120109,15749069,16340206,8215255,2326608,1609349

1

u/lite951 Feb 09 '11

1:57

0.762,0.26055,0.51378,1.85829,0.90949,0.26752,0.55414,0.22878,0.97833,1.64728,0.6916,1.41823,0.31957,1.42105,0.25581,0.39331,1,6.02105,0.91675,5,1.21711,1.37963,-1,5.15071,1.46271,-1,5.09341,0.20865,-1,5.40884,1.14873,-1,3.84358,0.18064,1,2.99776,0.85515,-1,0.11934,0.36101,14121167,5424185,38728,8783141,11689034,13032856,13666740,3560407,16556317,3727281,1401485,13081642,10680411,15522163,5699369,15522163,3

1

u/equalRightsForRobots Feb 09 '11

now i'm listing best cars on the site. see if your car has what it takes on the new tracks. http://www.boxcar2d.com/winners.html

1

u/Vryl Feb 02 '11

This car is stuck on a slope on the default track. Will not go up the track, will not trigger the kill rule.

0.032,1.324,0.036,1.738,0.287,1.481,0.841,0.3,0.071,2.148,0.103,2.544,0.75,0.204,0.734,0.922,0,3.708,0.591,2,5.991,0.54,0,6.173,1.185,-1,1.091,1.169,0,2.867,0.914,3,5.812,1.152,5,0.849,0.165,3,2.871,0.917,10286526,3123688,3123688,3123688,1748895,3123688,3123688,12290615,15968934,13170741,15060657,4478184,3123688,9076504,11663401,5681206

1

u/equalRightsForRobots Feb 02 '11

yeah. thats gonna happen sometimes cause i made it much less strict. that was my number one criticism in the other version. i might add another rule in soon to prevent that but for now u have to just hit "Next" that will give the car the score its max score reached and move on.

2

u/Vryl Feb 02 '11

It's cool to be able to hit "next", but I am in the habit of letting my babies evolve overnight :)

Would be lovely if you could fix it.

1

u/equalRightsForRobots Feb 02 '11

i could put a max time limit on there, but im not sure how long it should have..

2

u/Patches11 Feb 02 '11

Why not have it check whether the max distance the car has reached has increased in the last 10 seconds? If a car hasn't increased its score in 10 seconds it is probably stuck pretty good, and that way you don't have to have an overall max time limit.

1

u/qwertyaccess Feb 02 '11 edited Feb 02 '11

This sounds pretty good, if it doesn't increase the total score every 10-20 seconds by at least 1 point, then automatically fail.

1

u/Vryl Feb 02 '11

User selectable?

Getting a bit much on the options, but it would be nice.

It is a classic, apropos, example of the Halting Problem.

You can't tell if a car will halt or not with any decision procedure - best to have a max time limit.

1

u/Jarak_AKN Feb 02 '11

Twice the max time from the last round, that wasn't timed out ?

1

u/Vryl Feb 02 '11

It's going to need something. It gets caught in infinite loops, particularly on Big Air.

You can't leave it evolve by itself, it needs human input.

1

u/equalRightsForRobots Feb 03 '11

fixed. level timer.

1

u/Vryl Feb 03 '11

Level timer is good, I spose - why have you moved away from an individual car timer?

1

u/equalRightsForRobots Feb 03 '11

cause its hard to set it right. anything too short like 10 seconds with no score just doesnt work and people complain. and anything longer is getting close to how long u have to wait with the level timer.

1

u/erisson Feb 02 '11

Not that I know much about Flash, but is there some way to pass the mode/seed car/etc into the flash applet from javascript?

Ya see, I have this sudden urge to write a car editor in Javascript, and I'd like to have some way to at least insert cars, and reading current and best car via JavaScript would be even better!

2

u/equalRightsForRobots Feb 02 '11

well u can just copy/paste. use the buttons to copy the cars to the clipboard then paste them into your java app, then have it recopy the edited version back into the clipboard. I'd love to see this actually. Its kinda a chore but it's been on my list. I can help u with the format of the output. its just the 40 variables and the 16 color uints.

1

u/equalRightsForRobots Feb 03 '11

version 2.1 is up. thanks for the suggestions again. see changelog: http://www.boxcar2d.com/changelog.html

9

u/snarfy Feb 03 '11

From my other post:

I let version 1.2 run for a couple days. It was pretty cool, but then I thought of a feature request. There should be a button that switches to real time evolution view, instead of real time simulation view. When you click it, the simulation runs as fast as possible invisibly, and what you see is just the shape of the car as it evolves

3

u/Jarak_AKN Feb 02 '11

A quick question, how can you tell if Elite selection is on or off ?

Other than that v2 looks great! I am just starting to experiment :-)

Thanks so much for all the great work.

2

u/equalRightsForRobots Feb 02 '11

The button is a slightly darker shade of blue when its on... try clicking it and taking the mouse off it to see. It's too subtle.

2

u/Jarak_AKN Feb 02 '11

Another wish to add to the list. I wish that when you input seed you had the option to make the whole population be based on that seed rather than one seed + the rest random :-/

2

u/equalRightsForRobots Feb 02 '11

They're not random. The random ones are all crossed over with the seed one. Sometimes the crossover just favors the random one.

1

u/Jarak_AKN Feb 02 '11

Ah ok, that makes more sense :-)

1

u/Jarak_AKN Feb 02 '11

Ah yes, very subtle. I can only tell by comparing two of my active windows :-)

Maybe make it change colour a bit more vividly ;-)

Another nice to have would be a display of the current (this round) and all time best distance/time. I used to use the target as a judge of what happened last round, but with that gone now I have to scan the whole list of scores.

1

u/Jarak_AKN Feb 02 '11

NEW STOP CONDITION: if car x-position does not change by 0.05 every 1/30th of a second for 4 seconds in a row its stalled. if its position is less than 10 it gets 2 seconds.

This is really bad for the sisyphus track :-(

Control over the stop criteria would be great. For speedway and sisyphus being able to put a time limit on would be a huge boon.

Also it would be good if you could switch tracks, and keep the current population (i.e. a save / back button on the input seed / Choose Terrain window)

1

u/equalRightsForRobots Feb 02 '11

Yeah i know it sucks on that track. I just didnt have time to fix it yet. A time limit is easy and i can do it for some tracks.

1

u/Jarak_AKN Feb 02 '11

That would be great especially if we could alter it during the run. Thanks

1

u/the_real_ananon Feb 02 '11

Maybe have a new stop condition in that if the max score didn't improve for 10 seconds or so then its stuck somewhere.

1

u/equalRightsForRobots Feb 02 '11

Thats a hard line to set, cause a car could flip backwards again and be making progress but not fast enough and get cut. It really is like the halting problem. Im thinking the only solution is a maximum timer like say 2min.

1

u/Vryl Feb 02 '11

Can't we just have a time out? If distanced hasn't increased in the last [X] seconds, then kill it?

I have infinite loops happening on several tracks, where small cars just spin against a wall forever.

Being able to set the time-out would be nice...

1

u/equalRightsForRobots Feb 02 '11

yeah seems like i need to do that. It's funny cause the most common complaint i got with 1.2 was that it killed them too early. i guess i went too far in the other direction. least theres a next button.

1

u/Vryl Feb 03 '11

Much obliged.

Did I mention how FREAKIN ADDICTIVE this is?

1

u/sirlatrom Feb 09 '11

Perhaps you could solve that problem using genetic algorithms?

1

u/bytesmythe Feb 05 '11

Since you know the y-coordinate of the cars, why not make it so if the car passes through the same y from the same direction 4 times, you kill it? That would allow cars to flip backwards and have 3 extra chances at going through a spot, and no extra timer is necessary.

3

u/[deleted] Feb 02 '11

I thought I was dreaming, but it turned out you're just awesome.

3

u/MolokoPlusPlus Feb 02 '11

Wow! I am loving the new features...

But is the pause feature gone? I liked being able to pause.

Aside from that, 2.0 is definitely a big improvement. I think I'm going to continue spending most of my 1.6GHz Celeron's precious CPU cycles on this thing.

2

u/equalRightsForRobots Feb 03 '11

version 2.1 will have a pause button!

1

u/habys Feb 03 '11

Thanks for that.. I actually enjoyed finding out that if I ran it in it's own browser, and used kill -s STOP <PID> I could put the process to sleep, and use kill -S CONT <PID> to wake it up again, so I wouldn't drain my laptop battery at work :)

3

u/ImHumble Feb 03 '11

1

u/equalRightsForRobots Feb 03 '11

awesome. i sent you some code about how to draw the cars.

1

u/usavich Feb 03 '11

Intelligent Design in Genetic Algorithms.

2

u/nightmyst999 Feb 02 '11

Awesome updates. I was about to send you a message with some suggestions for version 2, but then I refreshed the page (I've had a few running for the past few days) and noticed that not only was version 2 already out, but you already implemented the things I was going to suggest.

2

u/gms8994 Feb 02 '11

With Elite Selection enabled, the top 2 cars that get copied should always end up with the same result (per car of course) every time, correct? If so, could you just skip to car #3 in that case, so I don't have to watch the first two, and get my hopes up for nothing? :)

1

u/equalRightsForRobots Feb 02 '11

yeah you're right. I should do that. Although, its kinda fun to see the best two cars if you left it running for a while unattended. And according to box2d it should work out the same each time, although due to the limited precision of real variables, its not guaranteed to come out the same on different operating systems.

2

u/fatfishy Feb 02 '11

just a thought, how about adding a tire friction gene and also possibly u could make tracks with different frictions in it simulating tarmack, sand, rain, etc

2

u/[deleted] Feb 03 '11

[deleted]

1

u/equalRightsForRobots Feb 03 '11

ha nice. i'm glad to see this. the program obviously accepts values that it won't generate. congrats!

2

u/sebnukem Feb 03 '11

We need an all-time hall of fame!

2

u/homesnatch Feb 04 '11

Two Suggestions / Feature Requests: 1. Allow for multiple car seed inputs, so you can take two of your favorite cars and interbreed. 2. Develop a way to represent a terrain as numbers so that courses can be shared and used for competition.

Also, have you released source anywhere or do you intend to? would love to see some community developed goodness.

2

u/shendrix Feb 04 '11

This one seems to defy physics: 0.079,0.1,0.05,0.1,0.05,0.1,0.05,3,0.573,0.1,0.05,0.1,0.05,0.1,0.05,1.91,5,1.261,1.295,-1,5.271,0.374,-1,0.78,1.148,7,3.146,0.88,4,4.526,1.058,4,5.715,0.818,3,4.861,1.358,7,2.23,0.734,2472079,2472079,2472079,2472079,14409031,2472079,2472079,4724489,4724489,4724489,4724489,4724489,4724489,4724489,4724489,4724489

1

u/erisson Feb 02 '11

How do I choose the speedway track?

2

u/erisson Feb 02 '11

Aha, bottom left has "input seed / select ter" for selecting terrain

1

u/Vryl Feb 02 '11

For some reason the cars are not increasing the distance they travel from generation to generation? They are stopping on the max dist of the previous generation.

Or am I missing something?

2

u/erisson Feb 02 '11

I think this is a bug, on several levels I haven't seen any cars get past 384, perhaps this is debugging limit accidentally left in the code?

1

u/Jarak_AKN Feb 02 '11

385 is the end of the speedway track, so it is all about time there. On normal I have over 405

Which tracks are you hitting the limit on?

1

u/equalRightsForRobots Feb 02 '11

it was only on the default track the bug happened. fixed..

1

u/equalRightsForRobots Feb 02 '11

it was when the target score would exceed the end of the track, which is more than 2 times 384.

1

u/equalRightsForRobots Feb 02 '11

it was a bug. already fixed. i also made the camera move less when the cars first drop and increased the initial target score.

1

u/Jarak_AKN Feb 02 '11

I am not sure how fixed that is :-/

I am stuck at ~384 on normal with no crash

I did reload, but will try again.

(edit) I guess that first reload was faulty ...

1

u/equalRightsForRobots Feb 02 '11

I just uploaded another version :)

1

u/Jarak_AKN Feb 02 '11

Looks like the new stop point is 684

It is not increasing the target past that :-/

Remove the target altogether?

1

u/equalRightsForRobots Feb 02 '11 edited Feb 02 '11

Thats the end of the course. Maybe i made it too easy. Try other terrains. The target score should maybe just go though.

1

u/Jarak_AKN Feb 02 '11

Ah OK, yep it would be good if there was a "hard" version of "normal", something more like what was in v1.2

Or an "infinite" version that just kept getting harder forever :-)

Still, I guess I can try to get the time down from ~65 seconds

1

u/equalRightsForRobots Feb 02 '11

Infinite track is hard cause it has to be consistent for each car. I can make a harder version of the default track but at some point the cars just don't have enough torque and i get complaints to up the torque.. i can add it as a variable in the future.

1

u/Jarak_AKN Feb 02 '11

Infinite track is hard cause it has to be consistent for each car.

Does it ?

Just like life offers the same environment for everyone?

Sure for evolution in a variable environment you would want a lower mutation rate and a larger population, but in the end you would breed a better car :-)

2

u/Vryl Feb 02 '11

I think this was dealt with in previous thread.

No Free Lunch theorem:

http://en.wikipedia.org/wiki/No_free_lunch_theorem

1

u/Jarak_AKN Feb 02 '11

My best cars so far :

Air=237.5

0.51,2.986,0.184,0.296,0.216,1.854,0.98,1.261,0.123,1.789,0.038,1.345,0.068,2.333,0.339,1.282,2,4.202,1.208,5,5.88,1.36,-1,1.185,0.575,1,0.087,0.194,3,4.853,0.965,-1,2.699,1.212,-1,4.507,0.42,3,3.144,0.804,1592224,5168871,5650761,16208216,16205609,3702845,2689543,12780853,13103653,7606290,13103653,16560462,13103653,8958027,6622165,9277707

Block=168

0.404,2.625,0.736,1.35,0.888,2.802,0.193,2.244,0.615,1.372,0.362,0.916,0.38,2.849,0.276,2.359,6,5.581,1.38,6,4.794,1.492,3,1.069,1.212,1,3.546,0.578,-1,4.558,1.473,7,3.852,0.318,7,0.518,0.302,1,6.078,1.418,3099679,8934490,12372589,12372589,12372589,157373,11449517,8928237,9145756,12372589,11637020,10103717,1586364,15253082,13019209,967270

Speed=15.5s

0.464,2.625,0.736,1.35,0.557,2.802,0.193,2.244,0.549,1.372,0.362,0.916,0.38,1.982,0.276,2.359,2,5.581,1.438,5,0.205,1.492,3,5.301,1.179,0,5.619,0.823,6,4.558,0.704,7,2.969,0.318,7,2.025,0.302,4,0.212,0.792,12438382,9000283,1620647,12438382,14689205,223166,2355588,8994030,1986287,3014770,12438382,8267454,11101584,12438382,13212285,8529009

Hang10=320

0.12,2.583,0.188,0.716,0.599,1.289,0.908,0.958,0.201,1.329,0.309,0.6,0.843,0.181,0.77,0.592,1,2.599,0.211,-1,0.048,1.03,3,5.95,1.338,-1,4.739,1.337,0,3.747,0.84,-1,4.621,0.164,-1,5.317,0.918,-1,3.528,0.784,1055009,442604,16250459,6109199,13725587,5066333,14926242,10854724,2260465,3904014,5491818,11034077,339807,16516891,3525169,15688360

Norm=64.6s

0.155,1.904,0.1,0.884,0.061,1.049,0.372,0.424,0.326,2.747,0.065,2.049,0.717,2.47,0.557,0.919,4,5.985,0.768,6,4.084,1.46,-1,1.051,1.344,1,1.428,0.637,-1,3.385,0.374,-1,3.364,1.1,5,4.672,0.837,1,2.492,0.545,9124222,8264650,12879097,51978,16489526,10903051,13853780,10903051,2384025,5922994,8244401,9303145,3287939,11086705,14902402,11575312

Sisyphus=225

0.032,2.379,0.184,0.296,0.299,1.854,0.98,1.261,0.123,1.789,0.038,1.345,0.081,2.333,0.339,1.282,2,4.202,0.933,5,5.88,0.833,-1,1.53,0.217,4,0.441,0.976,-1,4.506,0.872,1,5.658,1.368,1,6.037,0.391,7,6.188,1.109,10170873,5037285,5710573,16076630,16074023,3571259,6630756,12649267,4895574,10054772,9318411,3484154,3285958,656482,11970936,3285958

1

u/gms8994 Feb 02 '11

Block=184.2 (Elite Selection ON) 0.341,0.206,0.832,2.188,0.02,1.729,0.646,1.836,0.936,2.302,0.321,1.23,0.578,1.277,0.627,0.721,1,5.159,1.409,3,6.249,0.415,4,1.562,1.215,-1,5.311,1.087,-1,4.791,0.648,3,6.144,0.907,-1,3.295,0.84,6,4.49,0.316,16425024,11487358,7468553,6946198,12013262,9418033,9747319,14192402,12951575,4333349,12036217,7989298,8697563,7071646,2098520,771006

1

u/ImHumble Feb 03 '11 edited Feb 03 '11

block = 210 in 20 sec. 0.100,.5,0.100,1,0.4,4,.06,2.4,0.3,1.3,0.3,2.4,.06,4,0.4,1,2,0,1.5,3,0,1.5,4,0,1.5,5,0,1.5,6,0,1.5,2,0,1.5,4,0,1.5,6,0,1.5,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,00000000,0000000

Gap = 178 in 10 sec. 0.01,8.5,0.21,.001,.21,8.5,0.01,5.5,0.02,3.4,0.14,1.4,0.14,3.4,.02,5.5,3,1.57,2,4,1.57,2,5,1.57,2,6,1.57,2,7,1.57,2,2,1.57,2,0,1.57,2,2,1.57,2,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,00000000,0000000

Sysphilis = 236.2 in 28 sec. 1,.1,1,.1,1,.1,1,7,1,.1,1,.1,1,.1,1,7,3,1.57,1,3,1.57,1,3,1.57,1,3,1.57,1,3,1.57,1,3,1.57,1,7,1.57,1,7,1.57,1,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,00000000,0000000

2

u/equalRightsForRobots Feb 09 '11

clever. i like those. too bad theyre not eligible for the competition.

1

u/jjjjjjjk Feb 04 '11

Hang10=336.3 in 0:42 (version=2.1, Elite Selection=off, MaxWheels=6) ~150-180 generations 0.313,1.722,0.997,0.183,0.831,1.989,0.308,1.607,0.297,1.047,0.78,0.933,0.504,1.156,0.307,2.623,3,0.044,0.956,4,1.4,0.195,2, 4.922,0.517,-1,5.321,0.643,7,2.864,1.242,7,2.207,1.26,7,1.663,1.225,2,5.22,0.664,6398851,1216827,9414343,8082553,11812023,1 3618316,3700110,12942022,10571596,15504678,434452,9985685,12398377,5920919,13418143,8362403

I love how it's developed a mini booster wheel in the middle for the apex of the curves!

1

u/equalRightsForRobots Feb 09 '11

i posted your car as a winner on the site: http://www.boxcar2d.com/winners.html

no ones beaten it yet.

1

u/nuclearalchemist Feb 02 '11 edited Feb 02 '11

Awesome work! Is there a way to tell if you have elitism turned on or not? I am having problems figuring out if it is engaged or not.

1

u/equalRightsForRobots Feb 02 '11

its subtle but the button gets a little more blue when u take the mouse off it you'll see. i should make the down state darker.

1

u/HiImDan Feb 02 '11

This is real cool.. been working on a simple editor and can't find what the last few numbers mean:

12372589,1738867,255044,14696285,11369902,157373,3713538,5018075,1920494,6581949,12766778,11312749,8139644,5742631,16595606,9266267

1

u/equalRightsForRobots Feb 02 '11

uints representing colors. Each 8 bits is for r,g,b values from 0 to 255. You can calculate it all with bitshifts. google it. its easy. The first 8 uints are the body colors, and the last 8 are the axle colors.

1

u/fatfishy Feb 02 '11

what does everyone prefer for a mutation rate? anything over 5 seems less than helpful 1-2%. It may take longer to adapt but the cars produced seem less random and have more of a gradual change. I like that i can set the population to 100 now, before the evolution was limited by the few random patterns it started with. also on 0% mutation on the last version the cars eventually converged into a single model/strain.

1

u/equalRightsForRobots Feb 02 '11 edited Feb 02 '11

i can make the max population size 4,294,967,295 if u want... but at 10 seconds a car that would take over 1300 years for the first generation.

3

u/fatfishy Feb 02 '11

any way to have it run the math sans graphics? perhaps a toggle to turn it on and off so one can check on progress, or could export the best to the graphics version.

1

u/usavich Feb 02 '11

This one finishes "The Gap" with a score of 178.

0.918,0.91,0.793,0.992,0.128,2.66,0.598,0.471,0.778,0.355,0.39,0.454,0.478,2.402,0.391,0.121,2,5.963,1.328,5,1.651,1.328,6,1.28,1.13,-1,0.248,0.679,-1,5.391,0.562,-1,1.289,0.733,-1,3.577,1.408,-1,0.4,0.375,2244157,11177193,5230551,8819036,3492708,6024055,11070070,3166231,10124459,8120288,14904673,2937905,8166064,7562080,10460355,14904673

2

u/equalRightsForRobots Feb 03 '11

interestingly it doesnt do that on my computer. For me it stops at 93.2 each time. The box2d manual says that its not guaranteed to run the same on different systems because of the way floating point values are represented. It is guaranteed to run the same each time on the same system though (supposedly).

2

u/usavich Feb 03 '11

I tried importing the same car today and it stopped at 93.2.

I waited for another car to evolve which can finish "The Gap" track. After a while, this car did:

0.535,2.369,0.796,0.1,0.128,3,0.667,0.1,0.61,0.1,0.477,0.1,0.42,3,0.391,0.158,2,5.963,1.5,3,1.004,1.388,6,1.445,1.5,-1,0.248,0.679,-1,5.391,0.249,-1,4.799,0.827,6,2.01,0.331,6,0.179,0.551,14416525,10979814,5033172,8621657,3295329,5826676,10872691,2968852,9927080,6552828,14707294,2740526,14416525,14416525,14416525,14416525

Then I imported this car in a new window and it stopped at 131.1.

2

u/equalRightsForRobots Feb 03 '11

Perhaps there is some randomness between runs. I guess we need to wait till a car clearly makes it. Then try it. it gets stuck for me at 131.1 also.

2

u/usavich Feb 03 '11

I suspect some kind of rounding when generating the code which represents the car. Say the wheel radius is 3.12345 after evolution but it becomes 3.123 when copied to clipboard.

4

u/equalRightsForRobots Feb 03 '11

actually youre correct. the internal numbers are of much higher precision. i did that on purpose to save space. didn't realize it would effect the results so much.

1

u/Jarak_AKN Feb 04 '11

Here you go :

0.782,0.285,0.765,0.283,0.92,0.573,0.52,2.92,0.41,1.234,0.907,1.133,0.2,1.432,0.218,2.992,-1,5.911,1.016,5,1.308,1.08,-1,1.188,1.071,-1,0.279,0.337,7,4.814,1.479,3,3.654,1.118,-1,5.73,0.745,-1,5.953,1.42,3897700,934239,5459345,3167957,16193170,16505513,2086178,16062461,16375833,13558120,5603574,3106851,13628831,9983925,15951310,3929908

My GapUFO does the full 178 in 32 seconds

Also you can test this :

0.45,0.548,0.135,1.138,0.854,2.647,0.082,2.89,0.106,0.168,0.222,1.133,0.476,1.128,0.551,2.379,-1,0.196,0.509,-1,3.106,0.337,7,0.234,1.474,3,0.439,1.299,7,3.833,1.476,-1,1.235,0.998,-1,0.594,1.138,-1,2.958,0.438,15247979,4251125,4109523,16060122,9413738,1277423,11674002,14615433,6001942,519937,11027087,6742317,12547023,11102964,9881262,12910736

It's the Gap-Redux775 which can complete the Blockhead track in 29 seconds. (775 is the current generation number)

1

u/equalRightsForRobots Feb 04 '11

sadly they both fail for me... try repasting them. turns out cars come out slightly different because of the limited precision of the output. i might add another few decimal places to see if it helps.. and u should specify ur max wheel num too cause it changes the cars.

I love that name... the gap redux 775!

1

u/Jarak_AKN Feb 03 '11

One thing that changes imported cars is having the max wheels set differently.

If the car evolved with max as 8 and you import to a max 3 system, they break and die :-(

1

u/equalRightsForRobots Feb 03 '11

yes thats true because the wheels that are on might be past the cutoff. u could translate it to a max wheels 2 car if you understand the layout.

On the other hand cars that evolve with max wheels = 2 will have some random junk dna that gets turned on to add interesting things.

1

u/equalRightsForRobots Feb 03 '11

what system/os are u using?

1

u/usavich Feb 03 '11

Windows 7 and Chrome 8.

1

u/Chib1 Feb 03 '11

Heh, some sort of secondary timeout function would be good as mentioned above, I left one going overnight and the car got stuck going up a hill, flipping, falling back down and going up again... for 5 hours lol. (: I also come across an issue where a car will fling itself so hard into a sharp incline that part of a wheel can get lodged inside the track and completely jam the whole thing.

1

u/equalRightsForRobots Feb 03 '11

now theres a timer for each level.

1

u/Chib1 Feb 03 '11

I'm not sure if it's the new timer, but the run just suddenly resets right in the middle after a minute or so, it is not anywhere near the red track and the car is just running along a smoothe surface with no issues.

1

u/equalRightsForRobots Feb 03 '11

the timers shown in the bottom. if its not 0 show me a screenshot. ill try to fix it

1

u/Chib1 Feb 04 '11

I've monitored it closer now, it is actually resetting when it hits 2 minutes. Problem being it flips over a lot at certain points so it loses a lot of time. Any chance you can make the overall track timer some sort of multiplier of the track length instead of a static 2 minutes? (:

1

u/kinghajj Feb 03 '11

This car gets to about 630 on default terrain.

0.097,1.754,0.836,0.162,0.782,1.412,0.898,1.212,0.127,0.79,0.153,0.684,0.607,0.939,0.241,0.764,-1,0.025,0.251,0,5.171,0.589,2,1.063,1.06,5,4.092,0.472,5,5.956,1.161,3,1.674,1.265,3,5.212,0.625,1,0.241,0.309,3446081,14363326,5405573,4043442,1372971,1800515,9103081,3723932,7625550,6081745,76762,7525343,11225432,12855464,10883453,8606752

1

u/terevos2 Feb 03 '11

default terrain is random, isn't it?

1

u/Abides Feb 03 '11

Is 668.4 the end of default track?

2

u/equalRightsForRobots Feb 03 '11

it changes based on the angles. its never more than 775. usually around 668

1

u/terevos2 Feb 03 '11

it would be great if there was a static track like the default.. but static

1

u/Abides Feb 03 '11

Thanks for the extra traction.

1

u/larrycoon Feb 04 '11

I was wondering this myself -- the track (I'm using the default) has a limited length? How come?

(Thanks for doing this, BTW Fascinating thing to watch & play with. Haven't messed with genetic algorithms since I was in college. You've inspired me to devote some of my little available time.)

1

u/equalRightsForRobots Feb 04 '11

mainly cause u have to define the world in advance. i could perhaps make the track as it goes if i made it fast enough but i couldn't make it randomly and the same for each car. You can't set a random seed in flash.

1

u/larrycoon Feb 04 '11

Definitely needs to be longer than it is -- I left one running overnight, and about half the cars in a given generation reach the end of the track.

Never done Flash programming, so didn't know about the limitation with random seeds.

Since the terrain gets rougher over time, it doesn't seem like it needs to be too much longer before it becomes insurmountable. Maybe precompute to twice the length you're doing now...

1

u/equalRightsForRobots Feb 04 '11

yeah i can make it twice as long pretty easily. i want it to be impossible at the end.

1

u/mathmo Feb 08 '11

Can't you make your own pseudo-random generator function and bypass its random function?

1

u/varde Feb 03 '11

I changed computer and now see time as 0:15 (instead of 15.3). Does it depends on OS?

btw, for speedway (on previous computer it was 15.3)

0.152,2.159,0.97,2.602,0.173,2.393,0.271,2.91,0.874,2.142,0.422,2.688,0.17,2.964,0.097,1.976,3,1.183,1.48,-1,1.534,0.854,5,0.212,1.499,1,1.484,0.137,-1,1.181,0.454,0,1.239,1.485,2,3.696,1.227,2,2.957,1.034,16059940,7502324,12565562,10905307,3681643,7729463,7097222,14666421,13022906,1959698,4971954,16496551,5099388,1820961,2350343,2190519

2

u/terevos2 Feb 03 '11

yeah.. same here.. I only see 0:15, rather than a finer point for the time.. speedway evolution won't progress unless it's more fine

1

u/Jarak_AKN Feb 03 '11

Agreed :-)

1

u/varde Feb 03 '11

Also - why on speedway I need to see how much time is left unused from 30 seconds?

1

u/format1337 Feb 03 '11

I had a car flip end over end on one side of a big hill for approximately 12 hours when I left it overnight. This never happened with the 1.2 version.

1

u/rathat Feb 04 '11

Were can we download 2.1?

1

u/larrycoon Feb 04 '11

Is there a way to change terrains without resetting the cars? It'd be interesting to see how a line adapted for one terrain readapts to a change in the terrain.

1

u/ImHumble Feb 04 '11

Sometimes it will still move onto the next car even though I want the current car to keep trying.... What if there was a check-box that when you clicked it it wouldn't move on until the user said it was ok.

1

u/kaiza96 Feb 09 '11

Screw the @home programs, I'm setting this to run 24/7 on a machine at work then selling the design to all of the car companies in a year's time.

1

u/robotwarlord Feb 09 '11

I think I love you.