The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. October 16, 2019, 02:32:45 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Java vs Flash vs Ajax for online multiplayer game  (Read 11275 times)
mrsdf
Rookie
**
Offline Offline

Posts: 20



View Profile
« on: October 20, 2007, 08:16:16 AM »

I'm looking into developing a multiplayer card game website (don't know yet.. poker, blackjack, probably all of them if it works out). The server part will be mostly php/sql, but I can't really decide on the client side. I've seen various java clients on other websites of the same nature out there, but I'm thinking of using xmlhttprequest/script tag for client-server communication.

Due to the nature of the website, most processing will be done server-side for security reasons, and the client will be just a pretty interface with some numbers and buttons changing, nothing that js can't handle i think.

I got a few things figured out by now.. I need a chatroom, game rooms, pretty bitmaps of people sitting around a table, dynamic graphics loading, a way to check for player latency, constant client-server data exchange.

So far, I can't think of anything that JS can't do for the client side, but I also know it can be done, and it has been done in the past using Java or Flash. I personally hate flash, and have .. noob to medium Java skills Cheesy, but I could fix that. I also know that the big websites probably had a very good reason for coding stuff in java for the client side.

Would you code this thing using Ajax?

The only downsides I can see right now are that the source is plaintext and that the client must request data all the time... eg: 10 players/game table * 3 requests/second for each player * 10 tables = 300 http requests/second. I might be happier with the server pushing the data to the client whenever it is needed.

Any thoughts ?

Logged

We're sp4mmin', we're sp4mmin', I hope you like sp4mmin' too...
arms
Expert
****
Offline Offline

Posts: 235



View Profile
« Reply #1 on: October 20, 2007, 08:51:58 AM »

if i was going to do it i would probably choose flash.
actionscript is basically javascript and flash will make the animations easier.
so to me, flash = less work.
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #2 on: October 20, 2007, 12:08:35 PM »

I don't know that I see it as an either/or.

JS will make it run on anything, even an iPhone, so that would be my choice. So how do you keep comms up? Perhaps a Java app that is persistently connected and dropping cookies/semaphores/data/whatever such that your JS can pick it up when it needs to... or you could use flash for the same, but particularly today the iPhone can't do flash, if this is one of your targets. Rumors are that flash will be out in the next couple months, and if that's the case, other phones and ultra portables will follow suite.

I think it would be a mistake to imagine that you must code ALL of it using one tool when all of what you described are (for the most part) available to any browser - choose the right tool for each component. Given what you've talked about in terms of traffic, whether it's Java, Flash or JS, packets will be flying - it just depends on the overhead of the protocol. If you go Java you can take Apache out of it and create a dedi-connection... but Apache on the right box would do just fine IMO and you could still use PHP and such for backend processing, which will certainly simplfy backend construction.

Although I have not put lots of users on lots of ajax connections at once, I do have one app where a status bar moves based on a job - so it's coming back up at me about everh 1/10th of a second until the job is done and I get zero troubles. I think the notion of more packets faster is a humnan brain imagination limitation rather than a for-reals 'puter issue. I think that they do it just fine...
« Last Edit: October 20, 2007, 12:10:37 PM by perkiset » Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
DangerMouse
Expert
****
Offline Offline

Posts: 244



View Profile
« Reply #3 on: October 21, 2007, 06:16:12 AM »

Prehaps check out COMET, a reversal of the AJAX principle, that may reduce the number of requests that are required if you went the javascript route. I guess you could argue that you open yourself up to more vulnerabilities using javascript - people are more likely to poke around trying to break code they can read.

DM
Logged
lynwell07
n00b
*
Offline Offline

Posts: 1


View Profile
« Reply #4 on: October 07, 2009, 10:21:09 PM »

Java is a programming language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. While flash can manipulate vector and raster graphics, and supports bidirectional streaming of audio and video. It contains a scripting language. While ajax is a group of interrelated web development techniques used on the client-side to create interactive web applications or rich Internet applications.

[nutballs says kerpow]
« Last Edit: October 08, 2009, 07:50:33 AM by nutballs » Logged

No links in signatures please
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #5 on: October 08, 2009, 10:41:00 AM »

[Nutballs is da'man]
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
kurdt
Lifer
*****
Offline Offline

Posts: 1153


paha arkkitehti


View Profile
« Reply #6 on: October 08, 2009, 10:53:24 AM »

[Nutballs is da'man]
Yeah but he also looks like this cartoon:
Logged

I met god and he had nothing to say to me.
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« Reply #7 on: October 08, 2009, 12:07:29 PM »

damn straight.

fucking spammers  Roll Eyes
Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!