Jump to content
  • Advertisement
Sign in to follow this  
Mythics

[web] P2P Browser Based MOG

This topic is 3793 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm very fluent in VB6, heavy into learning C# and VB.Net, and now I'm wanting to move into more browser based programming. I've done a lot of network programming and database manipulation, report generation, etc.. but never done anything for a web browser. I'm mostly looking for opinions on how I could accomplish a peer to peer browser based multiplayer online game. My real difficulty is in figuring out the best way for me to accomplish the bare basics of this potentially large task. I've got an artist working on some graphics that will most likely take a year or more before completion, so I have time, but the game designer is wanting to know what our capabilities should be after that amount of time. Should login/profile information be PHP based to a MySQL database? javascript for image manipulation / collision detection client side? Can javascript handle TCP/IP even? If so, what are the best encryption methods out there to prevent players from cheating if everything is client side? Maybe there are other languages out there to do everything I'm looking for, or perhaps some way to use VS.Net to generate OCX files that could be embedded into any and all web browsers regardless of OS? If anyone has any suggestions outside of using flash, please PM me or reply.

Share this post


Link to post
Share on other sites
Advertisement
Ajaxey techniques? From a quick search, it doesn't look like the best way to do what I'm going for here.. but perhaps one that could still work nonetheless.

I'm guessing from a few quick Google searches, javascript doesn't actually handle sockets? If that's the case, is there something more like a TCP/IP connection vs the Ajax method?

Can javascript handle database manipulation?

Where would the server-side script fit into the equation?

This is totally new territory for me, as the most I've done in the past is a little HTML.

Edit:
HTML/PHP sounds like my best bet for most everything I'm going to do outside of the game itself. While I could do the game in javascript most likely, I'm really needing to not only have graphics manipulation and database access, but I'm also going to need a socket connection from one user to several others (bypassing the server altogether if possible) just for referencing chat data and character positions.

[Edited by - Mythics on May 7, 2008 3:39:48 PM]

Share this post


Link to post
Share on other sites
Quote:
I'm guessing from a few quick Google searches, javascript doesn't actually handle sockets? If that's the case, is there something more like a TCP/IP connection vs the Ajax method?

You should take a look at comet.

Quote:
Can javascript handle database manipulation?

Where would the server-side script fit into the equation?

javascript can't do any database stuff. And that's were the server side script comes into play. The javascript should send an request to the server-side script which handles the database stuff.

Quote:
...but I'm also going to need a socket connection from one user to several others (bypassing the server altogether if possible) just for referencing chat data and character positions.

javascript doesn't know sockets and there is no way to have javascript clients communicate directly with each other. Actually the security model of the javascript running in browsers even disallows todo ajax requests to webservers with a different domain then the one delivering the webpage.


I should mention that whenever i wrote "javascript" I meant "javascript running in a browser".



Share this post


Link to post
Share on other sites
Sadly, VBScript is Internet Explorer only. :( (F*** IE, Firefox ftw!) So, you will want to write it in Java...

Share this post


Link to post
Share on other sites
I'm thinking pure Java will be the route I'll want to go. The syntax is pretty similar to C/C++ for the most part, and it's something that would be pretty useful for me to know anyhow.

It supports everything I can think of at the moment, handles security pretty well, networking is doable, database manipulation is doable, and there are quite a few books out there pretty cheap that I can use well.


Anyone have any opinions on my taking this route? Disagreements with Java for browser based games/sites? Potential flaws with Java that would be nice to inform a programmer ahead of time, lol?

Share this post


Link to post
Share on other sites
I'm sorry to have to be the one to inform you, but what you want to do is impossible. No web browser that I know of gives you access to sockets. The best you'll get is the XMLHttpRequest object, which is what enables all of this AJ[AX] technology to work. The problem is that you're still limited to posting HTTP requests to a web server. In no way will that enable a peer browser to post a request to another peer browser. And if that wasn't enough, you'd be crippled by latency. You're just going to have to stick to using a client-server model.

Besides, client-server is arguably easier and it's definitely more secure. Even with binary MOG clients such as World of Warcraft there are anti-hacking software installed on your computer to ensure no changes to the client are made. Can you imagine trying to prevent users from cheating by changing the javascript running in their browsers? You need a server in the middle that can be trusted to verify the validity of every action being performed by the players.

Share this post


Link to post
Share on other sites
SMR, do you recommend Client-Server over Peer-Peer for all scenarios? I am working on a standalone 3D game, but I'm not sure if I should use Peer-Peer or Client-Server...

Share this post


Link to post
Share on other sites
Quote:
Original post by smrI'm sorry to have to be the one to inform you, but what you want to do is impossible. No web browser that I know of gives you access to sockets.


I thought Java could allow for this? Would that mean that Java can't allow for sockets through a simple web applet?

Quote:
Original post by smrAnd if that wasn't enough, you'd be crippled by latency.

Assuming I'm correct in my current evaluation of Java, why would latency be an issue? I could understand some latency, but the number of users in any instance will be limited to 10 or so.. meaning each user will only send coordinates and chat messages to 9 other users.

From my experiences in the past, I would think the latency issue wouldn't come up as that big of a problem as long as I know users may overlap one another (one says they're moving to X/Y position, and another does the same before receiving the first client's instructions). Another example would be if a chest is opened by a user, item acquired and all, but another user does the same thing before being informed of the first client doing the same action. It would then simply be a 'who opened the chest first' scenario, but the game we're intending to make will allow all clients to always acquire their own copy of every item (so it's not a problem).

Afaik, the only advantage to a client/server structure (in my situation) would be lower latency due to sending instructions to a server that is then queried from the other users as needed.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mythics
...


If you use Java, then you will likely have access to sockets for outgoing connections to the originating host. Your java applet will not be able to connect to another peer.

As far as latency is concerned, I was talking about http.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!