Multiplayer games

Is it possible (or easy?) to create a game that can be made mutiplayer? so for example say i have a chess game and i wanted to make it two player but with anyone who uses the app. can codea allow for development of these types of games? player opens the app and sees list of players who are free to play anywhere who are using the app. they click and join the game and play.

Hopefully this logic is possible?

removed

@dave1707 i think what he means is a game where it sets you up with another player playing the game on another device @Wirewolf86 if this is the case then you could use HTTP but it would get pretty messy and you would need to write some server software too.

At the moment it’s not easy to play with someone else over the internet, especially a real time game. A turn based game is possible, but as Ducky says, you need to use a web server to manage the data transfer between the players.

@Ducky Thanks, I didn’t think of multiplayer that way.

I believe @Zoyt is going to be making some tutorials for writing the server-side code for connecting clients and servers.

You’d need a server, too, which you would have to buy.

There are some Obj-C plugins for GameCenter which allows local multiplayer, I believe, but you wouldn’t be able to test it in Codea, only in Xcode.

And, for real multiplayer, across a good distance, not LAN, with a server, it would require pretty good server-side software to handle many requests quickly, the clients would be constantly requesting updates, and there would have to be tons of tweens for smooth interpolation between updates.

It would be much easier if Codea had cough sockets cough.

Thanks for the responses guys… It would be a turn based type game but like you said I think it will require servers, server software and all the rest.

Do you know if any sites providing hosting services for situations as these?

You’ll need to buy your own, I think. I believe sites like godaddy.com sell them. They’re relatively cheap, but monthly. (By cheap I mean <= $10, maybe $2-$4.)

Or you could create your own server with your homecomputer, put a linux system on it, and make your own, but that’s a little more complicated

Also, it might not be a bad idea to look into Node.js, this is replacement for apache, and works with javascript, it doesn’t use requests but sockets to send and recieve data, this would mean, using something as AJAX, but then in real time, AJAX still uses some kind of intervals to look for data

Tho codea isn’t suited for the use of node.js since the only way of making something come out or in from codea is still http requests, so the node.js wouldn’t solve us being stuck to turn based games

If only apple let us use the real power of our ipads :wink:

I think I saw a thread by @Vega on a Google solution. Google hosts the server for you and I believe it is free until a certain number of requests are made but I can’t quite remember. That said, I have done turn based multiplayer locally by setting up a php server on my mac and using http.request, but it isn’t ideal.

EDIT: Here it is!

There are also free servers out there, but the reliability may be suspect

@SkyTheCoder - It’ll be a while until I get there, but yes, I hope to deal with multiplayer games. If I remeber correctly, someone posted an example for a multiplayer game earlier, but I can’t find it.

@Zoyt Will it cover LAN and how to store and edit server files?

@stevon8ter How do you make a server on Linux, and if I get a Raspberry Pi computer with Linux on it will it work?

@SkyTheCoder with your own server, you still will have to pay for a DNS, but you could also use it by calling it’s IP directly, just google for Build your own linux server, I haven’t done it myself yet, but probably will once I get my sister her broken computer xd

@SkyTheCoder - I haven’t decided how far I’m going to go in my tutorials. I’ll probably be moving to Unity and C# soon for the 3D version of my app, but I’ll stick around on the forums, just not as much, so the amount of tutorials might get kind of limited. Anyone with a tutorials blog is welcome to pick them up from where I’ve left off whenever they want.
Thanks!

I think I’ll ditch the two player thing and either go for 1 player vs the ai or two player on same ipad taking it in turns etc

Are there any tutorials on turn based ai?

What do you need tutorials about?

It might be easiest to make a player class that holds all the info about one player, and makes all the decisions about what that player does. Then your draw routine can simply loop through the players each turn.

If you need help I can give you a rough outline.

Hey, I am looking around these fourms for the same answers!

I am just a kid not an adult right now I have been saving money got over $100

And planning to put enough work into my app for it to be like 1$

Since I may get about 40 downloads a day Apple takes %40 of the income so I would maybe get about twelve dollars and that’s enough to support the app server and everything becuase I am hoping for my app to multiplayer just like yours!

Codea’s socket code has proved unreliable, with big lags, so a multi player real time game (eg FPS) would be impractical. Turn based games may be OK, as they aren’t affected so badly by lags.

Maybe someone can get it to work reliably, but nobody has yet.

I had the idea to create a site each time you click a button, and display it, then you would have a real time updated text, that’s already something.