Skip

CMS game backend?
April 28, 2009 11:08 AM   Subscribe

Can I modify an existing CMS to serve as the backend for a browser game?

I'm not sure if I really want to build a database from scratch. If I could conceivably use a CMS like Drupal or some other recommendation to handle all the data related to the game, I'd rather do that instead.

Basically it's a very simple RPG wrapped around a forum. So there would be two parts: activity in the forums would affect the user in the game, i.e. a certain post count might give the user access to a new avatar or something.

The other part may or may not be part of the CMS already. It would involve actually advancing the user's avatars. If I used a very simple mechanic, i.e. clicking on the character adds a random point to intelligence or strength, is there a function in any existing CMS that could mimic this mechanic? A sort of click-counting function or something? The game would actually be more complicated than that of course, but what I'm basically wondering is if I can use a CMS to generate dynamic pages for avatars and track the "NUMBERS MUST GO UP" part of the game. Or if I'd have to code something separately and tack it on to the CMS.

I have no experience with MySQL or PHP whatsoever, but I do have experience setting up and using some simple CMS's (Movable Type, Wordpress, MediaWiki, currently using TikiWiki for another project) and letting them handle the messy stuff. I don't mind learning MySQL/PHP eventually, but I'd like to do it by getting started looking under the hood and tinkering around with CMS's instead of just diving in and learning straightaway.

So is this feasible? Are there other (hopefully simple) ways to build this data-driven site? Feel free to also tell me that there is no way to do this and that I just have to learn PHP/MySQL already.
posted by twins named Lugubrious and Salubrious to Technology (6 answers total)
 
Yes, but you're going to need to gain some experience with PHP before you can do this well. You might also look into something like mediawiki and the semantic medawiki extensions, one of which is semantic forms.

I've seen a few of these games that work on Drupal or others, and they were able to add features quickly but were very limited when it came down to user interface... it's just not possible to do the UIs that you want. The web-based game market has gotten VERY crowded recently and user experience is one of the few selling points.

There really aren't any other good ways to build data-driven sites quickly without programming knowledge, although you can look at things like Symfony Framework and Zend Framework.
posted by SpecialK at 1:01 PM on April 28, 2009


While there may potentially be a way to bend an existing CMS to do this, you're likely to put so much time into it (particularly since you don't know the underlying language(s)) that you're probably far better off really learning PHP (or Python & Django, Ruby & Rails, etc.) and a database system. That way, you'll be learning reusable skills, rather than just spending a lot of time struggling uphill in the dark. Modifying a CMS is probably a decent way to learn the language, though keep in mind that if it's messy internally you may pick up bad habits from it.

In my opinion, you're probably better off learning either SQLite or Postgresql than MySQL. SQLite is a database engine completely contained in a DLL-file, and is great for small to mid-sized projects; Postgresql is a powerful relational database server which compares very favorably to MySQL. (For historical reasons, MySQL tutorials are frequently very poorly informed about relational databases, leading to basic mistakes that can cause serious data loss and performance problems.) Once you get some experience with one of them, you'll be far better equipped to make an informed choice. My recommendation: start small & simple -- SQLite and this book.

Also, you'll need to know at least a little theory to use a relational database well. For example, they expect your data to be organized in a somewhat idiosyncratic manner (normalizing), so if you just pass them stuff straight from CSV files, they'll seem slow and clumsy. The book linked above gives a good overview of this, and this one goes into detail. (It's a textbook, so the previous edition costs pennies on the dollar.)

I'm a programmer, but not a web programmer. Somebody more familiar with common CMSs may say, "Oh! Check out $cms, that's pretty close actually." If so, just go with that.
posted by silentbicycle at 1:13 PM on April 28, 2009


Thank you for the advice so far!

SpecialK: Do you have any examples of those web games that run on CMS's? I know and play a bunch of web games, but I've found it difficult to find one that talks about their design process or anything that goes on behind the scenes. Even if they don't use a CMS, I'm interested in what they did in their technical design process.

silentbicycle: "While there may potentially be a way to bend an existing CMS to do this, you're likely to put so much time into it (particularly since you don't know the underlying language(s)) that you're probably far better off really learning PHP (or Python & Django, Ruby & Rails, etc.) and a database system. That way, you'll be learning reusable skills, rather than just spending a lot of time struggling uphill in the dark."

I think you're right, it's probably better for me in the long run if I just cut to the chase. Thank you for the recommendations, SQLite looks less imposing. Do you think it'll make it easier to learn the other two? Or are they too different?
posted by twins named Lugubrious and Salubrious at 3:24 PM on April 28, 2009


You have to figure out if the functionality that you're getting from the CMS software is worth the complexity of having to learn how the forum software works and modifying it's behavior so that it works the way you want. This means you not only have to understand the programming language, you also have to understand the CMS software's internals.

Integration is often much harder than doing the original work. If you don't have any programming experience, it's probably best to acquire it- either yourself (through effort) or others (through love or money).

Forums are pretty well-mapped out space, and you can find basic design patterns for them in a multitude of places; I'm not sure that I'd think that grafting a full-blown CMS onto the project would help you much.
posted by jenkinsEar at 3:56 PM on April 28, 2009


jenkinsEar: "Forums are pretty well-mapped out space, and you can find basic design patterns for them in a multitude of places; I'm not sure that I'd think that grafting a full-blown CMS onto the project would help you much."

Right, the reason I thought a CMS might be a good start is because so many of them have some kind of forum function plus other features that I thought I could modify into something useful for the game. But at this point all the answers are pointing towards building something from scratch. So even if I learn by messing around with a CMS, I'll probably have to come up with something original for the game itself.
posted by twins named Lugubrious and Salubrious at 5:03 PM on April 28, 2009


SQLite is simpler than Postgresql or MySQL, yes. It's designed to be a fairly small library that you embed in another program, rather than a standalone database server, and it keeps all of its data in one file. While it has a few big differences from the other two (most notably, it's dynamically typed), they're all based on the relational model and SQL, so the core concepts are the same.

The other areas in which they're significantly different (beyond minor syntactic differences) shouldn't affect you until when/if you need performance tuning. Measure before you worry, though -- RDBMSs are quite efficient, unless your system is starving for memory or you designed your schema in a way that makes it go uphill both ways. One caveat, though: SQLite very briefly locks the database before writing, so if you get to the point where you have dozens of simultaneous users, it's time to consider switching.

FWIW, pretty much any programming language people use for real work will have an SQLite library. It's a surprisingly versatile tool.
posted by silentbicycle at 8:40 AM on April 29, 2009


« Older StainFilter: So, I've seen ple...   |  I'm helping a nonprofit that n... Newer »
This thread is closed to new comments.


Post