Hacker News new | comments | show | ask | jobs | submit login
Multiplayer Genetic Cars (gencar.co)
114 points by gwil on June 27, 2013 | hide | past | web | favorite | 65 comments

Probably missing something ...

Which is my car? Is it competing? If so, against who? How can I tell? I have no idea what Im looking at, which is my car, who Im competing against, who is doing well.

Is there some sort of dummies guide for the likes of me???? :)

Despite all that, Im mesmerized!!!

Edit: I see down votes? How is it wrong to not understand something and ask for some help. Why is that a down vote?

Good question! See "Your Car" in the list of car health meters.

Yes. Its all of the health meters.

So did you ask Rafael Matsunaga if you could copy and release his code as open source?

Seriously. They even copied his text verbatim. The original code didn't mention any license which I don't think means it's a free-for-all. Also, they apparently copied the code before he pushed a bug-fix I emailed him yesterday :)


Seems like an afterthought. I couldn't find any license on the original either.

So do you know what the license is. I'm planning to fork this awesomeness for some other variants, and I'm sure others are thinking about that too.

Best assume that there is no license unless it's posted obviously.

I don't think this idea works. All players will very soon have the same top car (or the descendant of the same top car), and get a copy of that car from all other players. This creates a massively inbred mono-population.

Not sure what the appropriate fix would be. Import the top car from one random player in each generation?

And yet, isn't having the strongest species the goal of an evolutionary algorithm? Having multiple players do multiple runs (parallelization) and ending up with the same / a similar species sounds like a goal to me.

Perhaps you'd like to see more varied species get comparable end-results, but I think you'll need a more varied obstacle course / 'goals' in that case.

The issue is that you'll hit a local optimum, and all progress will halt.

Given the cars are seeded (e.g. f0660f), simply importing the top n different seeds in the world pool would be enough. Right now the system is treating everyone's copies of f0660f as if they are different cars, but they are not.

f0660f is the top winner for World-2 right now. You will want to switch worlds! Also the cars are all slightly different if you look closely.

They're slightly different, but that's irrelevant. When you breed the two almost identical cars, you'll get almost identical offspring. Diversity is essential for crossover. And crossover is essential for genetic algorithms. Just mutation isn't enough.

And right now the setup appears to be such that you'll end up destroying all diversity from the gene pool as soon as you have more than a few users.

It's worse than that, if you're on a world on your own your top 10 cars becomes copies of your best car. You destroy diversity even quicker with fewer players!

At least with lots of players, as pubnub said, some of those identically named cars were actually different generations and different cars, but were cousins or otherwise related from a common ancester.

One recommendation would be to incorporate any mutations into the ID, so if it started f0660f and mutated it would be f0660f0b or something, to track parentage (And in fact it would be cool if crossovers were tracked in the ID too, a bit like the Russian patronym or spanish matronym)

Updates have been made and now we are at 2.52 for improved Champion Generation.

What did you do? Now most champions don't actually work. They get stuck at the start.

The last time I looked at genetics, I remember a method that selected the top n genes and added a number of completely random (no crossover) genes to fill the population of the next generation. Would it be enough to add a number of completely random seeds each run?

We are working on updates! Will have details soon.

We are working on adjusting the algorithm.

The biggest problem here is a lack of server-side validation. The "remote champion" is determined by the score claimed by a client, so set a breakpoint in the function that posts the score and you can claim that any car parameters achieved any score... You see where this is going.

A proper implementation would run the simulation server-side to verify that a configuration achieves a high score. Almost as good would be to rank configurations based on the average runs across clients. This still lets a client submit an absurd configuration, but won't let an inferior configuration continue to be "champion".

One problem is that everyone shares their best, which becomes someone else's best, which then gets shared. Very quickly all my cars are all the same car ID.

It needs a way to prevent 2 identical copies racing each other.

Looking into this shortly.

Is this based at all on the HTML5 genetic cars project submitted the other day?

Link to the previous project[1] / discussion[2] / highscores ;) [3] for anyone who's interested:




The page give credits to the various projects.

> * Loosely based on BoxCar2D, but written from scratch, only using the same physics engine (box2d). seedrandom.js written by David Bau. (thanks!)*

An old very popular page is this one (http://www.qubit.devisland.net/ga/index.html)

BoxCard2D (http://www.boxcar2d.com/)

Looks very similar! But better!

This is an improvement over the original with Distributed Computing. The more players there are, the faster the best car is discovered. We want as many players as possible to find the BEST CAR faster than ever possible before.

This is a neat idea, although currently I can't really figure out what the deal is. It seems that I'll have a really effective car, and then the next round, I'll end up with a completely new set of cars, none of which resemble the previous winner, and all of which are less effective.

Anyway, would would be really cool to see would be something like Picbreeder, but for cars, where you can manually choose which cars to breed, then let them evolve on different courses, etc. Having some extra control over the situation would make for something extremely addictive.

good call!

We've pushed a few updates but are still working on making improvements! Soon a Chat feature will be added too....

It seems a bit opaque/confusing. Pretty soon everyone seems to be based on the same root 'genome' and you can't even tell which cars are 'yours' so to speak. Likewise, you can't wall off your own gene pool so that it doesn't get cross-contaminated.

We added the "Your Car" label which is mutated based on the current Champion of the World. We are working on improving the manipulation capabilities for Intelligent Design.

I've been watching "PubNub-World-4" for a while (28 generations, animation is still on). It has a nasty hill to climb that stops all cars at about 160 meters. I saw one almost make it over. So now I don't want to refresh and lose the chance that one might eventually evolve to make it.

Most of the cars seem to be quite similar, though. Also, the one that almost made it over doesn't seem to be marked as the leader so there's no net improvement in the cars. I saw one more, in about Gen 30, almost make it over too (it jumps up and sits on the ledge a while before falling back, as opposed to not getting past the ledge or jumping straight up in the air and falling back down).

Very mesmerizing thing.

After some improvements on the multiplayer aspects we are starting to see better generations being created and breading between champions.

Let's all coordinate on the "HackerNews" world.

Join World: HackerNews

Im hitting performance problems after about 5 minutes. I get massive lags. Running on latest Chrome i5 3.4GHz x 4 and 8GB RAM.

Edit: Just press "New Population" a few times and watch your browser slow down. There is a memory leak somewhere.

I've found the the string "HN" generates a nice but challenging world.

Tried it here at the office, Yes it is challenging indeed.

Hangnig out at HN as well :)

Hmm, things started off interesting with the best car i've seen thus far (short, wheels covered the top and bottom, etc) then this


The track/car generation is done through JS, so some modifications aren't anything Chrome Dev Tools can't handle. Add to that the fact that the "best" car is populated into the gene pools of all the other users and that's the outcome.

Now put a js based bitcoin miner on the background and you're done.

Haha good idea. >: D

Adding the chat shortly and we will change the world number again.

FORK us - https://github.com/pubnub/genetic-car-2

The go button is not working for me (firefox 22)

FireFox 21 is working as expected can you provide more details?

Thank you for the detail we are fixing this ASAP.

All buttons seem to work well when it first loads but then over time (generations) they seem to require a reload to work again.

good to know. we are looking into this.

We just pushed a new update go check it out. Upgraded Chat. Soon to come is a Intelligent Design (God Mode).

We are working on improvements to the Genetic Algorithm! Updates Shortly.

You might be able to further increase performance with parallel.js[1]:

[1]: http://adambom.github.io/parallel.js/

This looks like it may work out! Looking into it a bit more.

Is the world based on the same map(terrain) or the same pool of cars?

Same pool of champion cars that work best across a similar terrain.

Identical terrain for the example `PubNub-World-2`?

EDIT: Looks identical to me.

>>Join World: The same seed always creates the same track, so you can agree on a seed with your friends and compete. :)<<

Ummm can someone explain to me what exactly is going on here?

This game is connected to the world, all players are sharing their best cars each game round. Only the dominant cars win. The TOP car from each player in the world is added to your car list each game cycle. This car is therefore added to your gene pool and is then genetically spliced and paired with your other cars. Top cars are transmitted around the world from other players who are online RIGHT NOW using WebSockets style technology for data streaming ( PubNub ).

Watch out for the XSS in the chat.

Yeah. I've been sat here watching people trying it as they update the site to combat it.

Still dont know what Im looking at though...

Hmmm... people are complaining about their browsers mysteriously crashing, interspersed with random strings of Russian conversation...

likely a 100k gen bot gone sentient, learned Russian.



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact