Thursday, November 13, 2008

How to make a Multiplayer Racing Game in Flash:

Before I can tell you completely how to make a cool real-time multiplayer racing game in Flash, I will have to answer a bunch of random questions:

How should one design the Object-Oriented architecture of such a game such that I won't have to worry about redoing everything once my game gets big? How should I implement the physics of a car? How can I detect if a player is cheating by skipping a section of the track, or if he is going the wrong way? How should I design the lobby network protocol such that it provides a robust user experience? How can I deal with the Flash Security Model? How can I organize the symbols in my swf file into multiple swf files? How can I dynamically load 'plug-in' symbols? How should I structure my network communication? How can I make it hard for hackers to crack my network protocol? How should I deal with the lack of UDP and peer-to-peer communication in Flash? How can I syncronize the clocks of all the clients? How can I ensure order of events accross the clients? How can I minimize the effect of lag and make the user experience smooth? How can I make the game robust to network issues? How can I make it easier to debug such a game? How can I create a real-time shadowing effect? How can I create a camera that can center on my car and pan the track? How can I do split-screens? How can I make a mini-map view of the world? How can I possibly test such a game? Infact, can I even make such a game?

"Yes we can!"

But, it isn't easy, and it is a lot of work. And there is no way I can give you the answers to all this... in this post. But these were all just a sample of the questions that I have answered during this journey. Yet, my game is far from done. Questions I have yet unanswered are, for example, how can I draw a car? Or, how can I make some music? But, that is why you need a 'team', with more than just a programmer, who clearly already has waaaay too much on the plate.

If anyone has any more questions they'd like to ask, or if anyone wants to give any question a priority, please let me know.

1 comment:

OJDee said...

Watching this blog with interest, I've been meaning to make a racing game in flash for a while now.