• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
espa

Making WebGL game multiplayer

5 posts in this topic

I've been making some progress on a html5 browser game using webgl and am interested in making the game multiplayer (so my friend and I can play simultaneously  ). I will not be using a dedicated server at this point of course.

 

My question is where should I start to begin learning about network programming so I can do this sort of thing? I know there are a lot of books out there on network programming I am just unsure where to start and most of all which will be most relevant for webgl games specifically. Thanks in advance.

0

Share this post


Link to post
Share on other sites

At the very least you'll need some kind of lobby server to connect you to your friend, at least to be even moderately convenient.

2

Share this post


Link to post
Share on other sites

In the first place, if there is no centralized server, from which source will you get the list of your peers to connect to?

If your are planning for a private release of your software just between you and your friend you can still hard code both of your ip addresses to connect to each other or you will have no way to find each other.

 

But even so, if you know the ip address which you want to send a request to you will have to deal with the HTTP Security model on top of which WebSockets are based.

If the cross-domain network communications issues are not a problem for your specfic type of deployment (full public vs inside a business or private network), https://github.com/gimite/web-socket-js#readme may help you with their "HTML5 Web Socket implementation powered by Flash".

 

Chrome has also a way to let developers ask the user for network permissions by installing your web app as a Chrome app. But you are limited to the Chrome browser user.

 

Today you cannot host a MMO inside an HTML5 browser without a centralized server because of the security implications of the cross-domain HTTP policy restrictions.

 

If the choice of WebGL is not as much important for your project, you can be more easily accomodated with Unity with their full network stack.

Edited by MathieuDSTP
2

Share this post


Link to post
Share on other sites

In the first place, if there is no centralized server, from which source will you get the list of your peers to connect to?

If your are planning for a private release of your software just between you and your friend you can still hard code both of your ip addresses to connect to each other or you will have no way to find each other.

 

But even so, if you know the ip address which you want to send a request to you will have to deal with the HTTP Security model on top of which WebSockets are based.

If the cross-domain network communications issues are not a problem for your specfic type of deployment (full public vs inside a business or private network), https://github.com/gimite/web-socket-js#readme may help you with their "HTML5 Web Socket implementation powered by Flash".

 

Chrome has also a way to let developers ask the user for network permissions by installing your web app as a Chrome app. But you are limited to the Chrome browser user.

 

Today you cannot host a MMO inside an HTML5 browser without a centralized server because of the security implications of the cross-domain HTTP policy restrictions.

 

If the choice of WebGL is not as much important for your project, you can be more easily accomodated with Unity with their full network stack.

 

You covered a lot. Looks like I will need a dedicated server to achieve what I'm going for. It's not near the scale of an mmo but I'm eventually going for a similar player interaction experience. I know these kinds of implementations are not easy by any means so do you know where I should begin to learn about setting this up with WebGL/HTML5 once I decide to get a server? 

0

Share this post


Link to post
Share on other sites

At the moment there is no way for a websocket to "listen" in a web browser which is a bit of a pain for peer to peer games.

If you want to stick to Javascript (to maintain a similar codebase) you can use node.js for this.

 

Otherwise I recommend http://websocketserver.de. One thing you will notice is that websocket servers are so sodding overengineered and it is almost impossible to find a simple client / server example beyond the handshake (which is actually the easy bit).

 

As for a list server, I highly recommend using IRC as the system to distribute instance server details. It is barely any bandwidth (so wont annoy other users) and also means you don't need to maintain a central server. Though for websockets to normal sockets to communicate you will still need to set up a websocket proxy.

2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0