Introducing turn-based web games

I want to implement a turn-based game for the Internet. My first choice right now is the Battleship. Nothing complicated, but still something decent fun. Some of the features I want can invite gamers to the game, be able to chat with potential opponents and chat with your opponent after you start the game. I think that I will need some kind of push notifications in order to update the opponent's boards, track statistics, etc. I did a little research, and now the best thing that probably works is something like Comet. I was looking for some suggestions about which languages ​​to use and where I should start.

Thanks in advance!

+4
source share
3 answers

I am currently using Tic-Tac-Toe, using <canvas> for drawing and WebSocket for chatting and multiplayer games. The latter allows you to have a live connection to the server, which can directly send all data to the enemy. This, of course, is exciting. I am using Nugget for server (C #).

+2
source

I think it depends on many things.

I have some suggestions, but maybe someone is better.

i started to code the game xo. (I do not know the name in English), you need to put five or x in a row. it is also based on bends. I had only a few hundred codes in php and a bit more in javascript, but the game was very slow. in 2player mode, the request-response sometimes hits 1-2 seconds, but the server is on my desktop. therefore, the actual transmission time is not required.

I think that if you create a light game, with easy calculations php is very good, easy to develop, also OOP.

but I think the best way to create your own server program in C ++ or C #.

I'm very crazy and I am added to speed: D, so I created a simple implementation of C ++ sockets and ajax communications, and I redirected my own apache web server to my program, and I answered with my program, so I was capable create 4-5 milisecfifference between request and response.

if you want to create a slightly larger game for about 100 players, I think that the native program is better, because you can store data in RAM that you do not need to execute mysql queries for each time, you can easily store data, but you need to create an interface for communication via HTTP.

+1
source

I would look at nodejs (nodejs.org). Node is a server-side scalable iio framework built on top of the V8 JavaScript engine. There is a Node library called socket.io that makes browsing easier. In addition, a new service is being developed at nodeocket.com that will make your project painless.

You can also check something like process.js (http://processingjs.org/) to draw your game on the browser canvas.

+1
source

Source: https://habr.com/ru/post/1343052/


All Articles