1

The problem that lead me here is conceptual. I want to create an arena for a game. This arena will be a sort of web service because I've got to expose it for two purposes :

  • On the demonstration website where someone can play against a computer. On the demonstration website where the one that created an artificial intelligency can see animations of their parties.

  • On an API which the artificial intelligencies request to play together.

As a matter of fact I have to organize a programming contest for those AI. My problem is that I'm a little blocked as I've got a big panel of technologies, some I master, some I just heard a little, some I just don't understand.

My matter is that when 2, 3 or 4 AI play together I don't know how to deal with the turns.

My very first idea was about socket.

IA open a socket with a peculiar URL of my website and data are exchanged within the socket (It's your turn, here is my hit, Oh dear it's a bad hit try again...). I don't know if it is the right thing to do and if I can share the arena between all IA like that.

I thought about a simple http exchange as we can do with old javascript API, but it brings some difficulties as the request close each time.

I use ASP.NET to do this web service/ website in C#.

4

1 に答える 1

1

リアルタイムが必要ない場合(順番に)。

アリーナごとにキー/IDを設定することもでき、クライアントは定期的にWebサービスをポーリングして、ゲームのステータスを取得できます(これがあなたの番です、これが私のヒットです。ああ、これは悪いヒットです。もう一度やり直してください...

Webパーツの場合、JSONとAjaxを使用してサーバーと効率的に通信できます。しかし、サーバーに問い合わせるのは常にクライアントです。

-

ソケット(HTML5を使用)、または同時ユーザーが多い場合のデスクトップクライアントを使用したソケットではどうなるかわかりません。

于 2012-10-28T17:15:58.807 に答える