Well, I thought I'd write a REAL article (one that wasn't made mainly to promote one of my applications), so here it is. This is an article about connecting your games to a server, or to other games. I will talk about the following objects:
FTP
WebGrab
Supa Supa Download (SSDL)
IMAP
Network
and Shared Data.


I will tell you the best ways to make things like an Auto-Update feature, and compare the good and bad things about each object. If you already know how to do this, or you are not interested in it, don't read this then insult it. If you are interested, and don't know how to do this, read on.


The FTP Object: The FTP object is my personal favorite, and probabally the most powerful one in this article. The FTP object is the only MMF object that can upload files to the web (exept perhaps the IMAP object). It can also download, but I don't reccomend that because WebGrab and SSDL are much faster and easier to use.

To start, insert an FTP object info MMF (duh!). A dialog that looks like this will pop up. Image
Enter the name of your site on the top, exept instead of starting it with HTTP://, start it with FTP://, be sure to include the / at the end of the URL. Then enter your username and password (if you use anonymous access be sure that your site supports it, most don't). If you want to connect to the FTP when the game opens, check open connection at start. If you want to display a pop-up progress bar window every time a file is uploading or downloading, check Show transfer window. I have no clue what that other checkbox does, so just leave it checked.I think that it's pretty self-explanatory, but oh well. When you are done with that, insert an edit box.

For this next part you will need an FTP client (A program that can add, edit and delete files from your site) and a web site (you can buy subdomains for free from a lot of sites). When you've got all of that, upload a text file (anything will do) and call it something simple, like txt.txt or something like that. Copy the file name from the FTP client, you may have to click rename to do this. Go back to MMF and add a Start of Frame condition. Add an upload event to the FTP object by clicking the box thingy, then going to the File menu and clicking upload. A file selector will pop-up, you can select a file, or write an expression (eg. Appdrive$ + Appdir$ + txt.txt), this will tell it where to download the file to. When you click OK another box will pop up, paste the name of the text file in that box. When you have finished with that, add the condition transfer is in progress (under FTP/File), then negate it. Get the edit box to load the file on your computer that was just downloaded (Edit Box/File/Load File). If you see your text in the Edit box, you have succesfully used the FTP object; if you don't check the address of your text file, the FTP settings, and make sure that the edit object is loading the same file that the FTP object has downloaded. If all of that doesn't work, track me down and i'll find the problem and fix this article.

So, now that you know HOW to use the FTP object, you should learn what it's good at, and what it's not. The FTP object is much slower than WebGrab or Supa Supa Download, but it is the only object that can upload files. FTP can do things like update high score lists; or get, create, and change user accounts in games that have them. Think of the possibilities, you could have cool (but slow) chat programs, you could send files across the globe, you could even have an incredibally slow MMO game, although I don't reccomend FTP for things like that. FTP is powerful, yet dangerous if you have to many bugs, a big enough bug could delete all of the files that that program is using, and make it so that nobody else could use the program until you manually fixed it. Klik Basestation relies heavily on FTP, and many things have become messed up, many people cannot log-on and that is causing huge problems that I cannot seem to fix. So, in conclusion, FTP is powerful, yet slow.


The WebGrab and SSDL Objects: Ok, firsh let's just make sure that everybody knows what these objects are. Webgrab was posted on the ClickTeam forums on 10/16/05, it wasn't put on the extensions list for some reason. You can get it at http://www.clickteam.com/mbfiles2/282383-WebGrab.zip or you can view more about it at http://www.clickteam.com/CTforum/showthreaded.php3?Cat=&Board=upload&Number=282383&page=&view=&sb=&o= . SSDL (Supa Supa Download) was made by Josh Whelchel and IS on the extensions list, I have found it to be much less reliable that WebGrab, but it does the same thing. You can get it at http://www.clickteam.info/extensions/extview.php?id=175 .

Both objects have only one purpose, downloading files. They both can download any files that IE can, because they both use the IE Downloading API. They download files from HTTP, not FTP. HTTP is a lot faster. They are very very easy to use.

In SSDL: SSDL has more features than WebGrab, but is a little harder to use. Add the Download File action to the SSDL object. Enter the URL of the file to be downloaded (be sure to include http:// at the beginning). Then enter the file that you want to have it downloaded to (unfortunately there is no file selector, you have to type the file by hand). Ignore the banks, I don't really know what they are supposed to do, but they don't matter.

In WebGrab: I reccomend WebGrab because of it's ease of use, and it's speed. All you have to do is click begin download, type the URL (once again, be sure to include http:// at the beginning), then you can either select a file to download to, or type in the address (along with functions like Appdrive$). It has almost all of the features of SSDL, plus 1 that it doesn't have (cancel download).

WebGrab is the easiest to use, and i'm pretty sure it's faster than SSDL. SSDL has also been very flaky for me. Both are designed to download files, neither can upload them. WebGrab and SSDL are good for viewing files that your game will not change, like if you just want to view high-scores, or if you want to your game look for updates. They can be used with FTP; WebGrab or SSDL does the downloading, FTP does the uploading. I probabally should have used them in Klik Basestation to speed up the update checking, but I didn't. In conclusion, these are fast, easy, and usefull, but not very powerful.


The IMAP Object: Many of you have probabally heard of the IMAP object. It's an easy way (and the only way)of sending emails from MMF Standard (look, some people just don't have 300$, even for something important like MMF). IMAP has it's downsides, the biggest of which being the fact that it sends mail through the client, so if you have an online client (like GMail ) it doesn't work. Another problem is that most offline clients (like Thunderbird) show you the message that is being sent, which is pretty unprofesional. But, for MMF Standard users, and people who don't want to try and figure out how to send email with the EMail object, IMAP is the only way to go. You can get IMAP at http://www.clickteam.info/extensions/extview.php?id=290 .

The IMAP object is very simple to use. Add the Send E-Mail acton. In the first box that pops up, type the e-mail address that you wish to send the email to. In the second pop-up box, type the subject. In the third, type the message, and I can't figure out what the fourth does, so just leave it be.

The IMAP object definetly isn't profesional, but it get's the job done on most computers. It can send e-mails, but it cannot recieve them. You could make your own email system with FTP if you wanted a profesional result without toying around with the E-mail object or MooSock (which I have heard can send emails if you know what you're doing). In conclusion, the IMAP object is a simple, yet unprofesional way to send emails.


The Network and Shared Data Objects: The Network and Shared Data object are 2 ways to connect a game directly to another game. If you wanted to make an MMO game, you should use MOO or DirectPlay; there are already articles on both of those, so i'll leave those alone. Just in case you don't know the difference, the network object sends messages between computers on a Local Area Network (LAN). The shared data object allows games on the SAME computer to talk to eachother. Both are relatively hard to use, so let's get to work.

Network: As I just mentioned, the network object can send strings and numbers between computers on a Local Area Network, these are becoming common ,they are usually called Wi-Fi connections. The network object's probabally the hardest to use object in this article. At the start of the frame (or whenever you want) you have to connect it. Add the open channel action; the slot name doesn't really matter, just keep it short and simple; the slot number has to be the same on all computers that want to connect. If you've openned the channel right, you should be able to send and recieve messages. After this it's all pretty easy, you can send strings and values by clicking send strind or send value (it doesn't take a rocket scientist to figure that out). To recieve messages, you can use the Get String or Get Number function. Keep in mind that you will recieve the messages that you send, as well as the messages that other people send, so you may need tokenising (I recomend using the Quick Token object for that). That's pretty much all there is to it. It sounds easy, but it's really a little hard. If this just isn't working, check all of your strings and values; if you can't find the problem, tell me and i'll fix this article (i'm not great with the network object).

Shared Data: The Shared Data object allows 2 MMF games or applications running on the same computer to communicate with eachother. It is easy to use. All you have to do is set the shared string or the shared value. This will change it in both applications. You can retrieve the shared string or value easily using the Get shared value and the get shared string functions. Unfortunately, shared data it pretty flaky, but it's really not too bad.

Network and Shared Data are great things to use if you want 2 games to talk to eachother, but you cannot use them to make MMO games or anything like that. If you wanted to make a network game, the network object is the best way to go. By the way, how many people here have a Local Area Network? In conclusion, The Network and Shared Data objects are an easy way to create simple games that talk directly to other games.


Wrapping it up: Wow, i'm almost done with my first real article, but I have a few more things to add. Firstly, TGF users can get the CNC extensions pack that has both the network and shared data objects. I don't think any of the other extensions work with TGF; if you want them, just get MMF. Also, Local Area Networks are great if you have more than one computer in the house, I recomend getting one if you do have multiple computers, LAN's are pretty cheap ,under 100$ US i think. Anyway, I hope this article helped you in some way, I love games and applications that connect, and I really hope I see a lot more of them. Please post any problems in the article, comments, or just how much you loved this article below. Thanks for your time.