1

I'm working on a puzzle game in Flash. It's a two-player, head-to-head game with some realtime elements. It is not Tetris-like, but the level of player interaction and the rate of movement is similar to, though slightly more complex than, Tetris Battle on Facebook.

Naturally, I would like to match players up over the Internet. I would also like to prevent cheating as much as possible. Because of this, I am researching an authoritative server solution, much like Colin Moock describes in this answer to a similar question. That is, the server runs the authoritative game logic while the client runs a parallel simulation, sending player movements to the server for validation.

My question is this: Doesn't this essentially mean implementing the game logic on both the client and server side? Worse still, the server probably isn't going to run its simulation in Flash/ActionScript, which means you can't share code and you'll be implementing the same logic twice in two different languages. This sounds like a logistical, bug-riddled nightmare. Am I misunderstanding the problem?

4

1 に答える 1

2

このタイプの Flash ゲーム/アプリを作成するいくつかの企業で働いてきましたが、これに対する解決策に出くわしていないと言えます。安全性が必要な場合は、すべてがサーバー側で評価される必要があり、応答性が必要な場合は、呼び出しがサーバーに送信されている間にクライアントが処理できる必要があります。クライアント サーバー通信のエキサイティングな世界へようこそ。

そうは言っても、特にビジネス ロジックをビューから適切に分離している場合、AS3 コードは Java と非常によく似ています。これにより、Java サーバーの作成が非常に簡単になります (数日でサーバー ロジックを作成できるように数人の Flash 開発者をトレーニングしましたが、完全なサーバーを作成するには時間がかかります)。また、Actionscript から Java へのコンバーターを探して運が良かったかもしれません (ただし、私が見たものはすべて後で手動で修正する必要があります)。

于 2011-11-14T01:41:23.470 に答える