Jump to content
  • Advertisement
Sign in to follow this  

MMO proceeding actions design pattern

This topic is 2246 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For the moment, i am studying Photon, with its Operation and Events.
I was looking at their sample for Login, InterestAera subscibing, etc...

But i would like to find some design-pattern or algorithms for solving "action flow" in a kind of MMO, in which every action is long to proceed - 1s for the quickest one. Common actions will take place in around 3s to ... no limit.
So it's far from FPS requirements.

But how to organize threads, lists of actions, cancelling actions, and resolving perhaps actions zone by zone, etc...
I do not speak here about communication with the client - this is cover by photo API - but how to organize data flow action for a good response with thousands players ?

Share this post


Link to post
Share on other sites
Advertisement
Actions don't actually take 1 second to process. Instead, the effects of the action are scheduled on a timeline. When you say "perform action X" you really mean "try to look for a target 500 milliseconds from now, then start particle system X 750 milliseconds from now, then affect the targets hitpoints by -20 at 1300 milliseconds from now, then shut off the particle system at 2600 milliseconds from now."

Whether it's in an MMO, or in an offline RPG, really doesn't matter -- the timing/timeline is the same. All you need to send to other viewers is usually the start of the action.

Share this post


Link to post
Share on other sites
Organization of Threads:
This is really something complicated, the best solution is almost always to run just as many threads as you have cores on the machine and constanly feed them small sections of work.
Doing this is quite complex, implementing this in C/C++/C#/Java will be time consuming and you will likely spend much time finding bugs and doing optimization.
The good news is that you don't need to do this, some programmings langauges like Erlang does this for you (if someone know any other languages that does this please let us know).

Lists of actions:
I don't really understand why you would want a list of actions. In my server implementation, I keep one Erlang process per connection client on a front end server, this process his connected to another process in the back end servers. When a client send a TCP message, the front end process decodes the packet and send the event to the backend process which applies some logic and does or doesn't respond.

Cancelling actions:
I can understand why you would want to do this. In my own implementation, I have implemented a service that keeps track all load on the backend services, when the load on one server raises above a certain treshhold in my "zone cluster", I add a new server to the "zone cluster" and start migrate objects from the loaded server to the least loaded server in the "zone cluster" (which is highly likely going to be the new server I just added).

Resolving perhaps actions zone by zone:
Again in my own implementation, I have a group of servers, call it "zone clusters" if you will that together run the operations of a zone. While they all do the same logic, an object in the zone only exists on one server at a time. This means when my front end processes recieves network packets, event are naturally distributed to each server in the "zone cluster" depending how many players they have.

But how to organize data flow action for a good response with thousands players:
I think I pretty much explained this in my post here.
If you want more info about my solution you can read up here: http://www.next-gen.cc/uploads/Next_Generation_MMO_Architecture.pdf
And here are test results, having connected 12,000 TCP clients to my server (one front end server and one back end server), response times are between 10 and 20 milliseconds (test machine and server runing on local network): http://www.next-gen.cc/uploads/2010_5_25_23_37_39_report.txt

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!