Wednesday, December 06, 2006

Downtime

One of the hazards of hosting games on a server that also doubles as the family computer was demonstrated today when my wife accidentally knocked the chair into the power switch! I was at work, and only noticed when I got home. Oh well. I don't think anyone was affected.

Tuesday, December 05, 2006

A Mention!

In my quest for publicity (to get people to play the game) I have managed to garner a mention for Nuclear Graveyard on the excellent Freegamer blog. Okay, it's only small, but it might snowball?

Wednesday, November 08, 2006

Publicity

I'm now facing the greatest challenge of all game development - getting people to play it. For some reason, people will go out and pay for games in their thousands, but then a game which is just as good yet completely free (not my game, BTW) will remain obscure. Where's the logic in that? Where are the magazines dedicated to free games that people can play straight away?

My current pet project, Nuclear Graveyard, is proving obscure and hidden to the public. I've created the obligatory website, some forums, this blog, and even posted some news items on Sourceforge in the hope of bumbing up its rank. However, on average only one person is connecting per day (even though it's being downloaded about 3 times a day on average(?)). What's a programmer to do? Pay people to play it??

PS - If you do play it, please please email me and let me know - even if it's to tell me why it's the worst game you've ever played (since my last one).

Saturday, October 21, 2006

Latency

What a pain this is! For my FPS, I originally planned to have all control processed on the server to keep things simple: if the user pressed a key on the client, that would get sent to the server, the server would process it and send back a command to the client to say "the unit you control has moved forwards".

In practise, even though the delay was a fraction of a second, it seemed like a lifetime, and movement was incredibly sluggish, as most people who've tried to write an FPS can probably attest to. Instead now, I've had to give the client details of all the map and all the other objects it could collide into, and get it to do the movement processing itself.

Now, when the player presses a key, the client checks for collisions before sending a command back to the server saying "this object has now moved forwards - tell all the other clients please". It works a lot better and movement is now brisk, but it's a lot more complex and involved since I have to do collision detection on the server AND the clients, and make sure they are all in sync.

Tuesday, October 17, 2006

N-Grave Up and Running

Nuclear Graveyard (or N-Grave as I like to call it) has now been up and running for several days, after my project was accepted by SOurceforge (actually, I'd be curious to know if there were any projects they didn't accept. But I digress). I've got two servers up and running and waiting. All I need now are some players! And to get those, I need publicity.

So far, I've created the obligatory web page, and even set up some forums. I guess I just need Google to trawl through it and add it to their directory?

Friday, October 13, 2006

Threads!

Every time I use threads I wish I hadn't! IMHO they exponentially multiply any problems you might have in code and often far outweight their benefit.

My latest bugbear (which I've come across before but not learnt my lesson) is "accidentally" using different threads to read incoming bytes from a scoket. Obviously this is a big mistake as the ordering of bytes is critical, so if you've got two threads reading the bytes, god-knows which thread is going to read which btye.

My first mistake was to create a new form which read some bytes; I temporarily forgot that forms run in their own thread, so my comms broke down until I spotted this.

My next mistake was to forget how quick computers are. Instead of the form using its own thread, the main thread waits until the form disappears and then reads the bytes after that. However, a split second before that my main game loop is started, which also reads incoming bytes. In the 100th of a second between the form being closed and the main thread realising that the form has been closed, my main game loop starts reading in bytes itself and causing chaos.

I know I should have a single sycnhronized method to do this, but there's loads of code to change. Suggestions welcome.

Tuesday, October 10, 2006

Nuclear Graveyard

After playing the excellent game Tremulous, I was inspired to fork Laser Squad 3D and turn it into something better. I'd been thinking of turning it into a fully on-line game for ages, but I couldn't quite see how to do it. After all, it's not your basic Quake variant; you control whole squads of people.

Anyway, Nuclear Graveyward is the result. If I get asked, I'll post about how I came up with the name (but it's not that interesting). I haven't actually released this game yet as I'm still tweaking it. (The problem with fully on-line games is that you can't afford to have any bugs in there without disillusioning loads of people in one go). If anyone fancies being a playtester or writing some instructions for it, just email me and I'll send you the game.

If you've played Laser Squad 3D you'll know the basics of how the game works. However, now it's fully on-line, it's slightly different. Players can join at any time and select any unit on their side (assuming it's not already being controlled by someone). So that means you can have several people playing against several people; you can have a squad of different human players playing against the computer. Strategy and communication between players is the key.

Sunday, September 10, 2006

Quality Free Games Blog

One problem with free games is that there is so many of them, and the good ones get lost in the quagmire of the dross (I count my games in the latter mainly I'm afraid). People rave about the latest commercial games, and magazines only review games that you have to pay for. I find this really frustrating and annoying. Why do people ignore all the stuff that's free?

What was needed was somewhere where they are reviewed and rated, and I've finally come across it - the Freegamer blog. Now people have got no excuse for not playing quality free games like Tremulous.

My New Game - HoloRacer

I've finally got round to writing a new game. I thought I'd go for something simple that I could hopefully finish before I got bored with it. It's a simple 3D racing game called HoloRacer. It's designed to be as simple and as fast as possible, and it does get pretty fast (assuming you have a good graphics card). It's still in it's mid stages, and is fully playable and good for 5 mins. I'm just trying to think of features'n'things to add to it now. Let me know what you think.

Monday, August 21, 2006

Getting the big picture of source code

The way I see it, you should be able to look at program code, and pretty much work out what's going on straight away. And I mean "the big picture", like how all the files and classes work together, and which classes are used by which other classes. Unfortunately, that never happens, cos there is no standard or good way at the moment to see "the big picture". Maybe UML comes close, but no cigar. Is there a good Java class analyser out there?

When you look at code, you're doing just that - looking at 20-30 lines of one file of a program that could come be comprised over any number of files (including source, data, xml etc..). Who knows where this particular file fits in? Is it the Main file? Or is it the code to some abstract "missile" object that gets shot by the player, and is sub-classed for specific weapons? Until we sort this out, programming is always going to be hard.

Before you can take an open-source project and mould it into your own vision, you need to know the whole project, and that takes too long. Okay, you can fix the odd bug here and there, and change the names, but until you know it from top to bottom, you're only going to introduce bugs.

Programming shouldn't take a lifetime

I have a dream, that one day I will be able to write a game (after having the idea) in less than a day. Nay, in hours! Maybe I'm too impatient, but if I suddently think "yeah, a network RTS this feature x, y AND z would be great", I don't want to waste a week of my life writing it. I want it in a day! And why not? I'm not talking about using the latest "3D Gamemaker Pro" or whatever, I'm talking about having the power to write something quickly, but also get down to the nitty-gritty of the code if need be.

I'm still trying to think how this could be acheived; some kind of "code objects" that can be dropped into a framework. Re-usable classes would be a good idea. I suppose that game objects are too specific to be able to be written generically. You could have a generic "missile" object. Could that be used in an RTS and a 2D shoot'em up? Not without changing the code I fear.

Wednesday, July 19, 2006

Game Idea

I've had this idea for a game for a long time, ever since I read a synopsys of Timelords (IIRC) by Julian Gollop, which is an old game on the Spectrum. Anyway, this idea is a bit vague, so bear with me. Actually, thinking about it, it's more of an "aspect" that can be "fitted" to any other game that involves time travel. Basically, the player travels in time, and when the affect something, then just like real-life (presumably) they affect it in the future.

To give you a more concrete example, imagine Command and Conquor with time travel. If your units could go back in time and destroy the research centre, then in the future the enemy wouldn't have all the highly advanced technological weapons to fight you with!

Anyway, I'm still trying to think of a good way to actually implement this idea in a game. I'll let you know when I manage it.

Tuesday, July 04, 2006

Some more thoughts about my Grand Theft Auto MUD

Most of my customers seem to be from America (I'm naively assuming, since they speak english and connect in the middle of the night (I'm in the UK, BTW)). Unless they are nocturnal brits? It does mean that I rarely get the chance to interact with them though.

I'm still struggling to come up with more good ideas for the game (that are easy to implement if I'm being honest). Quite a lot of people walk around and think "is that it"? I think that's partly their fault for not actually talking to anyone, which is the main way to find missions.

People always want to kill kill kill! I'd probably perfer this mud if it was more of an adventure, but I suppose it's understandable given it's based on Grand Theft Auto. However, people join the game, type in 'KILL [the name of the NPC they first meet]' and then usually succeed, but then get killed by the cops. There's far more to it than just fighting!

Tuesday, June 13, 2006

The Browser as the Platform

I just read something on Slashdot today that got me thinking...

If you wonder why you're not using Netscape and maybe not using Java, and why you've probably got Windows underneath your Mozilla, it's because it became obvious to lots of people that Netscape+Java was a sufficiently powerful and easily ported environment that the operating system underneath could become nearly irrelevant - so Microsoft had to go build a non-standards-compliant browser and wonky Java implementation and start working on .NET to kill off the threat. It wasn't that conquering the market for free browsers was a big moneymaker - it was self-defense to make sure that free browsers didn't conquer the OS market, allowing Windows+Intel to be replaced by Linux/BSD/QNX/MacOS/OS9/SunOS/etc.

It almost makes me angry, not only to think of all the man-hours that are wasted trying to get web pages to work correctly on all the browsers (due to IE's complete disregard for standards) but also what could have been. Imagine being able to write a program that worked on *any* computer (PC, Linux, Mac), and didn't have to be installed - just load and go! That's what we could have had, but Microsoft soon put a stop to it.

Thursday, June 08, 2006

MUD Reviews

No, no-one's reviewed my MUD* yet on any of the mud sites, but looking at the other reviews, I can't see the point....

Call me cynical, but I would hazard a guess that 99% of player reviews are by the owners, and it is just an exercise to try and get more players. Some of their praise is so over-the-top that if they were genuinely a player, you would think the mud was giving away free cash or something. Here's an example to prove my point. And another! I spotted one a while back, and the email address of the "reviewer" was of the same name as the mud he was reviewing - talk about a giveaway!

*GTA-MUD, my mud based on Grand Theft Auto.

Tuesday, May 23, 2006

Someone Completed my First Mission

...only a day after I created it! Basically, they had to kill a mafia don and take his corpse to the police station as proof to collect the reward (they're very open-minded ;-) ). He is flanked by two bodyguards with Uzi's, so it should have been pretty hard.

Unfortunately, one of the cops had wandered into the Mafia house as well, and decided to also shoot the mafia don as soon as he retaliated to the bullets coming from the player. So basically the player had a free "henchman" helping him out, which made the job considerably easier. Still, I'm very proud that they even discovered the mission and knew how to complete it.

[This posting refers to GTA-MUD, my mud based on Grand TheftAuto.

Mud Update

This MUD game is brilliant fun. I don't mean in a "my programming's brilliant", or my game design, but I just really enjoy doing it. I normally get about 3/4 people connected every day, and if I'm in front of my server at the timke, I log on and pretend to be a very-intelligent NPC, to make the game worthwhile.

The thing that is so great, IMHO, is that I can actually see and appreciate people using my game. I've got a few projects on Sourceforge (I may have mentioned them before ;-) ) and they get a lot of downloads, but I get absolutely no feedback what-so-ever. I discovered only a few weeks back that I get the most out of programming when I know other people are using it.

Anyway, things are trundling along nicely. I'm slowly increasing the number of locations and items (though I want to keep the number of locations small so that players can meet each other easily). I'm really concentrating on making the game world as realistic as possible.

Monday, May 15, 2006

Several People Connected!

Today was a milestone! I woke up and had a look at my MUD server, and 36 people had connected! Several of them were still playing when I logged on. I had a nice chat with someone who told me that it'd been recommended by one of his mates. I only registered my mud with The Mud Connector and Top Mud Sites yesterday!

It did give me a bit of food for thought though, as it did show some flaws in the system:-

  • Once an NPC has been killed, they stay killed (and there's only about 5 in the game.
  • There's not enough guns.
  • There's not a lot to do apart from fighting.

I'm quickly rectifying these problems now.

[This post refers to GTA-MUD, my mud based on Grand Theft Auto.]

Saturday, May 13, 2006

Someone Connected!

My first forray into hosting an on-line game has officially happened, and it, er, didn't go too well. Due to a small bug in my MUD server, it got stuck in a loop waiting for something to be received, even when something had been recieved.

(Basically, it was looping round while the bytesAvailable() function returned zero. Unfortunately, if the user had already typed in their commands, they would sit there waiting for the program to respond. Which it never would.)

Oh well, it's just the start. Needless to say I've corrected the problem and it's all now up and running. Telnet to onlinegameplanner.no-ip.org on port 4000 if you like Grand Theft Auto!

I've spent the remaining time adding content. I think another problem with MUD's is that the content isn't reactive. I want to make everything in this game reactive, from the NPC's reacting to other characters actions, to locations being affected by the time of day. This is no small job, as it means everything must be able to react to everything else. Call the exponential police...

Tuesday, May 09, 2006

MUDdy Waters

Ahem. If you tried my MUD prior to this morning, you probably failed to connect. I had it running on Windows, and it works fine when I conncet locally, but if I try remotely, Windows goes into "freeze for 5 seconds every 10 seconds" mode. Literally. Even the mouse won't move. Even after I've closed the MUD and stopped all Java programs.

However, needless to say it works fine under Linux. Now I just need to spend some time on content. There's only a few locations, and some very unintelligent NPC's. But all that's going to change. I want to make this as realistic as possible. It's going to take some work, but it will be slow but sure work.

Sunday, May 07, 2006

My Programming Adventure Continues...

I've decided on the first version of my multi-player internet game that I'm going to host on my PC (now that I've got a static DNS). I decided on a MUD, since I'd already started writing one based on the GTA universe.

After a bit of polishing up, it now works, though is very limited in location and content. Anyway, if you've got nothing else to do, give it go! It's called GTA-MUD. The GTA stands for "Great Text Adventure", for legal reasons obviously. Let me know what you think!

Saturday, May 06, 2006

Sourceforge Software Map Not Being Updated?

Has anyone else noticed that the Sourceforge software map has not been updated for a while? I've got a couple of projects that their own statistics page says have a rank of <1000, but the software map still shows them in the 9,000's, where they were weeks ago. Their rank on this page hasn't changed for ages.

Sourceforge is free so I can't really complain, but it's a bit frustrating that hardly anyone will be seeing my projects. Although I guess some must, to have got them to their high rankings. Oh well.

If you're not busy, check out Laser Squad 3D and Realtime Chaos.

Tuesday, May 02, 2006

My Programming Adventure

I've decided that I'm on an adventure to try and find the most entertaining and fulfilling form of gaming/programming I can. (What I mean when I combine the two is a form of gaming of which I could program a version myself). Playing against other people is where it's at - I think it's a hundred times more entertaining playing against someone else rather than the computer.

I started off badly, writing multi-player network games when I've only got a single PC (and thus couldn't actually player them properly). The only network I have access to (at work) isn't very condusive to games.

I then wanted to try an MMORPG, but I actually find these boring. I tried Crossfire the other day (a 2D MMORPG). It is pretty good, and lots of time has obviously been spent creating it, but after wandering around for a few minutes I was bored. Unfortunately, my PC is too low-spec to be able to run a 3d MMORPG, but I imagine these would be the same.

The next thing I discoverd was a simple multi-player 2D arcade game across the internet called Search and Dread, and I think this is my calling. It only takes a low-spec PC, it's quick and fun to play, and you can easily play against other players, and actually ineteract with other players straight away. No wandering about chatting to NPC's for the first hour.

So this is what I'm working on next - multi-player arcade games across the internet. I just have to think of a game that's not already been invented!

Friday, April 21, 2006

Lack of Inspiration

I'm lacking inspiration to do some programming. It's something that comes around every once in a while, and I'm sure most hobby programmers get it sometimes, but I can't think of anything I want to write. And even if I did, can I be bothered to spend another hour of my life hunting down another bug?

This gets me round to the question of programming in general. I don't want this to sound like I'm saying I can't hack it, but shouldn't programming be a lot easier? I've been thinking about this on-and-off for a few years with no answer, but maybe we should go about it in a completely different way. The human brain works best with visuals, so why do we write programs using words? How about something like what Tom Cruise uses in Minority Report? This is obviously heading into 4GL territory, but there's so much that can be improved in that area. Computers should be at our command a lot easier than they are. Someone off the street should be able to walk up to a computer and get it to do whatever they want.

Anyway, I digress. The main point of this was about my lack of inspiration. I enjoy writing games, more than I enjoy playing them. So after I've finished a game, I don't really play it, so it feels like it was a waste of time. I stick it on the internet of course, but the lack of response if deafening. (I've often commented to people that there should be more comments from other programmers, on, say, Sourceforge, so at least you know someone else has seen it). I much prefer multi-player games, but that means having a network and someone else who wants to play that particular game, which is easier said than done.

So I don't know what to do next.

Monday, April 03, 2006

Make, Compile, Clean, What???

I do think that some free-software makers like to make life as hard as possible for the end user, and unfortunately Linux software often comes in this category. When you download something specifically for Linux, it's normally just the source (which is fine if that's all you're expecting) but sometimes when you just want to use the software, you have to wade through reams of README text, and follow instructions that involve going to the command line and typing in 'compile' commands that take minutes to run, and often fail if you haven't got the correct version of gcc installed.

The software arena is a crowded place, and software like this isn't doing itself any favours. No wonder Windows is prevalent - despite all it's shortcomings, it's pretty easy to get any downloaded program up-and-running with just a few clicks of the mouse. Linux software isn't going to attract new users by making it complex and hard to install new software. People just don't have the time or inclination. And why should they?

Tuesday, February 28, 2006

Viruses Plague British Businesses

(According to the BBC). Well there's an easy solution - haven't they heard of Linux? What are they waiting for?

Saturday, February 18, 2006

Calculating Line of Sight - Help Needed!

At the moment, Emergent Mercenary uses the following algorythm to work out of one unit can see another (i.e. are there any walls in the way):-

(Note - the map of the game is a simple 40x40 array, and each cell can be a wall or floor. Unit positions are stored as floating point numbers, so they can be anywhere, not just in the centre of a map square)

1) Work out a line from one unit to another
2) Move along the line, and at every interval, check whether the point is part of a wall or a map. If its a wall, the unit cannot see the target.


This does work well in general, but if two units are close together but round the corner from each other, it can sometimes return true when in fact there is a corner in the way. I could try increasing the interval, but this obviously increases the time it takes the algorythm to run. Does anyone know a better method?

Any help much appreciated.

Removing Rogue Startup Programs From Windows

Until the world moves over to Linux, here's how to remove programs that keep starting up when you start Windows. Remove the following registry entries:-

HKCU\Software\Microsoft\Windows\CurrentVersion\Run

Launches a program automatically when a particular user logs in. This key is used when you always want to launch a program when a particular user is using a system.

HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce

Launches a program the next time the user logs in and removes its value entry from the registry. This key is typically used by installation programs.

HKLM\Software\Microsoft\Windows\CurrentVersion\Run

Launches a program automatically at system startup. This key is used when you always want to launch a program on a particular system.

HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce

Launches a program the next time the system starts and removes its value entry from the registry. This key is typically used by installation programs.

HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices

Launches a service (a standard NT service or a background process) automatically at startup. An example of a service is a Web server such as Microsoft Internet Information Server.

HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce

Saturday, January 21, 2006

Keyboard Control in Java on Linux

The more the I think about it, the more I can't see a way to write good keyboard control in Java on Linux. Let me explain:-

Say you are writing a basic shoot'em-up. AFAIK, there are basically two ways to control the players sprite when your interface is the KeyPressed and KeyReleased events: you can either have the actual movement code inside these events, such as:

public void keyPressed(KeyEvent e) {
if (e == Key_UP) {
ship.y_pos++;
}
}

The problem with this way is that the ship will move as fast as the keyboard repeat rate, regardless of the main game loop or anything.

The other way (and the way I'm doing it in my game) is to store which keys are currently pressed (in a boolean array), and then process them in the game loop, such as:-

public void keyPressed(KeyEvent e) {
keys_pressed[e.getKeyCode()] == true;
}

(and set it to false on the KeyRelease as well).

public void gameLoop() {

while (true) {

if (keys_pressed[KEY_UP] == true) {
ship.y_pos++;
}

// Rest of game code here
}
}


The flaw with this, as I mentioned, is that if the player holds down a key, then with so many keypress/release events being fired for the duration it is held down, the key might not be marked as being pressed at the time when the keys are being processed in the main game loop.

Can anyone tell me what I'm missing? Or should I just move to another language?

Saturday, January 07, 2006

A Different Kind of Language

I used to say all programming langauges were the same. "Yeah, what's the difference between C, Java, Pascal and Basic? Some use squiggly brackets, some use begin/end, some use two equals signs, some use ":=". But apart from that they all boil down to pretty much the same thing."

That was until I discovered Lisp. I've only started even looking at it in the last few days, but I've learnt enough to know that all programming languages are not the same. Obviously I'd heard of Lisp; I've been programming for enough years now to have heard of all these strange old languages (Fortan, Algol etc..) that they used in the 60's, but never thought anything of actually using them. However, from what I've read, Lisp's power seems to be a well-kept secret by the Lisp community designed to give them the advantage. Their secret is out now, and as soon as I get my head round Lisp enough to actually write something more than Hello World, you'll be the first to know.

Wednesday, January 04, 2006

Whats the best programming language?

I hope to write more on this sometime, but I think that if you spend more time trying to get the language to work rather than the program you are trying to write with it, you're onto a loser.