In learning new things in software development, I believe that it is best to scale your knowledge by developing simple working projects. When creating a polling html5 game one should also consider polling request limitations and advantages, this will help you decide what type of gameplay you can create on top of it. Polling is different from websocket, webrtc and other tcp socket connected interfaces. The advantages are as follows:
- The game will work in most devices, This is the only major advantage of polling over other technologies, html5 is still on the works and currently not all browsers or mobile devices support webrtc and websockets(websockets are slowing being supported by newer browser.).
- Server resource, polling games if designed properly can use less resources compared to dedicated connections.
- Learning curve, if currently you only know traditional php, dotnet and java. I would recommended though to use nodejs as polling server to achive better response rate.
Below are the list of things to note of on the client side.
- Create a single synchronization function
- Create a request builder
- Create a response assigner
- Create an event handler trigger for every response recieved
- If possible put all the heavy processing in the client side
- Handle online and offline transition
Below are the list to note of on the server side.
- Go for Nodejs or other high performing server
- Simplified query
- Identify flash data
- Sensitive data should be handled in the server side
Polling should only be used on games that requires less update non-real time games, achievement tracking or static data request such as global maps, monster definitions or weapons. Using hybrid of polling and websockets/webrtc would take advantage of each others pro and cons.