I had honestly never heard of Comet techniques until the other day. To those who have never heard of it, it is also called "reverse AJAX" (the name is not an acronym as far as I know; it is just a play on "AJAX" since "Comet" is another cleaning product). It allows the web server to push updates to the browser without the browser specifically asking for it. Obviously the implications of this for browser-based games are huge. You could have real PvP that notifies players as soon as they are attacked and forces a page reload to a battle screen. You could have true real-time chat where the client would only need to send user-initiated chats, and they get all chats from others automatically, without polling or similar bandwidth-wasting techniques. You could have a real-time map that shows the movement of other players, also without polling.
However, with webSockets on the horizon, it really makes me question whether it is worth investing in this technique for something as complex as a game. Obviously webSockets would almost completely nullify the usefulness of such odd techniques as "long-held HTTP requests" and other Comet strategies. But since it seems Microsoft is going to hold off on webSockets in IE9 until a more solid, official standard for them is released, it could be quite a while before this is a reality for public internet development.
So what do you think? Does anyone know anything further about IE9 support for webSockets?
Worth learning Comet (reverse AJAX) techniques?
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Worth learning Comet (reverse AJAX) techniques?
The indelible lord of tl;dr
Re: Worth learning Comet (reverse AJAX) techniques?
You bet. There isn't anything better! Every use omegle? Look how fast it goes even with a few thousand users. All down to using comet techniques rather than constantly calling files from the server. I'm actually using reverse Ajax in my browser game. It's coming around December in Alpha.
And no I've been testing with IE9 and there's not much support. But there isn't much support for much Ajax yet either.
Edit: Just got my hands on a newer IE9. Yes! There's support
.
And no I've been testing with IE9 and there's not much support. But there isn't much support for much Ajax yet either.
Edit: Just got my hands on a newer IE9. Yes! There's support
Fighting for peace is declaring war on war. If you want peace be peaceful.
Re: Worth learning Comet (reverse AJAX) techniques?
Here's a chat I was working on. Didn't know I had it on my laptop. Thought I lost it with all my other stuff when my brother decided my computers hard drive needed to be formatted.
Here's a link:
http://chrishemmens.com/shoutbox/
You may notice the debug at the bottom.
How it works is, the client asks the server for a response. The server keeps checking the chat file if it's been updated. If it's been updated. The server sends to the client the new data. Then it all starts again.
Here's a link:
http://chrishemmens.com/shoutbox/
You may notice the debug at the bottom.
How it works is, the client asks the server for a response. The server keeps checking the chat file if it's been updated. If it's been updated. The server sends to the client the new data. Then it all starts again.
Fighting for peace is declaring war on war. If you want peace be peaceful.
Re: Worth learning Comet (reverse AJAX) techniques?
Quick flowchart I put together

Shows you basically how it works.

Shows you basically how it works.
Fighting for peace is declaring war on war. If you want peace be peaceful.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Worth learning Comet (reverse AJAX) techniques?
Wow, thanks! I definitely think I am going to check in on this then. This could really help to streamline a game! Again, thanks for all the info!
The indelible lord of tl;dr
Re: Worth learning Comet (reverse AJAX) techniques?
K, I've been working with the chat script a bit more. And have found out that using GET instead of POST saves a lot of loading time. I'm going to tweak it even moar, to see how fast I can get it to go. Keep in mind this is running off a slow overused server.
Fighting for peace is declaring war on war. If you want peace be peaceful.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Worth learning Comet (reverse AJAX) techniques?
It worked for me just as fast as any other straight AJAX chatboxes I have ever seen.
The indelible lord of tl;dr
Re: Worth learning Comet (reverse AJAX) techniques?
Curious to see what kinda chat thingy your working on chris.
Iam looking for a chatbox / shoutbox for my game.
So i tried to enter your site chris, but it seems to be down ??
Iam not looking for anything fancy or such, just a little box where players can type stuff.
And is it not best to use a chat that only updates/refreshes when ever a player says anything,
rather than querying at say every 1 - 5 sec wich i have seen some uses.
Iam looking for a chatbox / shoutbox for my game.
So i tried to enter your site chris, but it seems to be down ??
Iam not looking for anything fancy or such, just a little box where players can type stuff.
And is it not best to use a chat that only updates/refreshes when ever a player says anything,
rather than querying at say every 1 - 5 sec wich i have seen some uses.
Re: Worth learning Comet (reverse AJAX) techniques?
Hey chris may be pushing my luck but is it possible to see the js as well
cheers dave
cheers dave
Re: Worth learning Comet (reverse AJAX) techniques?
certainly sounds the way forward 
got any links to decent tutorials on using said methods??
got any links to decent tutorials on using said methods??
New Site Coming Soon! Stay tuned 