Home News Forum Social Networking Support Us Advertise

Spanish Lesson 1 ($1.99)

aWake!Gently ($1.99)

The Bird & The Snail - Knock Knock - Deluxe ($4.99)

Match-It Trains ($0.99)

Tangled ($0.99)

iFlatter ($0.99)

The 15 puzzle ($0.99)

Tap Forms Database ($8.99)

Higher or Lower Card Game (Hi Lo) ($0.99)

Red Pixel ($0.99)

Time-Shift Radio ($0.99)

Want your application advertised here? Only $10/week!

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-02-2009, 05:14 PM   #1 (permalink)
Member
 
Join Date: Sep 2008
Posts: 46
Rep Power: 0
jaguard is on a distinguished road
Default Simple way for online multiplayer?

People highly demand online multiplayer for our game, Orions: Legend of Wizards. I personally have no experience in making such things, so I wonder, what's the best simple way? The easier for me is the better. I have no knowledge of web programming, and PHP, perl, java are closed books for me. And I'd prefer not to start learning them.
I need some pretty basic features - a simple interface to enumerate users, keep some stats and transfer packets from one user to another, because they are most likely behind NAT.
What would you recommend?
I have now two vague ideas - getting use of html somehow, or using a CGI script, which can be C++ app (so I won't need to learn perl, but will I need to learn linux?).

PS: Also, this should work on shared hosting, I'm not ready to hire dedicated server for $100-200/month.
jaguard is offline   Reply With Quote
Old 01-02-2009, 05:17 PM   #2 (permalink)
Member
 
Join Date: Nov 2008
Posts: 39
Rep Power: 0
Smittens is on a distinguished road
Default

I'm pretty sure you're going to have to learn something new for this. I've also been wondering the best direction to take with iPhone multiplayer stuff, not on WiFi.
__________________
New App, Touch Ski 3D!

TouchArcade Review:
"I actually found it hard to put the game down in order to write this post (just one more run down the slopes...)" - TouchArcade.com
http://toucharcade.com/2009/04/10/to...on-the-slopes/

Video Preview: http://www.naquatic.com/video/

=====

Naquatic Software

Touch Ski 3D Lite, Free!

Turtle Bounce, Free!

Corners, Free!
Smittens is offline   Reply With Quote
Old 01-02-2009, 07:54 PM   #3 (permalink)
Junior Member
 
Join Date: Oct 2008
Posts: 8
Rep Power: 0
inZania is on a distinguished road
Default

I've done a lot of multiplayer gaming work over the years (worked at EA on MMOs and such). To be honest, even using PHP or the like would be an extremely poor solution. The only "right" solution is to use a direct socket connection - though using a central HTTP server for enumerating the client list wouldn't be horrible. You could ping the server for a client list and then create a P2P connection between the relevant clients, assuming you're talking about a selectively multiplayer game and not a MMO. I haven't looked into the SDK's socket capabilities too much, but I'm guessing you'll have to do a little work to get them to do what you want. Still, socket programming is not rocket science - 300 series CSCI courses teach exactly what you're looking for.
inZania is offline   Reply With Quote
Old 01-02-2009, 08:07 PM   #4 (permalink)
Senior Member
 
Join Date: Nov 2008
Posts: 123
Rep Power: 1
dicklacara is on a distinguished road
Default

I used to do web programming-- ColdFusion, Perl some PHP and ASP, so maybe I can be of help.

All of these are procedural scripting languages opposed to compiled OOP.

I ended up using ColdFusion entirely for the follow reasons:

1) easiest to learn and write (high-level syntax, and automatic runtime services such as db pooling)
2) easiest to maintain
3) easiest to prototype new apps
4) easiest to read & understand (self documenting)-- encourages use of long, meaningful words as opposed to short(er) cryptic abbreviations
5) HTML, SQL, CFML (ColdFusion Markup (programming) Language) can be intermixed within source files
6) Modular coding support
7) Automatically Compiles (when changed) into Java ByteCode for efficient execution.

The compiled code and pre-compiled runtime routines made your apps perform and scale than Interpreted scripting solutions

CF (ColdFusion) apps can be designed with MVC structure and modularized to approximate OOP.

You can Download a free developer version and be developing apps in minutes on OS X, Windows or Linux.

It gas been a while but you could get shared-hosting or co-locating (including various SQLs) from $0 - $nnn per month. Typical shared-hosting costs were in the $19-$99 range.

Most co-hosting servers used Unix or Linux (some OS X) and provided a web interface to manage the site.

You don't need to understand the underlying OS, other than the file system (so you know where to put things).

HTH

Dick
dicklacara is offline   Reply With Quote
Old 01-02-2009, 08:39 PM   #5 (permalink)
Member
 
Join Date: Sep 2008
Posts: 46
Rep Power: 0
jaguard is on a distinguished road
Default

Quote:
Originally Posted by inZania View Post
I've done a lot of multiplayer gaming work over the years (worked at EA on MMOs and such). To be honest, even using PHP or the like would be an extremely poor solution. The only "right" solution is to use a direct socket connection - though using a central
I don't think a direct socket connection is the key. Actually, pocket PC version of my game did have a multiplayer, and it was a socket-based. Theoretically, it could work with anyone in the world, but in fact since most devices doesn't have a real IP adress, it didn't. The only way was to Pair devices into one network and then it worked allright, so it was a local multiplayer which could be global but wasn't. Few people managed to get it working globally, though, since they did have a real IP on their device, but this depends on the IPS and most likely isn't available.

dicklacara
Thank you, I will take a look at ColdFusion. So I just need a coldfusion shared hosting (just quickly googled it, prices look reasonable, like $20/month), and the ColdFusion will take care of the rest?
The ColdFusion isn't quite cheap though. $1300 is not something I gladly throw away..
jaguard is offline   Reply With Quote
Old 01-02-2009, 08:45 PM   #6 (permalink)
Senior Member
 
Join Date: Nov 2008
Posts: 123
Rep Power: 1
dicklacara is on a distinguished road
Default

Just read inZania' post & he brings up a good point about interactivity.

If there is a need for fast, efficient exchange of small packets of information, an HTTP server is prolly a poor choice.

inZania also mentioned that a lot of what is needed, e.g. high scores, client records, etc. are well within the capabilities of an HTTP/SQL setup.

So, you may need to provide at least 2 types of services:

1) interactive game playing (socket level as inZania suggests)
2) admin, record keeping, email, web services, etc. (http/SQL servers)/

CF (ColdFusion) has some socket programming capability (provided by the underlying Java server). I have never used it so nothing to report there.

CF also allows you to compose, execute and get results from the OS;s CLI. Conceivably, you could write, compile and execute a game-playing daemon from within your CF app.

Done properly, the interactive game-playing would be handled by a separate module.

1. Initially, while you are designing/prototyping your app, the game-playing module could be written in CF.

2. you could prolly support some number if interactive players with this (compiled Java ByteCode) module

3. When performance needs dictate, you could migrate this module closer to the iron by recoding it. But the rest of the app remains unchanged.

Might just be the best (cheapest/fastest) way to get you where you want to be!

HTH

Dick
dicklacara is offline   Reply With Quote
Old 01-02-2009, 09:39 PM   #7 (permalink)
Senior Member
 
Join Date: Nov 2008
Posts: 123
Rep Power: 1
dicklacara is on a distinguished road
Default

Quote:
Originally Posted by jaguard View Post
I

dicklacara
Thank you, I will take a look at ColdFusion. So I just need a coldfusion shared hosting (just quickly googled it, prices look reasonable, like $20/month), and the ColdFusion will take care of the rest?
The ColdFusion isn't quite cheap though. $1300 is not something I gladly throw away..
The shared-hosting service buys CF and pays the $1300-- you pay $20/month as a shared-user of CF, SQL, storage, bandwidth...

If you get really high performance requirements then you can grow into a co-located dedicated hosting service. I didn't mention it but CF also has some high-end performance/reliability options including multi-server load balancing and fail-safe. I never used these in production but played around with them on some local machines-- pretty easy to install and manage.

But, the Developer version is free and supports 3-5 (I can't remember) concurrent users. You should be able to do any necessary development and local testing on something like a mini. So you don't need to spend any $ on software or co-hosting to start.

Ooooh, I just had a flashback! AIR, the CF socket capability (event gateway) was there to support messaging-- where small packets of data were quickly/efficiently dispatched throughout the organization (Adobe).

If it is what I think it is, you may be able to use it to let a player interact with multiple other players, each, with a single request/response to the http server (actually the event gateway).

Also, I didn't mention it earlier, but CF also provides some rather elegant ways of caching and maintaining state of the clients-- so you should be able concentrate on what you are trying to accomplish.

Also, there is an excellent CF support forum if you need help

ColdFusion Home

All levels of users, from beginner to expert. They are very helpful!

Tell 'em what you are trying to accomplish-- if it can be done, well, with CF, then someone has prolly done it.

Tell 'em dicklacara sent you-- I used to be quite active on the site

Finally, I would appreciate if you would post your findings here (or PM me).

I have an idea for a future iPhone app that involves multi-user interaction. It's not a game so the performance is not really an issue. Rather, I am interested in how easy it is to implement multiiuser interaction if iPhones via a web site.

TIA

Dick

Last edited by dicklacara; 01-02-2009 at 09:41 PM.
dicklacara is offline   Reply With Quote
Old 01-03-2009, 10:06 AM   #8 (permalink)
Member
 
Join Date: Sep 2008
Posts: 46
Rep Power: 0
jaguard is on a distinguished road
Default

Quote:
Originally Posted by dicklacara View Post
The shared-hosting service buys CF and pays the $1300-- you pay $20/month as a shared-user of CF, SQL, storage, bandwidth...
Oh, I see. That's great! I will definately try it.

Quote:

Tell 'em dicklacara sent you-- I used to be quite active on the site

Finally, I would appreciate if you would post your findings here (or PM me).
Thank you, it was very helpful. I'll post here if I manage to get it working. It's not my top priority mission though, so I have no idea when I find time to get into it. Not soon most likely.
jaguard is offline   Reply With Quote
Old 01-03-2009, 02:54 PM   #9 (permalink)
Senior Member
 
Join Date: Nov 2008
Posts: 123
Rep Power: 1
dicklacara is on a distinguished road
Default

My interest was piqued by the topic of this post.

I am not a gamer so all of this is new to me.

Some findings (in no particular order):

--currently, there only a few multiplayer iPhone games.

--most multiplayer iPhone games are limited to a local WiFi (BonJour) net

--There are only a few multiplayer iPhone games for the Internet

--Neither of the above work particularly well in my limited experience (lost connection & what's going on-- did it die or is is just really slow).

--Multiplayer Role Playing games (adventure games, etc.) likely just synch with all the other players to get their status

--Multiplayer Role Playing Games have a relatively low refresh/interaction requirement, and, likely, can tolerate the overhead (connections, handshaking, message ordering, guaranteed message delivery, retransmission, etc.) of a standard HTTP/TCP connection

--Multiplayer Role Playing Games could be implemented on the server as a specialized form of a chat application.

--There are other types of multiplayer games that usually involve high-speed graphics on the clients (think a multiplayer auto/horse racing game).

--The heavy lifting for these High Speed Graphics multiplayer games is done on the client (the iPhone).

--The High Speed Graphics multiplayer games need information on the status of other users: x/y/z location, direction, speed, etc. as well as other less dynamic info.

--In order to sustain a reasonable frame rate, the High Speed Graphics multiplayer games need more frequent data exchange (synching) with other players (through a server).

-- The overhead of HTTP/TCP is, likely, too great to support more than a few players in a High Speed Graphics multiplayer game.

--Servers for High Speed Graphics multiplayer games are typically specialty programs written in C++ and use UDP protocol rather than HTTP.

--UDP is a connectionless protocol where a message is composed and sent. There is no handshaking (you don't even know if the recipient is there), no message ordering (message 1 arrives before message 2), no guaranteed delivery, error detection, retransmission. We're gaining performance and sacrificing reliability. The theory being: "If we drop some messages, so what?. Another one is coming right behind it. We can finesse the dropped messages in the client app or just experience a momentary lag.

Some conclusions?

-- If the data exchange (synch) rate is low (say 300-500ms) and the app supports say, under 30, active players in, say 15 rooms) you could build the multiplayer server as a specialized Chat Server using HTTP.

-- ColdFusionwould be a good choice for writing the app as it automatically compiles to Java ByteCode (rather than being interpreted as are PHP, ASP).

-- There should be free, open-source chat apps available for most languages-- ColdFusion has some, I assume the others do, as well.

--You may be able to find free, open-source UDP examples to allow you to support more interaction, more players, better frame rates, etc.

-- Bandwidth does not appear to be a limiting factor, rather the overhead of the protocol (HTTP or UDP).

-- Given the above, you should be able to prototype a multiplayer game server on a local machine, with little (or no) expense for software and limited amount of time to write the code (just modify existing, working, examples).

-- For initial production, you could, likely, use a co-hosting service in the $19-$99/mo range.

-- As needs dictate, you could upgraded to [limited-shared] hosting, dedicated, hosting, etc. to support a larger audience.

Anyway, let's see some great multiplayer iPhone games!

HTH

Dick
dicklacara is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


» Advertisements


» Stats
Members: 8,229
Threads: 20,197
Posts: 90,213
Top Poster: RickMaddy (2,121)
Welcome to our newest member, jrsiqueira
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:21 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0