SpecialsHome > Specials > ColumnsPimp My Rails
walski
on 03/26/2008 11.24 AM
Sex up your MMOG development with Ruby on Rails! We invited Thorben from Team Fetmab to tell us more about this framework and the simplicity of working with it. Over the next couple of weeks he will not only show us how to create a simple RPG from scratch, but also provide some background information on the Rails scene.
Kicking the tires Hey folks and welcome to the "Rails for MMOGs" tutorial. In the next few weeks we'll show you how easy it can be to develop a MMOG with Ruby on Rails, the rising star of the web development community in the past three years. Like many of you, we're coming from a PHP background, but at the end of 2006 we felt like this wasn't the best way to develop web applications and experimented a lot with different approaches. Back in these days Rails was already a well known framework and the first hype was over. So actually we were a little late to the party, but maybe this came in very handy as we were not totally blinded by the hype but got in touch with Rails with some serious concerns. But we kept going, and over time we came to love many of the unfamiliar concepts, that Ruby is offering and today we're very glad, that we didn't went back to PHP after the first shock of how different Ruby and Rails are. Don't get me wrong, I don't think Rails is THE solution to all your trouble, pain and suffering. But it's a very good solution for us and I think, no matter if you continue coding your common language or do the switch to Rails, it's good to know "The Rails Way".
Ok, enough said about us, but just a few words about this tutorial. What we can offer and what we can'tUnfortunately things changed a little bit since we first talked with Galaxy-News about this tutorial. We ran into some serious timing problems, caused by the opportunity I've got at university to catch up a course of lasts semester, which gives me the possibility to transfer to a college in the USA next year. Long things short: I had to learn and write a lot in the last week to achieve this goal and was really lacking time to keep the Trans 'n Porter development going and write up this tutorial. So I've to get this done far quicker, as I would like to have, but I'll try to turn this constraint in the opposite: All over the tutorial I'll explain everything which is necessary to get a MMOG in Rails up and running. From the very start, to the deployment on your server. But whenever I feel like I should go more into detail about features or concepts I'll just give you a reference to some of the excellent Ruby or Rails blogs out there which cover exactly this topic. So if you think it might be interesting just follow those references. This is good for another reason: You can explore the Ruby/Rails blogosphere which is definitely a good idea. It's a great source of explanation and inspiration and most of the references I'll give you are certainly far better explained then I ever could. Alright. The time wasting introduction is over, I just wanted to have this cleared out before we start, but now let's get into the exciting part! InstallingGenerally there are two options to get started with Rails:
Installing Ruby and RubyGems Windows I've never installed Rails on Windows so all this can be considered hearsay ;) To get thing going fast, we use a stack which bundles Ruby, RubyGems and a simple editor with syntax highlighting for Ruby. Yes, this is a stack too, but it's, unlike the Rails stacks mentioned above, a really lightweight one and ships with the things we need, but nothing more. So just download and run the Ruby One-Click Installer. Be sure to have the "Enable RubyGems" and "European Keyboard" check-box checked at the installation. That's it. Read on for the instruction on how to install Rails below. Ubuntu LinuxNearly nothing to do:
sudo apt-get install ruby rubygems Mac OS X Mac OS X Tiger shipped with Ruby already, Leopard now ships even with Rails! But to stay up-to-date we'll install a version of rails manually. So either follow this tutorial which guides you through the long way of compiling all of Ruby and Rails yourself, or if you have installed MacPorts you can install the packages ruby and rb-rubygems and if you think that is too much of an effort as well, just try this one-click Ruby stack for Mac OS X. It ships, like the Windows installer with RubyGems, so you don't need to install that by hand.
Installing Rails First be sure, that you've the newest version of RubyGems. Just open up a terminal and execute gem update --system On any Unix like system like Linux or Mac OS X be sure, that you execute all gem actions as a superuser. Just try this sudo gem update --system on such systems. Now the exciting part: Rails is coming to your computer... YAY! gem install rails At this point you should go cooking or do your daily workout or whatever: it will take a while! But attention, maybe you will need to accept on installing depending software during the installation. Just press y when asked to do so by gem. The first Rails applicationAfter you've managed the installation it's definitively time to kick your first Rails application out of the door. Unlike PHP, Rails is not only a language, it's a framework for your web application. And unlike frameworks in other languages, "framework" for Rails doesn't just mean the power of some libraries which you can use. The first thing of the Rails framework you will be faced to is the Rails Generator. If you would like to test a PHP environment you would just generate a very short test.php, put it somewhere where your web server can interpret it, check this file in the browser and you're done. Rails works differently. Any Rails application starts with the call of the simple command rails. This will create a directory structure and the basic files of a Rails application for you. Let's test it.
Just open up a terminal again, head to some directory where you would like to create your first test application and then type in rails test_application You will see how the rails command creates the application, afterwards. If this is done just change into the newly created test_application directory and now type ruby script/server and wait while WEBrick, a small web server which ships with Rails starts up your newly created application. When it's done, head over to your browser and visit: http://localhost:3000. You should see a Rails welcome screen which is somehow the equivalent to the phpinfo() function of PHP. Congratulations! Your first Rails application is up and running ;) Next episodeIn the next episode I'll show you how easy it is to realize a user authentication system with Rails and we'll start with the first pieces of our tutorial RPG "Solid Sword". I would be glad if you would leave your critics, wishes and suggestions on how to improve this tutorial in the comments. See you next week, Thorben P.S. We thankful acknowledge the logo design by boboroshi.com
Web development with Ruby on Rails:
|
Comments
| |||
| 1 | (1) |
|
Ninja MMORPG |
| 2 | (2) |
|
Khan Wars |
| 3 | (3) |
|
Supremacy 1914 |
| 4 | (4) |
|
Bulfleet |
| 5 | (5) |
|
Mobstar |
| 6 | (6) |
|
Domain of Heroes |
| 7 | (7) |
|
Tycoon Online |
| 8 | (8) |
|
GWars |
| 9 | (10) |
|
Crimson Moon Free... |
| 10 | (9) |
|
Orions Belt |
|
|
Cromm Linked: MMOs vs the World |
|
|
Dreighton Marking a milestone |
|
|
RangerSheck Statistics: What are the real odds? |
|
|
PrivateSniper Created Group |
|
|
Leinad WORLD WARS |





