MMF - The Online Side

By Code6226, for Puchisoft.com, Last Update: July 24, 2007

 

Update: MMF2 - The Online Side is now up! If you are using MMF2 rather than MMF1, please go there instead.
MMF1 extensions that you might be missing can be found at http://clickteam.info/extensions/

Introduction

Clickteam's MMF is a tool for making applications using a click based way of programming, which eliminates a large part of the typing hassles. Combined with 3ee's Moo series, MMF is a powerful tool in the online department. As the title implies, that is the focus of this site.

Going Online

One of the wonderful things you can do with programming is make something that talks to other programs over the internet. Multiplayer games are very popular these days. UT2007 anyone? So, which extension should you use for MMF to make online games?

IMIs, and Why to Avoid Them

So you are lazy. Of course, you are a programmer. There aren't any that are not lazy. Heck, you're even using MMF. How lazy can you get? I know, I'm right behind you. However, when it comes to storing things remotely, trust me, IMIs are not your friend.

Here's the scenario. You wanne store stuff on your server. Of course you do. If you are making a chat room with a registration system, stuff needs to be stored on the server. How else is your client gonne be able to login with the same user/pass from any PC in the world?

IMIs are basically INI files. The default MooClick server you get before you add any code has a build in features to let ANYONE store IMI files ANYWHERE on your server's PC. That's why they are IMI files, because if they didn't change the extension to IMI, anyone could mess up your win.ini file. Not cool.

But hey, you are the one coding, right? If you wanne store all your user's user/pass info on your C drive in a file called "myusers.imi", why not be lazy and use this easy feature provided by the MooClick server? Because when I said anyone can read/write to any imi file on your PC, I meant it. If you use this feature, other users of mooclick can easily sniff out where your game places the remote imi file, and then make their own program to read everyone's password - or change it. I hope you get the message.

How should I handle Security?

Ah, I'm glad you asked. I just told you about a problem with the default way MooClick lets you store stuff remotely, it'd be a bit cold to leave you hanging. Below you will find a great example of how to do a login system right, called SecureChat Example2. Login in works, but I didn't do registering. Be sure to hack the files manually for testing.

Also, to crack a joke at an ex-common chat client amongst the click community, I made the Insecure Chat Example. Feel free to take a look at that too. If your code looks like that, change it (at least remove all admin powers) or you might end up live V-Chat... I mean, that other chat program. ;)

Remember that you can't code a server in Moo2, so you can't do much about a secure login system or admin powers.

I do not want Security. I just want to Game!

Oh, of course, of course. I have something for you as well. Let me assume you have MMF1.5 or higher. If you don't, look down.

The first thing you probably want to have in your online game is movement. Real time movement, no less. If you want some sort of point and click movement, you can probably derive it from the following example too. The Follow The Leader(Linear Dead Reckoning) example is for you. It's done by sending the X,Y of yourself to others every so often (figure out optional events for this yourself, depending on your game), and then the other players see you walking to this location. This is achieved by creating another object for each person, which is the "Destination" or "Guide" object. The player simply walks to it, to smooth the movement. Just download it, you'll see.

Remember SmileyHouse. No, not that one. That's the remade version. The old one I'm talking about was made with MMF1.2 and Moo2. Yup, I bought Moo2 to make this game, and I had some big plans for it too. Unfortunately nothing big happened with the game until I completely remade it with MooClick in MMF1.5. The new one has a login system with items, cash, stats, monsters, and dungeons. It's really neat, you see. But the old one I'm talking about just had deathmatch. You had unlimited ammo in everything, and there were a bunch of weapons to just go crazy with. I call it SmileyHouse Pre-Alpha, and it's open-source now.

"I want to make a game in MooClick ", I hear you say. Sure, that previous example was great for anyone using Moo2, but everyone has MooClick these days. Do I have an example of a game that uses MooClick? You bet I do!

Not just any game, but a MMORPG.Check out my MMORPG Example.This includes the client and server, both made in MMF1.5. Functional is: Login, Chat, Walking about, Inventory System, Bank/Storage System, and some of the framework for Trading. It's all a bit buggy, and you'll definately have to read the readme(!), but it's some great fun code to get you started. This includes a lot of the ground work that I tweaked to create the new SmileyHouse.

Maybe you don't have an ungodly great PC with an ungodly amount of bandwith. Perhaps you'd be more interested in having users host their own servers. If you want to figure out how Master Servers (used, for example, in: Unreal Tournament, Battlefield2, Quake3,...) can be done in MMF, try my MasterServer Example. If this is a new term to you: Basically a Master Server is just a central server that keeps a list of servers. People don't actually play on your master server, they just use it to track where game servers can be found. The way I did this example, any raw MOS can be used as a master server! Very simple stuff! ^_^

Oh yeah; If you are ever missing extensions, check out clickteam.info.

 

Outro

Thanks for reading my little guide on MMF and going to it's Online Side. Hence the name, yes? ^_^ I hope you found this useful, and the works.

Check out Puchisoft.com to see some of the wonderful things I'm making. If you have any questions or wanne talk about stuff this guide talks about, feel free to do so at the Puchisoft Forum. Please use the programming section to talk about programming, which this would be! Thanks. :)

 

History

(c) 2007 Puchisoft, Inc.