Thread: Mysgardia
View Single Post
  #39  
Old 04-13-2014, 02:41 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 91,961
Kyttias is on a distinguished road
Default

You expressed your interest in a browser MMO and this is something I've been wanting to do for years. It's a step up from just a standard RPG. A lot of people assume 'oh I'll just make an RPG and make it an MMO later' but once you realize the internal organs that game has to have to make it compatible for multiplayer, your whole game engine may need to be reconfigured from square one to work with it. And unless you wrote the engine yourself, you'll be hard pressed as to figure out how to even begin. It's why I don't recommend using a program to do it for you - you really have to pick a language and learn it.

For a browser MMO, you have few options ((and in any instance where you have to host the server yourself, it's worth mentioning that there are (kind of) expensive alternatives to this that charge per connection or monthly, such as Photon, SmartFox, Player.IO (apparently bought out by Yahoo), Red5, etc.)):
  • A Flash game (won't work in the browsers of most handheld devices) that connects to PHP and MySQL and/or through a socket server which you'll have to host yourself (here's hoping your computer can port forward its way out of a paperbag, my ISP has mine locked down so I can't). I quickly gave up at this point because, while I knew plenty about the language Flash was written in (ActionScript), I'd have to learn other components just to handle it.
  • Java. I don't even know where to start with Java, except that if you remember Runescape, that was done with Java. It requires users have the Java plugin installed and up to date and you still need to host the server yourself. And you have to know Java. Most colleges still teach Java. However, it's seen just as much of a decline as Flash for online use: Because it requires the browser to run off a plugin, those on mobile devices are shit outta luck unless you are building a native app to iOS or Android or whatever the device is (which means it won't be in a browser, and won't cross-platform). It's likely the game will manage its data in MySQL (though alternatives exist, including JSON).
  • Javascript: Two options, either by manipulating a page's HTML elements (the DOM) or with HTML5 Canvas (which has gaining support across all devices). There are dozens existing code libraries (both open source and commercial) that can help you create games in Javascript/jQuery (though none specifically meant for MMOs, they can help you handle basic necessary functionality like movement, tiling, stage loading and sprite animations), such as melonJS, Impact, Crafty, Quintus, Jaws, gameQuery, and many more. You have multiple server options:
    • Using PHP to connect to MySQL (or JSON), just like Flash. You don't have to host a server, as it can all be done through your web host (and believe me, a free host will drop you so fast). A lot of Ajax will have to be used as duct tape to keep data in sync. You'll probably need dedicated hosting versus shared hosting, just so you have access to plenty of your web host's server's RAM to handle all the i/o connections.
    • Node.JS uses server-side Javascript and, you guessed it, you get to host the server yourself. Luckily, it's well documented! And it's just Javascript front to back, so it's all the same language, and you won't have to learn to configure multiple things! Data can be stored in a MySQL database or you can use JSON, which is more of a hierarchy tree than MySQL's tabular arrays. (Say hello to open source BrowserQuest!)
    • Firebase. This one is new and I believe it will be a paradigm shift for web development of all types. It stores data in realtime in a hierarchy tree like JSON (and it can also export to JSON). The documentation is there and it's still just Javascript - their very motto is that you shouldn't have to touch serverside code. It's meant for real time, meant for handling i/o connections, and it's handling the server hosting - already making it more efficient than handling PHP via Ajax. For developers, up to 50 visitors can be connecting to the database at the same time, and from there on, each connection will cost around twenty-five cents (which any paid content your game offers should handle the funds for).
  • Unity is worth a shout out - there will definitely be a huge wave of gaming in the future done through Unity, but like Java, it requires a plugin and, on the downside, games won't be accessible on mobile devices. On the plus side? Games done in Unity can be written in JavaScript, C# or Boo and even render in real 3D (and ordinary 2D but that's... definitely not the focus). There are already 3D browser MMOs in development using Unity! It's free to develop in, but it's very new and community documentation may not exist en mass yet. And you still have the same old problem of deciding how you're going to host your server and store your data.

Outside the browser, there are still more options that you can go for to make an MMO, of course, in a plethora of languages with many, many helper engines, libraries, frameworks and programs to help along the way. The key is finding something well documented with an enthusiastic community with lots of open source projects to observe before you dedicate yourself to learning whatever programming language you'll be working with, that way you won't come off disappointed.

I also urge you to learn all that you can via online resources before you spend money on classes. MIT offers courses online for free (which don't count towards college credits, of course, but it provides you with all the video lectures, materials, and coursework), and here is an article that lists their courses for Game Studies. There are many, many helpful websites online to help you learn literally any programming language. It's a lot more fun and a lot less stressful to learn at your own pace (and much less expensive). I super recommend Code Academy.

Because Javascript can be used in both traditional web development (the jQuery framework specifically makes manipulating page elements a breeze for a great interactive user experience) and game development, I definitely think that's worth picking up. (In fact I even recommend starting with jQuery and then backtracking to full Javascript.) Here's jQuery at Code Academy, a 3 hour course. And then Javascript, the full 10 hour course. (You can even learn the basics of Firebase at Code Academy if you fall in love with their teaching method.)

Right now I'm working with Javascript and Firebase. I've got movement, coordinate tracking, and a list of online users. My next step is to render other players at their respective coordinates, and it's actually what I'm doing tonight/this week (never know how long something's gonna take, with distractions).

Last edited by Kyttias; 04-13-2014 at 04:04 PM.
Reply With Quote