something in the way

a tumblog about design + code
Oct 26

Flash gets GPU-accelerated 3D! MAX Racer with P2P multiplayer


Media_httpapitweetmem_euhoh

The revolution is here and the world is never be the same!

Last couple months were just exciting like never before. We’ve been working with guys from Alternativa Platform and Mythos Labs on 3D racing demo with realtime multiplayer over P2P. The game is set to Los Angeles, where popular developers’ conference Adobe MAX takes place right now.

The game uses the new set of GPU-accelerated 3D APIs – currently codenamed Molehill (see Adobe Labs page). You will be able to get your hands on this API in the first half of 2011.

Multiplayer demo – controlling with three computers

MAX Racer Teaser by Alternativa

Check this video to see how it looks like, when playing with friends all over the world:

Implementing the P2P multiplayer

My role in this game was to implement realtime multiplayer over P2P API, which I have to say works just fluently. We have tried playing the game through internet over 2000 km (from Prague in Czech Republic to Perm in Russia) and I had the feeling like we were sitting next room and playing over LAN.

P2P = Getting the best latency possible
Direct connections in P2P is the best possible method to keep your latency as lowest as possible. With direct connections, you can be sure, that the data packets will be delivered, so the transmission is fully reliable. (Note: this is not the case of Posting, Directed Routing and Multicast, where it’s best effort delivery)

When we talk about the programming logic, you basically setup one outgoing stream and 2,3 or 5 (depends on the number of players) incoming streams.

Media_httpwwwflashrea_aoibi

Then you get something, what we call Full Mesh. This P2P architecture makes sure, that all data between the players is delivered in the smallest time possible.

Media_httpwwwflashrea_pgthf

We also ran into couple challenges in multiplayer, it’s not enough to transfer only direction changes (like forward, back, left, right), you also have to transfer a real position to sync on position. This will still make it a little bit choppy, because of massive use of physics and rendering speed. So the solution was to implementing interpolations, which is similar to smoothing. If you are at the Adobe MAX, make sure you drop on my session on Tuesday – Building P2P Multiplayer Games. I will also write more article in the future on how to solve this.

Hooking up Game Controllers
Yes, yes, yes, yes! We are working on adding the support of game controllers in Flash Player in the future. I hooked-up MAX Racer with a steering wheel USB controller and I have to say, it was pretty easy to do. I am pretty sure, you will love it and I can’t wait to see more Facebook realtime games with controllers online.

More info MAX Racer

If you want to check more info about the MAX Racer, watch this video by Thibault Imbert (PM for Flash Player).

Game Screenshots

Look at that details. Yeah, and we are rendering this in 60fps running 1920×1080.

Media_httpwwwflashrea_abwyk

Media_httpwwwflashrea_invga

Media_httpwwwflashrea_jkpms

Art was done by Mythos Labs. Kudos for the great job guys!

Credits
I just wanted to give a credit to Todd Wahoske and team from Mythos Labs for these great graphics and to Alternativa Platform guys – Vladimir Babushkin, Mikhail Fominykh, Anton Volkov and Alex Karpovich.
Finally I have to say that it was a great pleasure to work with guys on this game!

Flash on!

Sep 30

Can’t be at MAX This Year? Catch it Online Live!

Media_httpblogdigital_hiifg
Everyone I talk to is starting to get excited about MAX. Maybe it’s the Mark Hamill appearance, maybe it’s that some of the new features of the Flash Platform are starting to leak out, or maybe everyone is just excited to see a bunch of friends and hang out to talk tech. The keynotes this year should get Flash developers really excited about the platform. We’ve got some great stuff to show off and a couple of surprises that people will be talking about.

Media_httpblogdigital_bgtdd
If you can’t make it, you’ll be missing out on the networking and the chance to bother talk to the engineering teams but we still want to give you as much access to the conference as possible. So this year we’ll be streaming the keynotes live AND if you show up 10 minutes early you’ll get some behind the scenes peeks that even the regular attendees won’t get to see. There’s going to be some special content just for those of you watching online and we’re going to make it fun and entertaining so you not only get to see the news live but also get some insight into what’s happening at MAX.

In addition, the team is making the most popular sessions in our three tracks – Design, Develop, and Envision – available each day and the other sessions will be following shortly thereafter. So you not only get the info live from the keynote but you can see the best sessions at MAX from wherever you are.

Get Updates

Tags

Archive

2012 (1)
2011 (11)