Creating a browser game [closed] - sockets

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
My goal is to create a game in a browser (a game like wordfeud) and my question is what is the best way for the networking part? In Java, C# and so on you can use socket programming (server-client programming), but how is the best way to do it in a browser?

Yeah, node.js is excellent for game server, for the following advantages.
Network IO and scalability. Perfect match for game servers, which requires realtime, scalability, high density network IO.
The node.js thread model. Single thread is quite suitable for game server, it helps us to handle all the troubles about concurrency, lock and other annoying questions. Multi-process, single thread is ideal for game server.
The language advantages. Javascript is powerful, popular and performance good. Further more, if you choose HTML 5 for client, you can reuse a lot of code logic between server and client.
But the original socket.io is single process, if you want scalability and extensibility, some framework may needed. Pomelo is a good candidate for it, it's an open source game server framework in node.js.

Server side: Node.js + socket.io seems appropriate for those types of connections
Client side: javascript or actionscript from the client side.
Example
PopCap (which makes a bunch of popular facebook games like zuma blitz and bejeweled blitz) uses predominantly flash / actionscript / possibly flex for their games and it seems to do the trick. Javascript would be more accessible to those who wanna play via a phone or tablet though.

Related

Best practices for building a chat app? (REST vs Websockets) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed last year.
Improve this question
As the title suggests, I'm building a simple chat app in Node/Express + React, and I'm using socket.io to get real time updates.
However, other than the chatting itself, rest of my app is very basic (registering, signing in, creating rooms etc), and while it's definitely doable to make all those requests just socket emits, it feels like bit of an overkill.
So I was thinking of creating a regular REST API for that stuff and outsourcing it into a separate file, then creating another file just for the chatting function itself, where I'd use socket.io, but I'm afraid that it may seem a bit unprofessional, or leave an impression that I don't know how to use sockets well enough.
Key point: When finished, this app will be posted to my portfolio, so I'm not very concerned about what just "can work", but rather what's the best and cleanest way to do it? Should I switch everything to sockets and use them even for basic fetching of lists and stuff? Or is it better practice to mix the two, and use REST for, well, the rest?
In my experience, To mix the two is the best way to do that.
I did that in many projects and it worked well.
I surely think that modularity is the best way to make code clean and qualified.
So, to use both of regular REST API and websocket is more professional.
Thank you.

Can Google's GWT be hacked? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm planning to make a multiplayer card battle game using Libgdx for the web, it uses the GWT engine for web deployment.
Is this engine secured? Can it be hacked? I don't want to waste my time learning it only if it will be hacked later on.
Thanks.
There is no engine as such. GWT compiles Java code to javascript which is then downloaded and run in the browser. By default this is obfuscated. It is difficult to modify but as the code is available in the browser it is theoretically possible to reverse engineer and modify it.
GWT puts no restrictions on how you implement server side web application code. It provides libraries to help with client to server RPC which you may choose to use or not. That means the server side security is down to you and is as secure as you want to make it.

what the technology to create a real time application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
i wanna to know what the technology must i do when i want to create an application like:
real time application ?
multiplayer in game ?
sometimes i'm read this article keep alive.
what is that support in socket TCP ?, i'm already read server push but is many example work under HTTP, how about in TCP like create a socket TCPServer and TCPClient.
There isn't just one "go-to" technology for making real-time / multiplayer gaming applications. You have to understand a multitude of different programming realms like graphics manipulation, threading, networking(TCP,etc). I would say it would be good for you to pick up a book on game development and design at your local library, bookstore or on the web. You also want to decide where and how you want to run the game. If you are going for a desktop application you are probably going to want to use a language like Java or C++/C#. For web applications Java and Flash are historically the way to go, and there is even a growing case for games written primarily in javascript (presumably with a .NET/PHP back-end).
If you want to jump right in you might try a framework like Unity which I believe is based on Microsoft's .NET framework. This tool has a lot of things built into it which would help you get started.
I know that is not a lot of specific information but hopefully it points you in the right direction.

Is XMPP fast enough for MMO-like collaboration? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm looking to create an architecture for my dissertation that will combine IM features (chat messages + rosters) with collaboration (file transfer, simultaneous editing and collaborative drawing).
The clients will be a mixture of iPhone (and possibly Android) and desktop apps.
The list of technologies I've looked at is almost too long to mention, but I've narrowed it down to the MQ-like RedDwarf/Project Darkstar or XMPP with an OpenFire server.
The problem is, XMPP seems ideal for the IM functions but the overhead of XML seems to me like it might be an issue when communicating the touches on a screen involved in drawing over, say a 3G connection. Conversely, the binary messages of RedDwarf (or ZeroMQ/RabbitMQ etc) seem very fast but lack some of the higher level features of XMPP.
The question for me is, has anyone had experience using XMPP in this way (I'm aware Google Wave use(d) Google's variant of XMPP so perhaps it is), and is it efficient enough to send hundreds of small messages from a mobile device?
XMPP is fast, but parsing xml does take some more cpu power than a binary format. However it is much easier to user/debug than binary protocols.
Your server is not going to be limited unless there are thousands of devices communicating at the same time, so the bottleneck will probably be your mobile device parsing and creating xml stanzas.
XMPP can also be a drain on your mobile battery life if there are lots of friends connecting/disconnecting (resulting in presence updates to be processed). That might also be something to consider.
I'd suspect that the 3G would be a greater cause of latency than XMPP.
And use of compression greatly reduces the overhead of XML.

How to write a WOL app for iPhone? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Wake on LAN so cool, just want to write a iPhone app to WOL my PC, but have no idea to code, any one can point me the way?
If you've no experience of programming, then this is a very large first step. (More of a sheer vertical incline really.)
As such, you might want to take a step back and have a look a some basic (or indeed BASIC) programming tutorials. (Google is your friend.)
Alternatively, Apple has good online documentation regarding Objective C and the Cocoa (the language and framework that iPhone applications are written in.) A good place to start for this would be Apple's Introduction to The Objective-C Programming Language.
Basically you need to send a magic packed as described here, to do that you'll need basic programming knowledge and some knowledge on socket programming, here is a good book on the subject. There are numerous examples of that.
But in the end perhaps I could persuade you to purchase one of several iPhone applications that do exactly that, or grab the free one?
You'll need an understanding of bsd sockets as well as the user interface kit framework to put the necessary controls on the screen.
Or of course download an existing free app like this one which does it already, automatically detects your mac address, and also tells you whether your machines are on or off:
http://itunes.apple.com/us/app/wake/id396566137?mt=8
All the best for your projects.