An hypothetical real time MMOG made in Flash.[Flash][Game][Coding]

Started by: Big Bang | Replies: 2 | Views: 1,481

Big Bang
2

Posts: 337
Joined: Sep 2005
Rep: 10

View Profile
Oct 27, 2007 11:55 PM #65459
The Basics.

A common mistake made by every programmer is to have the character send it's X and Y coordinates. That is BAD. Having the player send a new variable to the server every time a character moves, then projecting that on the clients is extremely server intensive. This is were prediction comes in, some guidelines for it:

A) Sending player collisons. That would be something like 4 booleans, those would be "canmove (up, left, right, down) = 0/1". Sending 4 booleans that don't have to be updated unless it has to reduces ping ALOT. It could be problematic with people with high pings (unlikely but whatever, may happen) as they could see the player go thru a wall if the response takes too long. That's going to be discussed on point C.

B) Sending movement and actions thru numbers. Instead of sending the coordinates you send "moving = (0 for false, 1 for up, 2 for down, 3 for left, ect...)

C) Clientside drawing. This is to reduce server strain, and to avoid graphic bugs. It's simple, while the server might be sending the canmoveleft =1 boolean and therefore making an illegal move, the client would just ignore that and just draw what it believes to be true.Also, it would separe the animations from the server, and therefore reducing server strain alot.

D) Optimizing animations and graphics. This is to avoid client strain. Flash is pretty weak compared to other languages like C++, so you must make the most by using as little resources as possible.

Making the most out of your client.

A) If you're making a, for example, quest system, make sure that quests aren't written serverside. Stuff like that should be preinstalled in the client. Avoids lag by alot.

B) Use as little CPU intensive as possible. I prefer a ugly as shit but fun game than a pretty good looking game I can't play with a FPS beyond 3.

Server optimizing

A) If you don't have any good server to host your game in, then optimize it so. Chatting rooms and constantly downloading stuff is extremely server intensive.

B) If you don't have the skill, do not attempt to do such a project on your own. Find a team of some sort.

C) Physics should be ENTIRELY clientside. I don't want to even imagine how intensive would serverside physics be in Flash.

D) Separe the game server from the download server. The game server is going to take alot of strain, so don't even dare to add the download system in the same server.

E) Release the engine. Some people might have more time to mantain a game server than you, and they might be interested to spend more money than you on it. Limit them, tho', you don't want any plagiarisers. Yet, for the sake of the actionscript community, if you ever make such a script, PLEASE release it. You will be thanked forever.

F) Get a host for your server, do not attempt to host your own server, unless you want to go bald and wrinkled at age 30. There is people who actually dedicate to mantain servers, and they have far more experience, time and dedication than you.

G) Advertise in your servers. Is the only way to generate profit, so you should really do it. Don't mind the clients who complain about it, after all, they're not coding the server. But if too many people are annoyed by it, add a premium account system of some sort. Generates more profit than ads if used correctly, trust me.
Xelectroid
2

Posts: 439
Joined: Oct 2006
Rep: 10

View Profile
Oct 28, 2007 1:26 AM #65464
This is all good, but no one here is going to make a MMOG.
Big Bang
2

Posts: 337
Joined: Sep 2005
Rep: 10

View Profile
Oct 28, 2007 1:32 AM #65466
Quote from Xelectroid
This is all good, but no one here is going to make a MMOG.


I'm aware of that, that's why I put it in Other Tutorials.

Maybe someday some random noob will bump this thread 3 years later, when some programmers arrive to stickpage, and they will read this thread.

And they will rejoice. And I will graduate with a Summa Cum Laudi.