Brave New Worlds

If you were writing a taxonomy of stories you might choose books as a good place to start. Flicking your way through the world’s libraries, time and the Dewey Decimal System would eventually bring you to the fantasy genre. There is a lot of fantasy writing out there, and you might choose to subdivide it further. A one potential way of cutting it neatly in twain is like so:

  1. Stories set in our world;
  2. Stories not set in our world.

Simple. Harry Potter, for instance is set in our world. That’s a big part of the appeal. Likewise so are Neverwhere, Kracken (if you like’d Neverwhere, you’ll want to read this), and most of Stephen King’s work. Lord of the Rings is not set in our world. Simple. There are other options, of course. What about the  Chronicles of Narnia, for example (which is set in a world beyond our own)? Or Magic Bites* (which is set in an alternate version of our world)? Clearly we’re looking at some shades of grey here as well, but I’m sticking the with the original idea while it still serves my purpose.

What is my purpose here, though? Why the ramblings on this most nerdy or genres? Well, I’m thinking about procedurally generated landscapes again, you see. Clearly, if you’re generating your landscape procedurally, it’s going to be entirely of this world. Existing fantasy landscapes are a good place to look for ideas, then, particularly because they were designed specifically for the purpose of telling stories in.

The quintessential fantasy landscape is, of course, Tolkien’s Middle Earth, which looks a lot like this:

Middle Earth

That should look vaguely familiar to anyone who’s read the films or seen the books (or words to that effect). There’s a definite feeling of size there. Clearly we’re looking at a chunk of a continent, split into something not unlike countries. It always bothers me on maps like this, though: what about the rest of it?

There are a couple of well known knock offs of Tolkien’s work out there, so why don’t we consider a few of those as well? One which used to be close to my heart in my adolescent years is Games Workshop’s Warhammer:

The Warhammer World

Now, it should be quite obvious that the good chaps at GW are knocking off more than just Tolkien here. The Big G / the anthropic principle (depending on your world view) could probably claim some royalties here, because the shape of some of those continents looks very familiar. Grand Cathay, indeed. Now we appear to be looking at close to an entire planet, though, unwrapped using something not unlike the good old Mercator projection (or possibly something more politically correct). I assume so, anyway. It’s entirely possible that the Warhammer world is flat.

Another world with more than a bit of Tolkien about it it the World of Warcraft:

The World of Warcraft

Blizzard have taken no chances, though. This is a world you can actually go wandering about on, virtually speaking. They’ve made sure there aren’t any inviting edges for you to go wandering off. If this isn’t the entire of the world, it is at least self contained. That doesn’t stop Blizzard causing new continents to pop to surface whenever they need to make new content, of course.

Okay, I’m only going to show one more, then I’ll get to the actual point. This is a big one, though, so take a deep breath:

Westeros

This is also one you might be less familiar with. If you haven’t already, I heartily suggest you take a look at George R R Martin’s “A Song of Fire and Ice” series, which starts with “A Game of Thrones,” which is not coincidentally the name of the TV adaption of the books which starts on HBO quite soon. This is probably the best of the four maps I’ve posted here, thanks to a fairly stupid amount of detail (click on it, I dare you). This detail is evident in the books themselves (which I have to confess are not for the faint of heart) as well. This giant map actually represents only a smallish portion of the world these books are set in. It makes a good illustration though. We have mountain ranges, plains, rivers, cities, castles and so on.

If I’m going to procedurally generate a landscapes to tell stories in, they need to have at least a percentage of this amount of detail. Take “The Neck,” the narrow portion of land around halfway up, for example. The fact that the land perceptively narrows here feeds heavily into the plot at several points in the books. This is a choke point which cuts the continent in half. Likewise, “The Eyrie” (*shudder*) is a fort sitting at the peak of a mountain range. Towns are in places that towns would be placed: bridging point on rivers, sheltered harbors, and so on.

The point is this: my procedurally generated landscapes will need variety, but the right kind of variety. They will need “features.” That’s the first major problem I’m going to need to work on once the basic engine is in place, but first I need to make a decision: should this be done top down, or bottom up? Or some combination of the two?

First, though, I need some terrain simplification and some unit tests. The unit tests I’m actually quite looking forward to doing (oddly), since I’m going to try doing them in Groovy.

PS I wanted to include the world from Brandon Sanderson’s utterly spectacular “Mistborn” series here as well, but I couldn’t find a good map online. These books are truly awesome, though. As well as been part of a series, each actually stands alone and completes it’s own story, unlike the fast majority series in the fantasy genre. Seriously. Read them.

* Confession: I enjoyed this book, even if there is a gramatical error in the first sentence. The very first sentence.

Advertisements

There Can be Only… Several…

As I’ve previously mentioned, this project (Clockwork Aphid) has been bubbling away in the  bearded cauldron that is my head for quite some time. As a result, I have quite a bit I want to say about it. I want to blog about the process of building it because I think it might be a good exercise to go through, and also because I think it might help me work the whole thing out. I’m going to talk more about what it actually is quite soon, partly because I want to start talking about implementation and partly because I’ve been prompted by someone else’s project which I suspect might be quite similar. More about that later.

What to do when something like that happens? I think there are two reactions you can to a situation like that: you can feel threatened; or you can feel vindicated. Clearly the second is the more healthy approach, so I’ll go with that one. This is probably for the best, since there are other parties who seem to be coming at the same problem as I am. I mentioned at the end of my post about World of Warcraft that I wasn’t the only one frustrated by the static nature of its world, nor the only one attempting a solution of sorts. Specifically, I was talking about ArenaNet’s upcoming Guild Wars 2. They’ll probably explain it a little better than me, so I’ll let them:

The video was supposed to be embedded here, but WordPress doesn’t seem to want to let me. You can find it here.

Now… clearly they have more resources than I do, which could potentially make me feel a little bit like I was staring up at a shear rock face. A rock face covered in bees. Happily, though, they’re going about it in a different way, though some of our goals are the same. Guess that means I’ll just have to come up with some pretty creative solutions, huh?

It should be noted that what they’ve essentially done is polarise the world. Parts of it are shared, and these are the parts with the villages you can actually save (or fail to save), while other parts of it are instanced, which means you have your own copy. So if I kill the dragon in one of these parts, it stays dead… but only in my copy of the world. The dragon in your copy is still alive and kicking until you personally cut its head off / stab it up the bum / jam some opal fruits down its throat. They talk more about the shared, dynamic parts of the world in their blog here and here, and the instanced personal stories here. I encourage you to read just about all of that blog, in fact. I found much of it fascinating and quite insightful.

While, I’m talking about Guild Wars 2, though it is worth taking a moment to marvel over just how stunning those visuals are. The comparison I find myself making is that World of Warcraft looks like it was made out of clay:

While Guild Wars 2, on the other hand, looks as though it was made out of china:

Now before you cry foul and point out that GW2 is a much newer game, it’s worth taking into account that this china like quality was also true of the original Guild Wars:

Obviously some of this has to do with the different graphics engines being used, but I think that actual quality of the design is definitely a factor as well. It’s evident in the 2D promotional art, as well.

I’m also quite taken with the difference in the mythology of the two games, but perhaps I’ll talk about that later. Mythology will be quite a relevant subject, later.

You’re Speaking my Language, Baby. Part 2: Java.

Author’s note: As this post started out HUGE, it’s been split into parts. You’ll find the introduction here.

The first language I’m considering is Java. This is by far the language I’m most comfortable and proficient with. It was used for about 90% of my Bachelors degree, I wrote the entire codebase of my PhD using it, and it gets used here and there in my day job. I’m comfortable with Java, and find it to be quite a pleasant language to program in. Big tick on the question regarding my ability to use it, then. Java has some modest dynamic capabilities built in, but it also has a lot of small options for using higher level languages for the scripting, the cleanest of which is possibly Groovy.

Java has a bad reputation performance wise, but this largely isn’t true any more. It does run using a virtual machine, but is compiled to native code at run time. It’s a lot easier to write good code using Java than the other languages I’m considering, and that can help with performance a lot, but in general Java has the potential to be the slowest of the three, all things being equal.

Tools are actually not a problem. There are a lot of high quality graphics engines available for Java, with the Java Monkey Engine (JME) being my favourite. A physics add-on is available in the form of JMEPhysics, with the next version slated to have a physics engine baked in. Raw OpenGL is also an option with LWJGL, should I want it. Likewise, I suspect that the Red Dwarf Server is likely meet my communication needs.

The applicability of Java to other interested parties is an interesting question. A lot of software gets written in Java. A LOT. But the vast majority of it is not games. Largely, I think this is because it’s perceived to be lacking in the performance department. It’s also a little harder to protect you code when you’re writing in Java, too. The previously mentioned JME has the support of a commercial games company, though, so clearly there is interest. Computers are getting faster at quite a rate, so performance has the potential to be less of a concern, especially if the project you’re working on has the whiff of a server side application about it. When it comes to server side code, I think Java is definitely winning the race. Frankly, I have a bit of trouble calling this one either way.

One language down, two to go. Look for the next post tomorrow (here), should you be interested in such things.

You’re Speaking my Language, Baby. Part 1: Introduction.

Author’s note: This post started out HUGE, so I’ve split it up. Look for the other parts over the next couple of days.

If you’re about to start on a programming project of some sort (and I am), then the first choice you have to make is the main programming language you’re going to use. Now, if you’re carrying out this project on your employers time they probably have very specific views about that. I’m not doing this project on company time, though, so the world is my oyster, figuratively speaking. There are, at a rough guess, shit loads of programming languages out there. There’s a reasonably good list to be found here, though it is missing a couple of the weird ones. While constructing the project using a language which uses LOL cat type speech for syntax, or takes its input in the form of abstract art would be an excellent mental challenge, I’m sure, that’s just not what I’m looking for.

I’m also, right off the bat, going to eliminate a couple of other classes of language. First of all: no functional programming languages. I have no patience for learning a new programming paradigm, expecially one which up until now has shown limited application outside academia. No Haskell, no CAML and absolutely no Prolog.

I’m also not considering high level dynamically typed languages, so no Python and no Ruby. For that matter, no Groovy or Lua either. You can program very quickly in them, but I’m not prepared to take the performance hit which comes with them. Python might be very popular, but I think it actively encourages bad programming practice and I want no part of that. It’s an excellent hobbyest language, but that isn’t what I’m looking for.

Lastly: I’m not looking at anything based on Microsoft’s .Net platform, and that includes Mono.

The questions I’m going to be asking of the languages I am considering are the following:

  • How well  can I use it?
  • Generally, speaking, how good is the performance?
  • What tools are available? Specifically, does it have access to the libraries I’ll need to build the project. These are mostly ones relating to 3D graphics, inter-computer (client-server) communication and (possibly) physics. There are probably a couple of other things I haven’t thought of yet.
  • How relevant is it to others? That is, if I write the project in this language will it be useful to other interested parties?

I considered three languages and I’ll tackle them one at a time in future posts, starting here.