Real-Time Gaming Blog

GenCar.co: Multiplayer Genetic Algorithm 2D Cars

2 min read Michael Carroll on Jun 29, 2013
Try PubNub Today

Free up to 1MM monthly messages. No credit card required.

Subscribe to our newsletter

By submitting this form, you are agreeing to our Terms and Conditions and Privacy Policy.

We've updated our SDKs, and this code is now deprecated. Good news is we've written a comprehensive guide to building a multiplayer game. Check it out! Around the PubNub office, we're always sharing o...

Warning

We’ve updated our SDKs, and this code is now deprecated.

Good news is we’ve written a comprehensive guide to building a multiplayer game. Check it out!

Around the PubNub office, we’re always sharing our gaming high scores with each other, whether it’s TrackPad Destroyer, Lightweight Multiplayer Games with melonJS, or Real-Time Stats for Candy Box. So when our CTO Stephen Blum stumbled upon Rafael Matsunaga‘s Genetic Cars, naturally another competition was born.

The game uses genetic algorithms to test and improve simple racing cars on a randomly generated track. Similar to the Darwinian concept of Evolution, the most superior cars continue to combine and mutate while the weak cars are thrown out. The winning car is  added to your gene pool and is then genetically spliced and paired with your other cars. As more mutations are made, the cars become more efficient and travel farther.

However, our CTO Stephen Blum decided to take the game to the next level from single player to multiplayer by harnessing the PubNub Data Stream Network. The result was Gencar.co.

multiplayer

Because of PubNub’ Gencar.co multiplayer capabilities, it involves thousands of players at a time, which in turn has significantly accelerated the mutation rate. As a result, thousands of users at a time can watch as their cars increase in efficiency. In addition, we added a chat feature using PubNub Channel Presence to see how many people are in the app.

The open source code is all available on our GitHub Repository: Multiplayer Genetic Cars.

multiplayer

More from PubNub

NPP and HIPAA: Notice of Privacy Practices Definition
Healthcare CategoryJan 6, 20235 min read

NPP and HIPAA: Notice of Privacy Practices Definition

A Notice of Privacy Practices (NPP) is one of the requirements of HIPAA and helps patients understand their personal data rights.

Michael Carroll

Michael Carroll

HIPAA Violation Examples
Healthcare CategoryJan 5, 20236 min read

HIPAA Violation Examples

HIPAA violations can be financially expensive and devastating to a brand. Examine some examples of HIPAA violations, and learn...

Michael Carroll

Michael Carroll

HIPAA Technical Safeguards: How To Protect Sensitive Data
Healthcare CategoryJan 5, 20236 min read

HIPAA Technical Safeguards: How To Protect Sensitive Data

HIPAA covered entities must follow the five technical safeguards to achieve HIPAA compliance and prevent data corruption.

Michael Carroll

Michael Carroll