One thing that annoys me a lot are "software exams", where you can become a certified drone of the particular software company, typically Sage or Microsoft. They are a two-pronged attack by the software company on free software, gaining them money (because you have to pay to take their exam) and locks you into their software, since you are more likely to stay with software that you have spent money and time learning.
But they also have ridiculous questions! One of the Sage exams has the question "What is the maximum number of lines you can have on an invoice?" What?? So Sage has decided (either due to their inability to write software that allows as many invoice lines as possible, or their marketing dept. decided that it looked good in a brochure) that you can only have 99 lines on an invoice. And people have to memorise this (and a myriad of other completely pointless facts) in order to pass an exam.
Excuse me if I'm not impressed with anyone who's been stupid enough to take this exam.
The trials and tribulations of an amateur game programmer. Please tell him where he is going wrong.
Wednesday, October 31, 2007
Monday, October 29, 2007
Off Lisp
I don't see why Lisp is so great. I wrote a "random movie star selector", and it came up with Tom Cruise.
Thursday, October 25, 2007
Shadowfire Remake
Shadowfire is a classic Spectrum game from 1985, and I'm always surprised that no-one has remade this, since it seems perfect to me. The original game had some great ideas, plot and gameplay, but was limited by the platform. Some modern graphics would enhance it no end.
So I've taken it upon myself to do the remake, which is located here.

I've given it an RTS-style interface. It's still unfinished; at the moment you can walk around, teleport your team in, and shoot the enemies. It currently uses sprites from the original game, which weren't designed to be used in a top-down game, so if anyone could provide me with new sprites that would be good. I've got the code to rotate them to all 8 directions, so you only need to draw one copy of each!
So I've taken it upon myself to do the remake, which is located here.

I've given it an RTS-style interface. It's still unfinished; at the moment you can walk around, teleport your team in, and shoot the enemies. It currently uses sprites from the original game, which weren't designed to be used in a top-down game, so if anyone could provide me with new sprites that would be good. I've got the code to rotate them to all 8 directions, so you only need to draw one copy of each!
Tuesday, October 23, 2007
Java Threads
Unfortunately, one of the (few :) ) drawbacks of Java applets is that in order to have a consistent game loop, you need to run the main game code in another thread. (I may be wrong here; please let me know if I am). I've blogged before about why threads in any language are a pain as they exponentially complicate a program, not least because variables can change mid-line.
Another problem that I always forget, is that in Java, threads don't access another threads data directly (unless you use the volatile keyword). Forgetting this caused me several hours of frustration and I even wrote my own ArrayList class to try and fix it. Basically, the code in my thread's run() function was accessing the class-level arraylist. But completely failing to affect it! It was calling "arraylist.remove(13)" (say), but after it had run, that object still existed in the list! What was going wrong?!?
Well, I've already said the answer. It was accessing a copy of the arraylist, not the list itself. As soon as I discovered and fixed this, all was well and I could go back to enjoying writing applets again.
Another problem that I always forget, is that in Java, threads don't access another threads data directly (unless you use the volatile keyword). Forgetting this caused me several hours of frustration and I even wrote my own ArrayList class to try and fix it. Basically, the code in my thread's run() function was accessing the class-level arraylist. But completely failing to affect it! It was calling "arraylist.remove(13)" (say), but after it had run, that object still existed in the list! What was going wrong?!?
Well, I've already said the answer. It was accessing a copy of the arraylist, not the list itself. As soon as I discovered and fixed this, all was well and I could go back to enjoying writing applets again.
Wednesday, October 10, 2007
An RTS that I intend to be a 2D version of World in Conflict
I mentioned this a while back, and against my own advice I've come back to it. Actually, I've already written most of the difficult framework stuff of selecting units, moving them around, A* pathfinding stuff etc.., and just have the fun of adding a proper "game" and features (- classic assumption by programmers that the final stuff is fun/easy). The screenshot is below, and the game itself is here (or it will be by this evening).
I've nicked the graphics from Advance Wars, and although I've never played World in Conflict, I always think it's a good idea to try and copy a game, as it gives you (me) inspiration and something to aspire to. And if I do anything differently, then great, it makes my game slightly more original!
I used to do this a lot back in my Spectrum BASIC programming days - I've written versions of Carrier Command and Populous, among other games, in BASIC using UDG's (remember those?). It used to be pretty easy. Looked awful, mind.
I've nicked the graphics from Advance Wars, and although I've never played World in Conflict, I always think it's a good idea to try and copy a game, as it gives you (me) inspiration and something to aspire to. And if I do anything differently, then great, it makes my game slightly more original!I used to do this a lot back in my Spectrum BASIC programming days - I've written versions of Carrier Command and Populous, among other games, in BASIC using UDG's (remember those?). It used to be pretty easy. Looked awful, mind.
Tuesday, October 09, 2007
Games Blamed for Society's Problems (again)
People have really got it in for games today!
* Manhunt 2 has been banned (for the second time). (Notice that despite the headline and parent's insistence, police said there was no evidence his killer was inspired by the first game). The Government has decreed that I can watch films like Saw and Hostel, but I am not allowed to play Manhunt 2.
* A Games violence study is launched. Despite the fact that there are far more violent films, books, comics etc., it seems that games are the favourite target for blaming as the cause of crimes and bad behaviour. Didn't we have crime before games started getting "realistic"?
* Manhunt 2 has been banned (for the second time). (Notice that despite the headline and parent's insistence, police said there was no evidence his killer was inspired by the first game). The Government has decreed that I can watch films like Saw and Hostel, but I am not allowed to play Manhunt 2.
* A Games violence study is launched. Despite the fact that there are far more violent films, books, comics etc., it seems that games are the favourite target for blaming as the cause of crimes and bad behaviour. Didn't we have crime before games started getting "realistic"?
Monday, October 08, 2007
Ignoring my own Advice
After deciding to stop writing overly complex games that take up too much of my time and I end up abandoning before I finish them, I suddenly found myself writing an RTS that I intended to be a 2D version of World in Conflict! Arrg! Note to self: Stop!!To compensate, I decided to write my own version of the highly addictive game Gimme Some Friction. It took me about two hours, and the results are playable here straight away thanks to applet-technology.
Phew! A finished game that's fun! Whatever next? An original game? We'll see...
Thursday, September 27, 2007
Tremulous Hulk
In my effort to single-handidly save Applets from obscurity, I have just finished the first working version of my new RTS applet, called Tremulous Hulk (because I intend it to become like a 2D Tremulous, but have ripped Space Hulk sprites).

It's very basic at the moment, but in true open-source fashion, I have big plans, culminating in something that will take on World of Warcraft for player-base size.

It's very basic at the moment, but in true open-source fashion, I have big plans, culminating in something that will take on World of Warcraft for player-base size.
Tuesday, September 25, 2007
Online Game Scheduler
As an exercise in seeing if I could do it, I decided to write a web server several months ago. HTTP seems pretty straight forward in principle, but programming it can get bogged down if you accidentally send too many CR's and/or LF's. Also, closing connections is a problem, since clients like IE and FF often don't bother.However, it now seems to be working, and I can officially announce what I think is a website with an original idea!
I've called it NewGame, and it's an "online game scheduling service". Basically, users select which online games they play. Then, when one user schedules an online game, all the other users who have selected that game will automatically receive an email telling them to date, time, and server.
I thought of this because a common problem with online games, especially new ones and the less well known ones, is that they are often bare of human players. Online games are brought alive by other players being there at the same time, and hopefully my solution will help this to occur.
As well as that, in order to give the site more content, it also has the latest gaming news headlines courtesy of a randomly selected news site. There are also forums for each game, and in a nod to free games, they are highlighted as such, so players can download and play them straight away. And finally, it's going to be the platform for my latest foray into bringing applets back from the brink of extinction!
Monday, September 24, 2007
Game Instructions Please?
I don't spend all of what little spare time I have on programming. Sometimes I even get to play some games. With this thought in mind, I decided to look through the Ubuntu games repository and see what strategy games were there.I came across Boson, which I'd given a few seconds of my time to before. After installing it (which, thanks to Synaptec, is so easy anyone can do it blindfold) I started the game.
This is where the problems hit, and this is why I only gave it a few seconds last time. Visually, the game is great; I could only dream of one of my games looking this good. But how do you play it? My first (and probably only) port of call was the website.
Unfortunately, on the website:-
- There is no link that give the smallest clue that it might lead to some instructions.
- The link to the FAQ doesn't work.
- There is a wiki, but that looks like it's purely for the development team. Nothing to do with actually playing the game.
- Under "Contact us", there are only links to forums and mailing lists and an IRC channel. Sorry, but I haven't got time for any of those. I either want an answer now (or an emailed reply), or I'm just going to play another game, and there are plenty out there. I was going to email them to tell them that the FAQ link doesn't work.
Applets Update
An addendum to my previous post: there is one drawback to applets, and it is that no-one takes them seriously, even when they are good.
Even the forums of the excellent Freegamer blog lumps them in the category "Proprietary & Web Games" (with the subtitle "Just in case you really have to talk about them... "!?).
Maybe the problem is that there's so many rubbish games out there? Do a simple search, and you'll probably come across a million versions of Sudoku, and applets that were written back in 1995. However, there are plenty of good games out there.
Maybe what the genre needs is something like Freegamer, but dedicated to online games, to sort the wheat from the chaff. Hmmm...
Even the forums of the excellent Freegamer blog lumps them in the category "Proprietary & Web Games" (with the subtitle "Just in case you really have to talk about them... "!?).
Maybe the problem is that there's so many rubbish games out there? Do a simple search, and you'll probably come across a million versions of Sudoku, and applets that were written back in 1995. However, there are plenty of good games out there.
Maybe what the genre needs is something like Freegamer, but dedicated to online games, to sort the wheat from the chaff. Hmmm...
Friday, September 21, 2007
Applets Are Dead! (again)
Every time the subject of applets comes up, people insist they are dead. Why don't people like them? In one of Joel's latest postings, he mentions applets being dead because they are slow (despite the fact that the thrust of his post - that you shouldn't bother to optimise, but rather wait for technology to catch up - contradicts this).
I think people misunderstand applets. They were not designed to provide banner ads or simple flashy icons. We've got Flash for that (which is why I have FlashBlock installed). Applets are designed for full applications and games that are comparable to any shrink-wrapped software. And if you do compare them to "normal" software, they come out favourably.
The beauty of applets is that you don't need to install anything, but you've got a feature-rich application, or in-depth game, sat there straight away ready for use. And applets are far from dead - there are tons of them out there, and for the time being it's going to be my platform of choice.
I think people misunderstand applets. They were not designed to provide banner ads or simple flashy icons. We've got Flash for that (which is why I have FlashBlock installed). Applets are designed for full applications and games that are comparable to any shrink-wrapped software. And if you do compare them to "normal" software, they come out favourably.
The beauty of applets is that you don't need to install anything, but you've got a feature-rich application, or in-depth game, sat there straight away ready for use. And applets are far from dead - there are tons of them out there, and for the time being it's going to be my platform of choice.
Thursday, September 13, 2007
Revelation And/Or Epiphany
I feel like I've had an epiphany. I was at a low, and now I've seen the light.I'd spent an hour or so on one of my games (Passenger) trying to optimise the map so that if there were (say) four mapsquares next to each other, all of the same type, it just drew one big square. For various reasons it was taking far longer than I expected. (This is always bad news - one thing I've found guaranteed to get me annoyed is when a task takes much longer than anticipated. That's why I now always assume everything is going to take ages).
Anyway, I suddenly thought: "Why am I spending my time doing this? Writing open-source games? I'm not actually enjoying it, I don't get paid, and (to be brutally honest with myself) I don't even play my own games myself, and I don't think anyone else does."
Basically I'd just become fed up with fiddling around with games, trying to fix bugs, optimise graphics etc. etc. The best part of writing a game is before you start, when you have a blank canvas in front of you, and an image in your mind of how amazing the game is going to be. Once reality sets it, it all comes crashing down after you've spent several hours (or days, or weeks) of your time. Even if a game is finished, then what? There are a million games out there all vying for attention. Why should players spend any time on mine, when it's obvious to anyone that there are better games out there?
Anyway, after a few days of thinking about it, I have come to a solution - Casual Gaming(tm)! Casual Games are much easier to write, and also it means I can play against my colleagues at work, and gain instance gratification to know that the game has brightened up their lives.
My first casual game was (another) version of Tower Defence (yes, not very original). It only took about 3 hours to write, and being a Java applet, it means it's very accessible. In fact, you can play it here. (You do need to log into the website I'm afraid though, but I may change that).
Programming "casual games" means that I can spend far more time designed and tweaking the games and far less time on boilerplate programming and sorting out bugs. And get back to enjoying writing games.
Thursday, September 06, 2007
Common Game-Programming Mistakes #34 & #35
* When looping through the sprites in your game to check for collisions against each other, you check a sprite for collision against itself, which is why the sprite always collides with something immediately.
* Also, forgetting to implement special code to ensure that two sprites that shouldn't collide, don't. Typically, when a sprite shoots a bullet, the bullet will start on top of the shooting sprite, causing a collision immediately when the bullet is fired.
* Also, forgetting to implement special code to ensure that two sprites that shouldn't collide, don't. Typically, when a sprite shoots a bullet, the bullet will start on top of the shooting sprite, causing a collision immediately when the bullet is fired.
Friday, August 24, 2007
Sun is Java's Worst Enemy
I'm a programmer, and I've been programming professionally for 12 years, 8 of those using Java. But even I find it hard and confusing to download Java! So how's a layman supposed to do it, if all they want to do is play a game that requires Java?
I'm trying to download it to a PC now. Here's the steps I take (bear in mind I'm impersonating a layman here):-
* First I type in "Java" into Google. Oh good, the first result is a link to java.com.
* At java.com, there's a nice big link saying "Free Java Download". I click on it.
* Oh, this page says it's for Firefox/Mozilla. I don't want any kind of browser plugin, I want to be able to run programs on the desktop!
* Oh, there doesn't seem to be any other download link, apart from a small one at the top of the page, and that only takes me to the same "browser plugin" page.
* Let's try java.sun.com. There's a link to Java SE in the "Popular Downloads" list.
* What's with all the JDK's? I just want the runtime? (Though, being a layman, I have no idea what JDK, JRE, or "runtime" mean anyway).
* Aha, I've found a link to "Java Runtime Environment (JRE) 6 Update 2". Update? I haven't even got Java to be able to update it? Does it contain Java and the update? If so, do I still need "Update 1"? Who knows. I'll download it anyway. What hell, I've spent too long already.
* The download page has two links for Windows; one "online" and one "offline". I'll choose the "online" download, as it's only ~400Kb. There seems to be a tickbox to the left of it. Do I tick this? No, I'll just click on the link.
* Oh, I need to accept the licence agreement. Okay, done. Now I click on the link again.
You get the idea. By now of course, the user would have just gone onto something else that doesn't involve Java.
I'm trying to download it to a PC now. Here's the steps I take (bear in mind I'm impersonating a layman here):-
* First I type in "Java" into Google. Oh good, the first result is a link to java.com.
* At java.com, there's a nice big link saying "Free Java Download". I click on it.
* Oh, this page says it's for Firefox/Mozilla. I don't want any kind of browser plugin, I want to be able to run programs on the desktop!
* Oh, there doesn't seem to be any other download link, apart from a small one at the top of the page, and that only takes me to the same "browser plugin" page.
* Let's try java.sun.com. There's a link to Java SE in the "Popular Downloads" list.
* What's with all the JDK's? I just want the runtime? (Though, being a layman, I have no idea what JDK, JRE, or "runtime" mean anyway).
* Aha, I've found a link to "Java Runtime Environment (JRE) 6 Update 2". Update? I haven't even got Java to be able to update it? Does it contain Java and the update? If so, do I still need "Update 1"? Who knows. I'll download it anyway. What hell, I've spent too long already.
* The download page has two links for Windows; one "online" and one "offline". I'll choose the "online" download, as it's only ~400Kb. There seems to be a tickbox to the left of it. Do I tick this? No, I'll just click on the link.
* Oh, I need to accept the licence agreement. Okay, done. Now I click on the link again.
You get the idea. By now of course, the user would have just gone onto something else that doesn't involve Java.
Wednesday, August 15, 2007
Overcoming Lack of Talent
Writing games while having no graphical talent, as I do, is a constant struggle of imagination vs reality. In my head I have ideas for great arcade adventures with whizz-bang graphics. Then I come back down to earth and remmeber that I can't draw a matchstick man without it looking like it has a limp. And it's always been the same even when I used to write stuff on the Spectrum (though in those days people's expectations were lower as the competition wasn't up to much either). Nowadays, when I see some of the amazing free (and amazingly-free) games, my heart sinks as I realise that I'll never be able to produce something just as good.
But with every problem comes and opportunity, and I've thought of a way I can get round my pseudo-disability, and that's to concentrate on the one advantage I do have - not sucking at programming (I think).
To cut a long story short, I'm going to design and animate 3D models using programming, in ways that would (I think) prove hard to do using a 3D modelling package.
And this is my very first attempt after about an hour of prog'ing away:-
Okay, so they look like Space Invaders that have learnt to walk, but it's my first attempt, and should go someway to showing what I want to achieve.
But with every problem comes and opportunity, and I've thought of a way I can get round my pseudo-disability, and that's to concentrate on the one advantage I do have - not sucking at programming (I think).
To cut a long story short, I'm going to design and animate 3D models using programming, in ways that would (I think) prove hard to do using a 3D modelling package.
And this is my very first attempt after about an hour of prog'ing away:-
Okay, so they look like Space Invaders that have learnt to walk, but it's my first attempt, and should go someway to showing what I want to achieve.
Tuesday, August 14, 2007
Monday, August 13, 2007
Gameplay Vids
I finally got round to creating some gameplay vids. Having these is an excellent idea (and I'm probably the last person to latch onto this) as it gives people an idea of how the game works. My first candidate for this is Nuclear Graveyard, as I think it's complexity puts a lot of people off playing it.
Here's a [very small] video from The Assassins mission, just as da boyz are about to burst into the house. It's only 30 secs.
On a slightly less happy note, development was stalled today because I made the mistake of installing Oracle's client software, which in turn installed no less than 3 (count'em!) seperate Java Runtime Environments (?), all of which were version 1.4 or less, and all meaning that most of my Java software suddenly didn't work. It only wasted about an hour of my time in working out the problem and solving it. So thanks a lot, Oracle - not! I spend a lot of my time disliking Microsoft, but it seems to me that most software companies are just as evil, but on a smaller scale.
Here's a [very small] video from The Assassins mission, just as da boyz are about to burst into the house. It's only 30 secs.
On a slightly less happy note, development was stalled today because I made the mistake of installing Oracle's client software, which in turn installed no less than 3 (count'em!) seperate Java Runtime Environments (?), all of which were version 1.4 or less, and all meaning that most of my Java software suddenly didn't work. It only wasted about an hour of my time in working out the problem and solving it. So thanks a lot, Oracle - not! I spend a lot of my time disliking Microsoft, but it seems to me that most software companies are just as evil, but on a smaller scale.
Thursday, August 09, 2007
Note To Self: Playtest!
I have a very short interest span in games, and especially short for my own games. This is my excuse for poor/zero playtesting.I just move onto a project I started a while back called DangerMan ( a platformer with weapons) since I've got bored of my latest project (though I will return to it eventually). And what a pile of bugs I found after only playing for only a few minutes!
Here are a few highlights:-
* If you shoot a rocket, you die straight away as it explodes immediately.
* Even when I got the rocket working, it destroys the scenery, but still draws it, because everything was being drawn twice in two different ways.
* The menu system gets confused with itself and you have to restart the program after a couple of goes.
* There was no mechanism for actually finishing a level (that I could tell).
I pity anyone who downloaded this game! It was completely unplayable, though it was at version 0.13 or something. I have now corrected these bugs and released a new version.
This leads me to my next thought - what's the point of releasing a game until it's finished? I suppose the source code is there for other people to examine/use, but if it's unfinished, why would they want to?
Tuesday, August 07, 2007
Threads - Don't Do It!
Here's a warning to anyone who's thinking of using threads - don't bother. Even if you've used them before, I think it serves well to be reminded (me included) that they should be avoided at all costs. Why? Because they make things exponentially more complicated!
Programming is complicated enough, trying to write a block of code that has zero bugs and defects. But what about if the variables you are using could change in mid-line? Or objects that you thought existed because you checked in the previous line now don't exist in the next line?
My multi-player games use at least two running threads; one is the main game loop, and another is the thread that waits for connections from players. This can cause problems in itself - the main game loop obviously loops through the players collection to send them data (and other stuff), but a player can join the game regardless of what stage the main game loop is at. So problems exist in that the main game loop could send all the players the current (say) ammo levels, but if a player had only just joined, they hadn't even been told that a particular unit exists in order to have a gun to contain the ammo!
Unfortunately, the keyboard input is also a seperate thread (as is the norm with Java), and until I corrected it, I was performing IO operations inside the KeyPressed() method. So the client software code could be halfway through sending the unit's location, when the player decide to press space to shoot, and suddenly a stream of bytes representing the "Shoot" command comes steaming through, completely confusing the server. The synchronised keyword fixed this problem of course.
This is just a few minor examples of threading problems. The irony is, that on the face of it threads seem like a great idea - like lots of little programs all doing their own thing. Unfortunately, it's when they have to interact with each other, which they always have to at some time, that problems start.
Programming is complicated enough, trying to write a block of code that has zero bugs and defects. But what about if the variables you are using could change in mid-line? Or objects that you thought existed because you checked in the previous line now don't exist in the next line?
My multi-player games use at least two running threads; one is the main game loop, and another is the thread that waits for connections from players. This can cause problems in itself - the main game loop obviously loops through the players collection to send them data (and other stuff), but a player can join the game regardless of what stage the main game loop is at. So problems exist in that the main game loop could send all the players the current (say) ammo levels, but if a player had only just joined, they hadn't even been told that a particular unit exists in order to have a gun to contain the ammo!
Unfortunately, the keyboard input is also a seperate thread (as is the norm with Java), and until I corrected it, I was performing IO operations inside the KeyPressed() method. So the client software code could be halfway through sending the unit's location, when the player decide to press space to shoot, and suddenly a stream of bytes representing the "Shoot" command comes steaming through, completely confusing the server. The synchronised keyword fixed this problem of course.
This is just a few minor examples of threading problems. The irony is, that on the face of it threads seem like a great idea - like lots of little programs all doing their own thing. Unfortunately, it's when they have to interact with each other, which they always have to at some time, that problems start.
Subscribe to:
Posts (Atom)
