Results matching “veure”

Building a Thin Controller

I haven't updated about Veure in a while and though this post isn't really about Veure, per se, I'll use some code from it to illustrate a "thin controller."

There's a lot of confusion about the thin controller/fat model advice which gets passed around. In fact, I've seen some developers get upset about the idea, claiming that it's the model which should be as thin as possible. I'll explain what's really going on and give some real-world examples, using code from Veure.

Using Role as Partial Classes

For Veure, my text MMORPG, I found myself worrying about the Character class turning into a god object. At over 2,300 lines, 105 methods, and growing, it was getting hard to keep track of everything. I want my code to be clean and easy to follow. As a result, when new behavior arose, I started thinking of other places to put behavior, and wound up with abominations like this:

if ( $missions->has_misssion_for( $character, $npc ) ) {
    ...
}

If you're not familiar with the terminology, NPC stands for "non player character" and, as you might guess, they're implemented via the same class as player characters. So what does the above code do? Does it mean that your character has a mission for an NPC? Does it mean that an NPC has a mission for your character? Does it mean that your missions have a mission for ... wait, what does that even mean? The last one, though, is the natural reading of the above.

All because I was trying to limit the size of the Character class.

But wait, this is an MMORPG. Your character drives everything. Your character moves. Your character goes on missions. Your character has to interact with their inventory. Your character has to do all sorts of things and artificially shoving those things into different classes just to avoid the "god object" makes for unclear code like the above. However, shoving all of that behavior into the Character class means it's getting huge and unreadable.

Until now.

Stop Putting AUTO_INCREMENT IDs in URLs

Recently someone posted about an online job:

Well, that looks interesting, except that what interested me wasn't the job, it was the information the ID tells us about weworkremotely.com/ (though I suspect it's not something they're worried about).

Veure Update: Missions

Just a quick update for those who are following the progress of Veure. Here's the current character stats page.

That's just a hint of some of what's new.

Legal Issues in Game Software Creation

Note: I am not a lawyer and the following should not be considered legal advice. Double-check everything and hire a lawyer.

As I continue to work on Veure, I have the added fun of less time spent working on it while I try to understand the legal problems. If you're going to create and publish your own game, you'll invariably hit legal issues. What's worse, you might discuss them publicly and some bright spark will vaguely remember an online article, dumbed down for mass consumption, regarding a complicated libel lawsuit for the print industry and swear up and down that it applies to you. They won't supply a link.

In fact, software games seem to have some peculiar legal issues all their own, compounded by the fact that they're often indie games created by hyper-intelligent, well-read individuals who either don't think of legal issues or assume they already understand them. On the off chance that they're right about a given issue, there's also one tiny detail they often overlook.

Veure Update

Just in case you're curious, I'm still hacking on Veure, though the last month has kept me busy on a bunch of other things (our daughter just started school, so that's a big one!)

I've been building so much of the infrastructure that you might be surprised to realize that I've only just gotten around to being able to equip weapons and armor:

My last entry gives some hints on how this works.

The other developer has been working on the cockpit view. If you travel from system to system in your own ship, the experience should be different than if you take public shuttles. I haven't actually seen his work yet, so no screenshot on that one.

Update: OK, I have some of the initial screenshots for the cockpit work. They look great, but not sharing until some things are settled.

Creating an MMORPG in Perl

Question: do you want to hear more about my attempts to create an MMORPG in Perl, even if posts are not Perl-related? Also, are you interested in helping me develop its ideas further?

As many of you know, I'm trying to create an MMORPG running on Perl. It's codenamed veure. Though I've written about it a few times here, I've not written much because many of the entries are about game design and not strictly about Perl. As a result, I've tried to avoid spamming this blog. That being said, people constantly say "stop talking about how great Perl is and build great things with it!" So I'm trying to build something great with Perl, but as most experienced programmers know, it's not so much the programming language as the business rules which are important.

And damn, business rules in an MMORPG are hard.

Finding unused variables in your Template stash

Quite often companies who use Catalyst (with Template Toolkit) find that after a while, they're over relying on the use of the stash as a global dumping ground. To deal with that, I wrote a highly experimental module to print out unused template variables.

Procedural Quest Generation in Perl

Yes, it's another post about Veure (whose actual name we might finally have chosen, but that's another story), the MMORPG that I've been writing.

There are 117 stars in a 20 light year radius around Sol. There are 544 space stations and currently there are 3,080 rooms in those stations (and that number is growing). That means there's a lot of area, but how do I fill that area? There's a lot of work still left to be done, but I took a quick stab at implementing a procedural mission generator as described in this paper. Surprisingly, the core of the code only took about an hour to write.

Views in DBIx::Class

Did you know you can write a view in DBIx::Class? The DBIx::Class::ResultSource::View module makes this very easy and it's helped me solve a very thorny problem in Veure: how do I efficiently make sure that email sent from Alpha Centauri to Epsilon Eridani doesn't show up instantly in your inbox?

  1 2 3 4 5  

About Ovid

user-pic Freelance Perl/Testing/Agile consultant and trainer. See http://www.allaroundtheworld.fr/ for our services. If you have a problem with Perl, we will solve it for you. And don't forget to buy my book! http://www.amazon.com/Beginning-Perl-Curtis-Poe/dp/1118013840/