Wednesday, September 26, 2007

Guild system in!

Is a guild system really necessary for a MMORPG? Well, considering the point is to get players to play together, why not make it easier for them to group. I guess this statement is pretty obvious but players will create their own guild system in games without one (like Urban Dead at some time).

Beside, considering the time it took me to code it, that was really worth it. The guild system took me around 6 hours to code. Of course, it's basic but it's enough for what I wanted to start with. Let's take a look at it.

The commands

/guildcreate [guild name] [guild acronym]

Anyone can create a guild. The guild acronym is just to make it easier for the interface.


You'll notice that there's no parameters for this command. The less parameters, the less headaches for me later if players find a way to abuse them. All checks are made in the SQL stored procedure (is the current character a guild leader?) to have the best performance.

/guildjoin [guild name]

The only way to join a guild is by first submitting a request. The character will appear on the members' list as "waiting approbation". Having to send a request prevent spammers roaming around sending invites possibly getting in the way of gameplay.


Again, no parameters here. We check if the character is part of a guild, if he's not the guild leader. Currently, the only way for a guild leader to leave a guild is to delete it. I'll have to have add a /guildtransfer command that will allow to give the leader title to another character but for now it's not important.

/guildadd [character name]

This command will work only if the character applied for membership and if the character using it is the leader of a guild. While I did put a "member status", I haven't implemented different members' roles (like someone that could add members but not delete the guild). That's just some fun stuff I'll keep for once the game is done if there's ever a need for it.

/guildremove [character name]

Works the same way as /guildadd. It just remove a character from a guild.

That's it! Not more complicated than this. Adding the guild chat was actually pretty easy too since I already had all the mechanic for chat. All I added to the web service is a "sendGuildChatMessage" function that pass a different parameter to the same function as "sendChatMessage".

At first, I wanted to use the same function but dynamically add "/g" to messages from the interface when the guild tab is activated but in the end, it was just plain dirty and confusing for nothing.

So the guild system was this week objective. Giving yourself small and realistic objectives helps a lot motivation and to get the feeling that you're actually getting something done. With this, I'll probably be able to allow me a break tomorrow for the first episode of the new season of CSI!