Tuesday, October 12, 2010
You're Speaking my Language, Baby. Part 4: Objective-C.
Author's note: As this post started out HUGE, it's been split into parts. You'll find the introduction here, my comments on Java here, and my comments on C++ here.
The last language I'm considering is Objective-C. I know this language the least of three. To make matters worse, while Java and C++ share a similar syntax, Objective-C is completely different in places. That being said, it's semantically very similar to Java (more so than C++) and people who know it well speak very highly of it. i.e. it does not appear to be anywhere near as broken as C++. The language itself has some dynamic capability built in, but also has all of the additional dynamic options available to C++ (more on that later) and an excellent Ruby implementation which sits directly on top of the Objective-C runtime (MacRuby).
In general, Objective-C should be faster than Java, but not as fast as C++. It doesn't use a virtual machine, but it does have a minimal run time which is used to implement the more dynamic message passing paradigm it uses in place of standard message calls between objects. It also has optional garbage collection, allowing you to make a choice between stability and performance when you need to (i.e. you can get the code working and worry about the memory allocation later). It's also able to leverage all of the power of both the LLVM back end and the newer Clang front end, which C++ currently can't.
While there aren't a lot of directly relevant tools available for Objective-C itself, it is able to directly use any code or library written in either C or C++. No problems there, then.
It's the last metric which is the kick in the teeth fot Objective-C, though. In short: no one really uses it unless they're programming for an Apple platform. As a result, unless you're programming specifically for either OSX or iOS you'll loose out on a lot of frameworks. Objective-C is a first class language in the Gnu Compiler Collection (GCC), so it can be deployed easily enough under Linux (minus a lot of the good frameworks). This is not the case under windows, however, where there doesn't seem to be any good deployment options. I have no problem ignoring Windows, but directly precluding it would appear to be somewhat foolhardy when building a piece of technology related to computer games. It wouldn't be too much of a problem if I was only doing this as an academic exercise, but I actually have delusions of people using it.
That's the last of the languages I'm considering. Look for my conclusion (and possibly a bit of a twist) tomorrow (here).
The last language I'm considering is Objective-C. I know this language the least of three. To make matters worse, while Java and C++ share a similar syntax, Objective-C is completely different in places. That being said, it's semantically very similar to Java (more so than C++) and people who know it well speak very highly of it. i.e. it does not appear to be anywhere near as broken as C++. The language itself has some dynamic capability built in, but also has all of the additional dynamic options available to C++ (more on that later) and an excellent Ruby implementation which sits directly on top of the Objective-C runtime (MacRuby).
In general, Objective-C should be faster than Java, but not as fast as C++. It doesn't use a virtual machine, but it does have a minimal run time which is used to implement the more dynamic message passing paradigm it uses in place of standard message calls between objects. It also has optional garbage collection, allowing you to make a choice between stability and performance when you need to (i.e. you can get the code working and worry about the memory allocation later). It's also able to leverage all of the power of both the LLVM back end and the newer Clang front end, which C++ currently can't.
While there aren't a lot of directly relevant tools available for Objective-C itself, it is able to directly use any code or library written in either C or C++. No problems there, then.
It's the last metric which is the kick in the teeth fot Objective-C, though. In short: no one really uses it unless they're programming for an Apple platform. As a result, unless you're programming specifically for either OSX or iOS you'll loose out on a lot of frameworks. Objective-C is a first class language in the Gnu Compiler Collection (GCC), so it can be deployed easily enough under Linux (minus a lot of the good frameworks). This is not the case under windows, however, where there doesn't seem to be any good deployment options. I have no problem ignoring Windows, but directly precluding it would appear to be somewhat foolhardy when building a piece of technology related to computer games. It wouldn't be too much of a problem if I was only doing this as an academic exercise, but I actually have delusions of people using it.
That's the last of the languages I'm considering. Look for my conclusion (and possibly a bit of a twist) tomorrow (here).
Monday, October 11, 2010
You're Speaking my Language, Baby. Part 3: C++.
Author's note: As this post started out HUGE, it's been split into parts. You'll find the introduction here, and my comments on Java here.
The second language I'm considering is C++. This is the language that I use the most at my day job. It's also the language that's used to build the vast majority of computer games and one hell of a lot of commercial software. I'm not as familiar with it as I am with Java, but I know it well enough to be productive with it. I'm also familiar enough with it to know how horribly broken it is in many respects. One of the major design goals of Java (among other more modern programming languages) was to fix the problems with C++. It also has no dynamic capabilities what-so-ever, but it's possible to paper over this by using a minimal dynamic runtime such as Lua for scripting.
All things being equal, C++ is the fastest of the three languages. It is also the one you're most likely to write bad code in, though, so there's a bit of a trade off here.
As I mentioned, most games are programmed using C++. As a result, there is a veritable shit load of graphics engine options. I would probably tend towards using the open sourceOgre3D rendering engine (or something similar), but it's worth baring in mind that I could easily switch to using, say, the Quake 3 engine (open sourced by id) if I wanted to. I could also port the project to using a commercial graphics engine if I had the desire to do such a thing.
The measure of applicability to other parties is definitely a point in favour of C++. Code written in C++ would be the easiest of the three for deployment as part of a larger project, as that project is most likely to be written in C++. In terms of acting as a developer showcase C++ has the edge as well, as it's the language a lot of companies ask for code samples in.
Looks for my comments on the last language I'm considering tomorrow (here).
Sunday, October 10, 2010
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.
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.
Saturday, October 9, 2010
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:
I considered three languages and I'll tackle them one at a time in future posts, starting here.
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.
Friday, October 8, 2010
WoW oh WoW
Sooner or later, most people go looking for a bit of escapism every once in a while. There's definitely a spectrum of how far people like to escape. Some can't stand anything which steps outside the bounds of the possible, others practically require spaceships and dragons to co-exist with emotionally retarded vampires. Likewise, some people look to books for their diversions, some theatre, radio, television or cinema. Some people play computer games or one sort of another. No one is saying that everyone, or indeed anyone, has make a specific and binding choice, though. You can watch a movie about the emotion and theological struggle of gay monks one evening, read a couple of chapters of a book about an adolescent wizard immediately before bed, and take on the role of a greek god laying waste to, well... everything the next day.
The point of this project (Clockwork Aphid), when you get right down to it, has to do with my own frustrations with a certain kind of computer game. Specifically: the ones I'm going to lump together under the moniker "virtual worlds". There are a lot of them out there, and I can't claim to have tried them all, but I have had a play with a couple of the major ones and that's what I want to talk about today.
Where to start, though? I've gone backwards and forwards about this quite a bit and come to the conclusion that I should probably start at the top. The top in this case being the brute, the sprawling 500 lb gorilla that actually accounts for almost 10% of the revenues of the US gaming industry: World of Warcraft, or WoW, to give it its not exactly modest acronym. What we're talking about here is not just a virtual world, but a massively multi-player online role playing game, or MMORPG. Let's examine the meaning of this working backwards through the words:
Game - this is something you play, for fun.
Role playing - it contains some component of playing a role different to that of your everyday life. All games do this to a greater or lesser extent, but the difference here is that your character's own personality and skills have more relevance to the gameplay than your own.
Online - the game is played over the Internet.
Multi-player - the game is played simultaneously by multiple people.
Massively - the "multiple people" playing the game can number in the thousands.
WoW is set in an essentially Tolkenesque fantasy world populated by humans, dwarfs and elves, acting more or less as you'd expect them to had you read or seen the Lord of the Rings. There are other races: Orcs, trolls, undead, gnomes, undead, who are a little more stylised. There's quite a bit of steam punk and tribal culture in places. That's not the point though. The point, as in any game, is the question "what does the user do?" and the answer in this case is:
The user takes on the role of one of a member of one of these races, with a particular profession and proceeds to battle their way through the world, fighting hostile elements and performing quests in order to gain "experience" and improve their character. They can also join forces with other players to take on quests; in fact this is practically required in some cases.
I've spent a bit of time playing WoW and frankly it can be a lot of fun. The world is HUGE and exploring it can be very enjoyable. There's also a genuine sense of achievement to be gained from "levelling up" your character. Most of the time. Which brings me to the first frustration: the grind. A lot of the time you just find yourself killing monster, after monster, after monster. This is partly because a large number of the quests (which are handed out by non-player characters, or NPCs, with large yellow exclamation points above their heads) sound like this:
"Oh no! <insert description of peril>! Please help us!
Kill <insert number> of <insert name of monster responsible for this peril>"
Or even worse and with a more concrete example:
"Please bring me 10 giant spider legs."
The problem here being that against all conventional logic, you might only get a giant spider leg for every third giant spider you kill. As you may have gathered, they don't call it the grind because it's fun.
The next frustration is that you don't actually affect the world. You do the townsfolk a good turn by depleting the number of bandits besieging the town, but this changes nothing. Other players come along and do the exact same quest time after time after, because the bandits simply reappear a couple of minutes after you take them down. So, when you do the quest to take out the leader of the bandits, you arrive to find that a queue has formed. The first person kills him, the others wait for him to reappear and do the same. It sort of breaks the illusion of the game. More annoying still: you've been waiting patiently for your turn, but some git comes running in and kills him first. Most annoyingly, to my mind is... Well... Let me give you an anecdotal example:
I was playing as a rogue, which is a nice way of saying thief/assassin, and had been given a quest to recover a particular object from a beach. Needless to say, the beach turned out to be crawling with monsters. So I set about luring them away one by one, depleting their numbers so I could get my trophy without getting my ass handed to me (rogues can give it out, but they cannot take it). The problem being, that by the time I get the to point where I can start thinking about claiming the prize, the monsters I killed first have already started to resappear!
Here's the problem: this is not how the game wanted me to go about this task. It wanted me to find a group of other players and storm the beachhead, quickly despatching the monsters and grabbing the prize. I was playing as a damn rouge, though! That is not how an assassin does business! In the end I got lucky. A warrior stormed the beach as I was creeping up, and I snaffled the loot while the monsters were distracted. Amoral? I believe I did point out that I was playing as a rogue.
In a regular, non MMO, RPG, everything you kill stays dead for the most part. In this case the world doesn't have to be persistent (as in unchanging) because you're the only one playing it and it doesn't matter if no one else can do the quests. In an MMO, almost everyone needs to be able to do the quests, so the world generally performs a decent impression of Kirsten Dunst's hair in Interview with a Vampire. It is a workable solution to the problem, but it can make you feel as though you and your actions don't really matter, which isn't ideal given that you're supposed to be a hero.
I'm not the first person to have these sort of complaints, or to contemplate solutions, but that's a story for another day.
The point of this project (Clockwork Aphid), when you get right down to it, has to do with my own frustrations with a certain kind of computer game. Specifically: the ones I'm going to lump together under the moniker "virtual worlds". There are a lot of them out there, and I can't claim to have tried them all, but I have had a play with a couple of the major ones and that's what I want to talk about today.
Where to start, though? I've gone backwards and forwards about this quite a bit and come to the conclusion that I should probably start at the top. The top in this case being the brute, the sprawling 500 lb gorilla that actually accounts for almost 10% of the revenues of the US gaming industry: World of Warcraft, or WoW, to give it its not exactly modest acronym. What we're talking about here is not just a virtual world, but a massively multi-player online role playing game, or MMORPG. Let's examine the meaning of this working backwards through the words:
Game - this is something you play, for fun.
Role playing - it contains some component of playing a role different to that of your everyday life. All games do this to a greater or lesser extent, but the difference here is that your character's own personality and skills have more relevance to the gameplay than your own.
Online - the game is played over the Internet.
Multi-player - the game is played simultaneously by multiple people.
Massively - the "multiple people" playing the game can number in the thousands.
WoW is set in an essentially Tolkenesque fantasy world populated by humans, dwarfs and elves, acting more or less as you'd expect them to had you read or seen the Lord of the Rings. There are other races: Orcs, trolls, undead, gnomes, undead, who are a little more stylised. There's quite a bit of steam punk and tribal culture in places. That's not the point though. The point, as in any game, is the question "what does the user do?" and the answer in this case is:
The user takes on the role of one of a member of one of these races, with a particular profession and proceeds to battle their way through the world, fighting hostile elements and performing quests in order to gain "experience" and improve their character. They can also join forces with other players to take on quests; in fact this is practically required in some cases.
I've spent a bit of time playing WoW and frankly it can be a lot of fun. The world is HUGE and exploring it can be very enjoyable. There's also a genuine sense of achievement to be gained from "levelling up" your character. Most of the time. Which brings me to the first frustration: the grind. A lot of the time you just find yourself killing monster, after monster, after monster. This is partly because a large number of the quests (which are handed out by non-player characters, or NPCs, with large yellow exclamation points above their heads) sound like this:
"Oh no! <insert description of peril>! Please help us!
Kill <insert number> of <insert name of monster responsible for this peril>"
Or even worse and with a more concrete example:
"Please bring me 10 giant spider legs."
The problem here being that against all conventional logic, you might only get a giant spider leg for every third giant spider you kill. As you may have gathered, they don't call it the grind because it's fun.
The next frustration is that you don't actually affect the world. You do the townsfolk a good turn by depleting the number of bandits besieging the town, but this changes nothing. Other players come along and do the exact same quest time after time after, because the bandits simply reappear a couple of minutes after you take them down. So, when you do the quest to take out the leader of the bandits, you arrive to find that a queue has formed. The first person kills him, the others wait for him to reappear and do the same. It sort of breaks the illusion of the game. More annoying still: you've been waiting patiently for your turn, but some git comes running in and kills him first. Most annoyingly, to my mind is... Well... Let me give you an anecdotal example:
I was playing as a rogue, which is a nice way of saying thief/assassin, and had been given a quest to recover a particular object from a beach. Needless to say, the beach turned out to be crawling with monsters. So I set about luring them away one by one, depleting their numbers so I could get my trophy without getting my ass handed to me (rogues can give it out, but they cannot take it). The problem being, that by the time I get the to point where I can start thinking about claiming the prize, the monsters I killed first have already started to resappear!
Here's the problem: this is not how the game wanted me to go about this task. It wanted me to find a group of other players and storm the beachhead, quickly despatching the monsters and grabbing the prize. I was playing as a damn rouge, though! That is not how an assassin does business! In the end I got lucky. A warrior stormed the beach as I was creeping up, and I snaffled the loot while the monsters were distracted. Amoral? I believe I did point out that I was playing as a rogue.
In a regular, non MMO, RPG, everything you kill stays dead for the most part. In this case the world doesn't have to be persistent (as in unchanging) because you're the only one playing it and it doesn't matter if no one else can do the quests. In an MMO, almost everyone needs to be able to do the quests, so the world generally performs a decent impression of Kirsten Dunst's hair in Interview with a Vampire. It is a workable solution to the problem, but it can make you feel as though you and your actions don't really matter, which isn't ideal given that you're supposed to be a hero.
I'm not the first person to have these sort of complaints, or to contemplate solutions, but that's a story for another day.
Thursday, October 7, 2010
What in the Name of all that's Holy is a Clockwork Aphid?
Clockwork Aphid is the name I'm giving to a side project I've had sitting at the back of head for a little while. I'm actually going to try and build it now. What it actually is is quite big and hard to explain, so I'm going to do it gradually, over time. This way I also get to maintain a little bit of mystery. Here's what I will say up front, though:
The actual name "Clockwork Aphid" comes from the name of the group I helped field to the "Dare to be Digital" computer game creation competition several years ago. We didn't get in, but we proposed a game called "Bad Penny" which I still think was a bloody good idea. Some of the elements of that project are contained in this one also, but the name Bad Penny was chosen for a good reason. It was very appropriate for the type of game we were proposing. This project is potentially bigger, though, and I don't want to limit the scope.
As for the Clockwork Aphid name itself? I just plain thought it sounded good then and I still think it sounds good now.
- It's a programming project;
- It's connected to computer games;
- It's also connected to... another form of digital entertainment which is (arguably) related to computer games;
- In the beginning at least, I'm going to make the code I write open source.
The actual name "Clockwork Aphid" comes from the name of the group I helped field to the "Dare to be Digital" computer game creation competition several years ago. We didn't get in, but we proposed a game called "Bad Penny" which I still think was a bloody good idea. Some of the elements of that project are contained in this one also, but the name Bad Penny was chosen for a good reason. It was very appropriate for the type of game we were proposing. This project is potentially bigger, though, and I don't want to limit the scope.
As for the Clockwork Aphid name itself? I just plain thought it sounded good then and I still think it sounds good now.
Subscribe to:
Posts (Atom)