Server(Hardware)?

Hello,
I want to start developing a game for android mobile phones with jmonkey engine. The game will not be very complex, just an easy game, but I have questions about how to use the spidermonkey api and server hardware.

As i understood, the spidermonkey is a library, with which can handle the communication between a server and the clients.
But I can’t find any information about servers, which are used by forum members or which are recommended.

In fact i have no idea if i have to buy a server(hardware) and set it up at home, which is very difficult and needs knownledge, which i don’t have (firewall etc.).
Or is it possible to rent space in a server network of a company supplying this service?

Is there any documentation or help to these questions?

Edit/Add:
Another way that could be possible: Is it possible to make one of the players be the host? So the device(smartphone) of one player is both, the server and the client? Of course in software the server and the client would be seperated, but on the same hardware.

I have no experience with servers, so i don’t know which of the mentioned ways, if any, is possible.

You can host the server on any machine that you can create a network connection on… the trick is making it available on the internet.

I would argue that you might be “putting the cart ahead of the horse” to be asking these questions at your currently level of knowledge. I think if you get a little further along in understanding how to write a networked game then the answers might be clearer.

Also, the “server/client” thing is something that is not really in the mind of internet. Internet is intended to be something where everyone can both receive and send messages. You can host a server, even a webserver or any kind of “server” program you want on your machine, and as long as you have a public ip other people will be able to see your server and use its services. That said, things on mobile device are a bit different as they don’t give you an internet access, precisely because they don’t give you a public ip. And it’s a shame, a huge and deep strike in our rights and freedom.

If you can speak french, i advice you to listen some video from Benjamin Bayart, they are very interesting. If you don’t speak french, i’ll give you this little résumé (^^) : internet doesn’t have a center, internet in its very design allow everyone to both send and receive messages, this is the original purpose of it. And by send, i don’t mean “host a content on a well-known website”, i mean : host yourself, on your computer, in a plain folder, a file, and make it visible from other people on the internet.

Our governments fear this, the fact that anyone can publish what they think but you know what ? It’s in the Universal Declaration of Human Rights :

The free communication of ideas and opinions is one of the most precious of the rights of man. Every citizen may, accordingly, speak, write, and print with freedom, but shall be responsible for such abuses of this freedom as shall be defined by law.

Before internet, it was a theoric right, as very few people was able to print what they wanted. Internet make this possible, and i am not the one who said that: the Constitutional Council of France confirms it recently.

Why am i talking about it ? Because recently too, one of our minister said that he wanted to edit the UDHR, and especially the part about the speech freedom. We are losing one of our most important rights, and the only way to fight this is to start to use internet again, like before. Create your server, don’t rely on bigger structures. This is the best way to ensure that the speech freedom will never fade : use it.

@bubuche said: snip

While I totally agree, I think the op’s intention was another one.

The network structure you can do depends on the game type.
Eg a shooter cannot use the same system a round strategy can(or better you can use much efficienter systems when knowing what the target is.

Thank you very much for your answers!

@pspeed: you are right and i will even start from the very beginning of using jmonkey and do the tutorials. Later, when it comes to networked games, I hope that really is clearer, but you have helped me anyway.

@bubuche: That’s an interesting statement and gives me something to think about!
But that really wasn’t the intention of my question. I just wanted to check if it even makes sense to start developing an application, because i wouldn’t be able to run a real server. But as you mentioned i can make any machine be my server, if it has enough ressources and can be seen from other clients via internet. But the fact that mobile phones do not have an IP-Adress as every computer has, might be a problem then.
So as I understood it, when running a networked game on mobile phones, i will need to set up a computer as a server anyway. Just sending and receiving messages(data) wouldn’t be sufficient i guess, even in a simple round based game like “chess” or something similar.

So before starting to develop my game, I should inform myself if setting up a home server on a private computer, connected to the internet can be done by myself… because if i can’t do that because setting up additional firewalls, management of the server, etc. is too complicated, then I shouldnt even start developing my game…

Well, i can’t really give to you strong advices about it, as i didn’t develop yet a successfully game (“Real Game” is still in development).

However, I can give you some advice. For example, I decided to make my game a multiplayer one, but I aim lan parties, or at least games “between friends”. There is a ton of reasons for this.

If you create a multiplayer game for a larger scale, you’ll have to deal with a lot of stuff not directly related to the network, like a registration system and a lot of anti-cheat measures. Then, you’ll need to create a centralized server, and this server will be exposed to attacks. You also need to be sure that your server will never restart, and never crash. You need to ensure that passwords etc. are safe, and you’ll need an encrypted connection (and if I remember it well, there is no such thing in spidermonkey yet).

I come from a time where games like “Unreal Tournament”/Warcraft 3 was common, and people were able to play even without an internet connection, with just cables. Now, if you want to play any game, you need an internet connection, even if the game is not an online game, as the thing you buy in the store is more or less a key to let you download the complete game. Ok, it’s not entirely like that, but we are coming to it (especially with things like steam … I hate it so much). We are really driving to this world where you explore the internet with google, you install games with steam, watch videos with youtube and play online games on battle.net, talking with your friends on skype, accessing internet through one of the 2 or 3 ISP. Sigh …
Anyway, what I wanted to say is that you may consider this scale for your game, if it’s possible (if it makes sense). But first of all you should have a look at the “tchat” example (not sure it’s still working) and, in general, at tchat example with a lot of network libraries. It’s one of the most common examples because it’s also the simplest and the more “appreciable” for its complexity. Yeah, it’s basically “take every messages and echo them to everyone” in its simplest form. Every online game is just more complexity build over this. If you can make something with a client-server thing in it and make it usable on a mobile device, you are good to go for your online game.

…Or not, as you’ll need to learn a lot of annoying things like threading and lag compensation. Also, note that multiplayer games are a lot harder to create than solo games.

Thanks again for your answer!
I was already afraid that it would be pretty difficult and that there are really a LOT of things to care about…
Because of those problems you mentioned, I yet don’t know if it makes sense to start developing a game…
The idea I have is just a round based game, which you should be able to play online against other players (1v1). It does not have to be in real time. The safe, virtual circuit-based TCP/IP-Protocol would be sufficient for that game I think… So that makes things a little bit easier, compared to UDP i guess… The server also does not have to do too much in the game, that I want to develope.
But there are still the problems that you mentioned… anticheating, passwords, crash-safe server, firefall for that server (attacks), registration system.
Well, I will at least take a couple of hours and look into the tutorial and example projects, especially the “tchat”, that you mentioned. Maybe after that I can decide wether it is possible or not to develop a networked game by myself!

In the standard jMonkeyEngine tests there is a TestChatServer and TestChatClient… that shows all of the very basics of networking with SpiderMonkey.

If it is round based, don’t worry, thats about the simplest game type you have.
-> No lag hiding necessary
-> No interpolation
-> No need for highly efficient protocols
-> And no realtime
that 4 is where most of the time ends up usually

For the logic, Seperate your data from the grafic.
-> Server knows each unit where they are ect.
-> Player sends turninfo contianing, wich unit should do wich ect.
-> The server executes that turninfo, checking constraitns (eg a unit cannot walk furhter than its action points allow)
-> Assume everything the clients send you can be manipulated, so if you do all logic on the server you are kinda cheatproof.
-> Make sure the clients only know the data they can have, eg don’t sends unitinformation about units in fog of war. That way they cannot use hacks to retrecive them from the memory. Whats not there cannot be hacked.

About the server I would not care to much for now, some chapy virtual machine somewhere would do. Asd most unixes per default allow no incoming connections (ssh erccluded) you have a quite stable base to start working from.

And don’t worry about making errors, anyone even partly succesfull has mad tons of them
“It seems to be the hardest thing in the world to admit we’ve made a mistake and try to put it right. It requires you to challenge a status quo of your own making.”

okay, that is some good information!
so i guess i’m gonna give that project a try :wink:
the thing about servers is a little bit clearer now, though I don’t know yet how exactly I will do that, but as you mentioned, that shouldnt be the problem to care about for now… I’m gonna do it step by step!

thx again for the nice help in this forum