开发者

Building a mutliplayer game site

开发者 https://www.devze.com 2022-12-17 17:47 出处:网络
I am building a site that has a lot in common with a person-on-person chess site. I was thinking of using Rails for the front-end(User Registration, Navigation, etc) and something like Scala or Erlang

I am building a site that has a lot in common with a person-on-person chess site. I was thinking of using Rails for the front-end(User Registration, Navigation, etc) and something like Scala or Erlang for the engine(Game state and maybe AI). I was wondering -

  1. Is this a good situation to use that type of design?
  2. How exactly wo开发者_JAVA百科uld be best to divide up the functionality between the components?
  3. How would they best communicate with each other?

I'm open to any technologies or ideas.


If you're using Rails for the front-end, why not use Ruby?

If you like the idea of using Scala, why not use Lift for the front-end?


Chess is turn-based, and has a very simple board that can be handled with HTML and/or Javascript enhancements - so the basic model flows quite nicely with existing web frameworks.

With this in mind, Rails is a great choice for creating a web-based application. Rails is not just limited to crud applications, and in fact I think can write your entire app in Rails/Ruby - you don't really need to have an external engine.

Within the browser space, polling for turn updates can be done using XMLHttpRequest and a database can maintain the current game and turn state.


Looks like a simple Lift application to me. I'm not experienced with Lift, mind you, but it doesn't seem particularly more complex than the chat application that is so often demoed.


I would start by reading http://www.htdp.org/ How to Design Programs. The questions you have asked are very broad and difficult to answer without prefixing statements with "I believe that..."

I would code it in clojure (but that's just me).


I'm currently developing a suite of online games, using Scala. It's been absolutely fantastic - my game logic is much easier to get right with the static typing etc, and dealing with server/client protocol (a flash client, in this case) is made simpler via the use of Google Protocol Buffers.

If you're a huge fan of RoR, by all means use that. I think most statically typed languages are terrible to program websites in (Java, I'm looking at you here), but Scala gets rid of 90% of the pain, and gives even more safety.

Of course, it might not be your cup of tea. But I'd try just doing the entire thing in Scala, and adding another layer if that doesn't quite do it for you.


For question 1 Yes And for 2 and 3 you need to give more information in order to get an answer that could help you.

Now I'm doing something like you but for the front end I'm going to use Grails. The reason are very simple: I like Grails, Scala and I want to mix them :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号