Thursday, May 27, 2010

multi-player games with my son

My son and I have been educating ourselves on making multi-player games using GameMaker 8. It's a wonderful platform for novices to get their feet wet in the field of video game creation. It's also been a great way to introduce my son to computer programming. I mean, what young boy doesn't get a thrill at the idea of creating their own video games?!

A free version of GameMaker is available from the folks at YoYo.com. Advanced features become available once you register for a small fee. There are tons of people in the wiki, forums, and game submissions, which means tons of support.

If you wish to play some of the submitted games, YoYo has made it very easy using a web browser plugin. For those of us Firefox 3.6.3 users, however, the process of installing that plugin is somewhat more involved, but not difficult at all. This is a great way to get some ideas for your own games.

Getting started with creating multi-player games does require a registered copy of GameMaker. Next, it really helps to have a decent tutorial, especially if you are new to the GameMaker language (GML). A library is used to supply the needed functionality for programming multi-player games, specifically the socket handling. There are still tutorials floating around that use an other library called (I think) mplay. This one is old and tends to be flaky, especially where firewalls are concerned. The preferred library of choice is called '39dll'.

A great tutorial for using 39dll has been put out by Luke Escude. Many thanks, Luke! The code is clean, documented and he does a great job explaining the various parameters and providing diagrams to give a big picture view on the matter.

I was able to have success, modifying the example code to have the client send a message to the server and then from the server to the client. Then I modified the sample chat client and server applications so that one could input the ip address of the server and the port number. I ran these on my LAN between my Windows laptop and my iMac with VMFusion (Windows) with great success.

My next step is to have my son connect up with me from outside our LAN. I configured my router to do this, opening up a port for the purpose and forwarding requests on it to my iMac. To make sure that this was done correctly, I tested the newly opened port through CanYouSeeMe.org. Again, success. Once we have tested successfully across the Internet, then it will be time to actually put a real game together. My son has already created several games; we'll see how difficult it would be to retrofit one of those games in a multi-player environment.

No comments:

Post a Comment