»jabjabjab Posted December 15, 2011 Author Report Posted December 15, 2011 Thanks to JoWie's help, I now have gravity working! Thanks! Quote
JoWie Posted December 15, 2011 Report Posted December 15, 2011 Kaas!, Do some googling first for fuck sake. You don't get to use sockets. Only way to use real sockets in this context is to use a signed java applet. WebSocket is a protocol on top of HTTP.It starts of by doing a proper HTTP 1.1 request (Upgrade: websocket).The server needs to reply with a HTTP response (which includes a hash of a key the client supplied previously to show it supports the protocol).After this, both client and server may send data when they feel like it. The payload data (the stuff you send from the browser/server API) is contained in a websocket frame with some header information. The payload data is even XOR'd with a randomized masking key to prevent poisoning of intermediate proxy servers. Quote
»jabjabjab Posted December 15, 2011 Author Report Posted December 15, 2011 Just leaving this here... http://i559.photobucket.com/albums/ss31/XDreamersMS/Continuum/Aphelion/Screenshot-1323952805294.png?t=1323952853 Quote
»jabjabjab Posted December 15, 2011 Author Report Posted December 15, 2011 http://i559.photobucket.com/albums/ss31/XDreamersMS/Continuum/Aphelion/Screenshot-1323968879191.png?t=1323968885 Quote
Drake7707 Posted December 15, 2011 Report Posted December 15, 2011 Why would anyone want to jump to a weak typed language and horribly confusing (to some, including me) object oriented structures, while java works just fine on all platforms? 'But then it's in a browser' doesn't sound a valid statement to me. I don't have anything against javascript and HTML for GUI related things or to some extent business applications (for basic CRUD operations), but to write & debug entire games in javascript would be the equivalent (to me at least) of walking 100 km (or miles if you prefer) barefoot on sharp rusty nails. Quote
JoWie Posted December 15, 2011 Report Posted December 15, 2011 (edited) I have a lot of experience in a lot of languages and javascript is one of my favorites. I prefer it over Java (depending on the type of project of course).What most people hate about javascript is not actually because of javascript. Its the horrible browser API (mostly in old browsers) and crappy tutorials.I usually only write javascript for web servers and very recent not-IE browsers.My only real annoyance about javascript is the lack of 64 bit integers. I use javascript servers (node.js) which is absolutely great for web applications (share code with the browser, event loop instead of forks or threads, DOM instead of a stupid print(), nothing blocks: everything is event driven, etc)Debugging is incredibly easy. And more powerful than most debuggers I have come across. You can do things such as temporarily overriding a function on 1 object, or all objects of the same type. Edited December 15, 2011 by JoWie Quote
Cheese Posted December 15, 2011 Report Posted December 15, 2011 (edited) personally, i think doing it in javascript sounds like a terrible ideahowever, i havnt done anything in javascript since ppl still used tags on the internet$0.02 . Edited December 15, 2011 by Cheese Quote
JoWie Posted December 15, 2011 Report Posted December 15, 2011 Haha, we had an intern that actually still used . But yea thats is not the kind of javascript I am talking about. Oh btw, the next (official) Command & Conquer is going to be in javascript Quote
»Lynx Posted December 15, 2011 Report Posted December 15, 2011 I use javascript servers (node.js) which is absolutely great for web applications (share code with the browser, event loop instead of forks or threads, DOM instead of a stupid print(), nothing blocks: everything is event driven, etc)Debugging is incredibly easy. And more powerful than most debuggers I have come across. You can do things such as temporarily overriding a function on 1 object, or all objects of the same type. Node is great, spent a lot of time with it this summer as we're using it while we move our prototypes into production -- took a *lot* of getting used to but the responsiveness of the applications is staggering. I'm still not sold on a browser based game, not yet at least but if it can be done then properly it certainly has many advantages. Are you planning on using Node for whatever it is that you're doing? Quote
JoWie Posted December 15, 2011 Report Posted December 15, 2011 Node is great, spent a lot of time with it this summer as we're using it while we move our prototypes into production -- took a *lot* of getting used to but the responsiveness of the applications is staggering. I'm still not sold on a browser based game, not yet at least but if it can be done then properly it certainly has many advantages. Are you planning on using Node for whatever it is that you're doing? Yes, node.js is what I would want to use. The performance is indeed amazing. Apache and php are so slow under heavy load. Some people are even using node.js as a loadbalancer. Its more a proof of concept kind of thing. To show that its possible to write such real time games (and not another silly text rpg) in a browser.And with proof of concept I mean, try to resolve all issues. But do not build a full game (or at least, initially).I have not yet completely decided I am going to do this however. The hackability/modability for zones would be so tremendous. Its like every zone would send its own continuum version to you.Note that it would still be possible to have a stand alone application (~17MB) Here's the C&C browser game I was talking about: Quote
Marioman Posted December 15, 2011 Report Posted December 15, 2011 There is however the option to have a bridge applet (Java or Flash) that does the UDP communication, which can be called from the JS. Javascript as a language isn't too bad, you can achieve a lot of functionality, even pseudo.class based stuff. (like super() and inheritance). Hacking would be an issue. Quote
»Lynx Posted December 16, 2011 Report Posted December 16, 2011 The only thing that bothers me with JS are 95% of the guys who use it. Other than that, it's fine. Quote
JoWie Posted December 16, 2011 Report Posted December 16, 2011 (edited) I think UDP only works in flash when you are inside an AIR application.It is possible to interact with a signed java applet (user gets a big security warning) to do UDP, but that would defeat the purpose of the experiment (just run jabjabjab's client in an applet). You don't absolutely need UDP though. It is probably possible to achieve the same latency (at the cost of more bandwidth) with TCP socket(s). Which is of course one of the things I want to find out. Edited December 16, 2011 by JoWie Quote
Drake7707 Posted December 16, 2011 Report Posted December 16, 2011 This reminds me a lot of http://jsc.sourceforge.net/ (especially this example: http://jsc.sourceforge.net/examples/web/ThreeDStuff/Tycoon4.htm) , the demo's surely are impressive, I wonder why it doesn't have a lot more attention. I haven't used it myself though, so there might be some serious limitations, but parsing IL in javascript is rather cool nonetheless Anyway, I'll stop now about javascript because this is getting off topic Quote
Marioman Posted December 18, 2011 Report Posted December 18, 2011 Jowie you are more knowledgeable about this than me, as you stated TCP introduces latency issues which I don't think can be worked around. Flash player does have RTMFP http://en.wikipedia.org/wiki/Real_Time_Media_Flow_Protocol which is based on top of UDP. Anyway, jab jab jab you've done excellent work sorry to go on an aside in this thread. Quote
JoWie Posted December 18, 2011 Report Posted December 18, 2011 (edited) Ah, I thought that API was only available to AIR. Subspace does things such as acknowledgment, retransmission, etc manually.This is disabled for a few packets (balls, turf, position without weapon, green sharing, points). For such packets, the latency would at a minimum double over TCP. For other packets the minimum latency would be the same.I think that doubling the latency for such packet would not matter a whole lot. The biggest issue is that when packetloss occurs, all other packets have to wait. This is because TCP maintains the proper order. You can workaround this by opening multiple TCP sockets and alternating between them. (the default connection limit for firefox is 200). Same amount of data, just more sockets. Edited December 18, 2011 by JoWie Quote
»jabjabjab Posted December 18, 2011 Author Report Posted December 18, 2011 http://i559.photobucket.com/albums/ss31/XDreamersMS/3D_artwork/IceTest3.png?t=1324227458 http://i559.photobucket.com/albums/ss31/XDreamersMS/Continuum/Aphelion/Aphelion_Sprites/CrystalBlue.png?t=1324230638 Quote
PoLiX Posted December 18, 2011 Report Posted December 18, 2011 looks more ice than rock, but unique nonetheless. Quote
L.C. Posted December 18, 2011 Report Posted December 18, 2011 The graphics have been done in html5 before (and it performed well), the issue was/is getting the networking rightNetworking got sorted out. We played together with around 16-20 players and it worked fantastically. Of course, this was like last year. =P Quote
Sketter Posted December 18, 2011 Report Posted December 18, 2011 looks more ice than rock, but unique nonetheless. Could be ice rocks Quote
JoWie Posted December 18, 2011 Report Posted December 18, 2011 The graphics have been done in html5 before (and it performed well), the issue was/is getting the networking rightNetworking got sorted out. We played together with around 16-20 players and it worked fantastically. Of course, this was like last year. =PYea I have played it with networking too.But weren't you talking about lag issues? And how does it stand against cheats? Quote
L.C. Posted December 19, 2011 Report Posted December 19, 2011 The graphics have been done in html5 before (and it performed well), the issue was/is getting the networking rightNetworking got sorted out. We played together with around 16-20 players and it worked fantastically. Of course, this was like last year. =PYea I have played it with networking too.But weren't you talking about lag issues? And how does it stand against cheats?"Networking got sorted out. We played together ... and it worked fantastically." I'm just a player, not a developer. Quote
Avast Posted December 19, 2011 Report Posted December 19, 2011 (edited) Whats the point of this, subspace would not be enjoyable on a phone, and no one would be any good at it. Resolution too small, bigger resolution then everything is way to small. Probably laggy as hell connecting from a phones wireless etc. So hopefully there are more uses for this than just an android or iphone app. Edited December 19, 2011 by Avast Quote
»Xog Posted December 19, 2011 Report Posted December 19, 2011 If jab wants to make a java client then he can make a java client. stfu avast it's his project. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.