Fun and Games Live Blog (#lwsfun)

by edds. 0 Comments

Multiplayer gaming with HTML5: Are we ready? – Rob Hawkes (@robhawkes)

Started out playing multiplayer doom, but this was only local network. Multiplayer gaming is fun and social. The browser has got to the point where you can create 3d games without the use of flash.

Multiplayer is an issue as it’s not currently supported fully. HTML you have canvas to create your graphics. For multiplayer you have web sockets, web sockets upgrades http so you can have 2 way conversations. You can use node.js on the server to enable the communication.

Server tools: Kaazing is a communication engine which takes care of the real time networking. Electroserver is a similar tool which takes the lower level details out of your hands.

Game engines: impact “the best game engine I have seen out there to date”. Isogenic Engine is promising.

Problems: web sockets support is lacking, firefox removed it for security; IE9 doesn’t have it. There is a library which provides a flash fallback. Web Sockets only uses TCP which can cause problems with lag and hangups, UDP would work better as it’s not ordered by time. Latency can cause issues, people on slow networks can slow everything down. Hardware acceleration doesn’t really exist on Mac. Complexity is a big problem as there is a massive barrier to entry.

Solutions: Compression you can get round many issues just by sending less data, sending long strings can be costly; Rate limiting data can help. Optimising canvas can also save processing on the client. Using CSS instead of canvas can speed things up. Don’t be afraid of using multiple canvas elements.

Cheating and manipulation is real, people will cheat. Because it’s open code people will find the issues, you can leverage these. You can use javascript closures and such to hold people off a little bit. Move your important logic to the server so that people cant mess with it. You can’t trust data from the client.

Resources: gaffer on games, it might be written in C++ but the concepts are the same. Valve wikify there development process so you can lean from them. Bungie also have a talk they gave which is really informative.

Are we ready for HTML5 games? Sort of, there is a lot to be improved upon. In short yes but it isn’t easy.

Creative JS visual effects – Seb Lee-Delisle (@seb_ly)

Running creativejs workshops in Brighton. Moving something along a screen and it has velocity, you can add a multiplier and you simulate drag. And that is the basics of particle physics.

Live coding adding particles to a screen. Use can use the composite object (additive blending) to make light things merge together in canvas. By just switching gravity upside down and using a different velocity you can make smoke.

In webkit browsers you can give a Dom object a 3d transform and hardware acceleration will kick in on all other animations.

By rounding the pixel values of elements before you add them to canvas on a mac will speed it up as it doesn’t have to do any sub pixel antialiasing.

Rendering canvas on the iPad is still very slow but has got better with the iPad 2.

Leave a Reply

Your email address will not be published. Required fields are marked *


HTML tags are not allowed.