Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play framework as a game server

I want to try writing a simple game for web, using the websockets and HTML-5 technologies, and I am thinking about doing this with Play framework and Scala. However, the type of game that I want to make is one with a persistent world where things happen themselves, and not only as player action consequences, what means, that it does not fit the Play's stateless philosophy. I have tried starting a separate thread in Play application, that would act as a usual persistent gameserver with a running world, and it seems to work. How can you comment on that?

  • Will I face some big problems with this approach?
  • Is there a better solution and setup for that? What do ppl usually use for such things aside from standalone (non-http) game servers?
  • Can you share any interesting experience considering a similar problem?
like image 885
noncom Avatar asked Oct 08 '22 16:10

noncom


1 Answers

Do not mess up persistent with a "always running thread updating info".

Most of the time, such games just save last update time and they calculate new values based upon time elapsed between now and last update. Any web framework or technology can do that. Even if I am a big playframework fan/addict, I do not think the persistent argument in itself is enough.

But if you need :

  • good websockets integration,
  • support heavy traffic,
  • massive concurrency without massive servers

then indeed, Playframework might be your choice.

like image 143
i.am.michiel Avatar answered Oct 12 '22 12:10

i.am.michiel