[erlang-questions] How to write a MMO game server in Erlang?
Wed Feb 3 04:28:40 CET 2016
I try to using Erlang to implement my tiny mmo game server.
I know the skeleton of c++ version is like this:
int interval = 50; //50ms, 20 ticks per second.
int sleep = 0;
uint64_t tick_start, tick_end, tick_passed;
tick_start = CurrentTick();
// all logic, timer will be drive in the app.tick
tick_end = CurrentTick();
tick_passed = tick_end - tick_start;
sleep = interval - tick_passed;
if (sleep < 0) sleep = 0;
But now, I have no idea about the Erlang version.
in the erlang world, one client is one process (maybe gen_server). the
process has it's own loop, and timer can use erlang:send_after or
I want to know how to implement a MMO server in erlang ?
consider this situation:
Player A VS Player B.
A cast a skill X to some direction, then X flying.
the server need to detect whether X is hit on B,
When hit, add X's debuff on B, debuff will remove after 3 seconds.
many things , many times , many sync ...
c++ has a signal tick,
But how about erlang ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions