Wednesday, October 31, 2007

Software Exams! Grr!!

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.

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.

Screenshot

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.

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.

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"?

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.

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.
It's a pity really. Like I said, it looks like a really good game, but they are shooting themselves in the foot by not telling anyone how to play it.

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...

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.

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.

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.

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.

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.

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.

Thursday, August 02, 2007

Interesting Enemies

I was watching Gamer TV the other day, killing 5 minutes and keeping up with the latest development in non-Free games department, and I saw a video of the new game BioShock. And I wasn't that impressed. It was only a quick video, and I was only glancing it at, but it gave me an insight into what a lot of games (including my own) lack, and that's "anything new". It's probably been said a million times before, but a lot of the games are just Doom with better graphics. I suddenly realised how boring an FPS can be if you're just wandering around shooting the odd enemy that appears. It's stating the obvious, but they need something new to keep the player wanting to play it.

It's with this in mind that I've though of something new! At least, I hope it is, and in the interests of open source and sharing ideas, it's going to a some kind of "fungus" that grows towards the player. It won't be easy to kill (probably impossible in fact) but the player will be able to shoot bits of it away.

Here's my first version of it. It's rudimentary (just using spheres), and I've still yet to perfect my fungus "ai", but it certainly makes an interesting and different enemy.


Tuesday, July 31, 2007

Got it working

After what literally seems like yonks, I've finally worked out the solution to the problem I described several posts back, namely that the perspective was all wrong in my game Passenger - it was drawing stuff further away over the top of stuff that was closer - like this:-



Needless to say, the problem had an easy solution (once you know what it is) - a missing "updateGeometricState()" on the root node when adding an object. Arrggh!!!

Here's what it looks like now:-



A dramatic improvement I'm sure you'll agree. And now I can finally get on with improving the game rather than messing about with small bugs!

Wednesday, July 25, 2007

Warning - Scary Picture!

I've just added some more hardened enemies to Last Remaining, and some more serious firepower. I don't want the game to become just another FPS, as the story is quite important, but it won't do any harm to have a bit of action in the middle of it!

This necessitated enlarging the levels and also adding a new one (now up to 3). I'm just ensuring there are no serious bugs, and then I'll be uploading it to Sourceforge.

Network Communications

Communication between computers is a nightmare, whether it's a web server or a multi-player FPS. How do you know when a client has finished sending you data? Does it disconnect? Does the stream contain an EOF signal? Does the client tell you how many bytes it's going to send?

I've just been trying to write a simple web proxy server, and this is just one of the questions that is proving hard to answer. Some websites (like Google) don't send a content-length (and I don't think it even disconnects once it's finished sending the data). So even if you want to write a simple proxy server that (on the face of it) just passes the bytes between computers, you have to write a piece of software that almost amounts to pretty much a full web server and partial web browser (except without the rendering features).

However, it's more compicated than that because you have to handle the communication two ways for each "connection". So you get the added complication of slow clients (client that connect to a server, and then decide to wait a few milliseconds before actually sending a request). Then there's flushing - when to flush and when to not.

Even though my Proxy now seems to be working for most websites, for some reason it can't read Slashdot (I get a blank response) and Googlemail says it's received a bad request. Gawd knows why.

Tuesday, July 24, 2007

Programming in Java

One of the great things about programming in Java is that it runs straight off in Linux and Windows without even the need to recompile. I've never had any of the problems that I've heard described elsewhere, but maybe I haven't covered the same kind of areas. However, I've written platform games, 3D shooters, desktop applications, database connections, and I think the only time when I've had to include a bit of code that says "if (linux) { do this } else { ... }" etc..., and that was because of slightly difference font sizes, which is fair enough (and probably for patent reasons).

This does sometimes lead you to a false sense of security though. I've been caught out several times by case-sensitivity. A program will work fine on Windows, but then I run it on Linux and it can't find the file "xyz.3ds" because the filename is actually called "Xyz.3ds". Still, a bit of testing should sort that out, and we all do that, don't we?

Friday, July 20, 2007

Ease of Use

One of the major drawbacks of there being so many quality open source games is that it's too easy to dismiss games that don't provide instant and accessible fun.

I'm just as guilty as anyone of this; if I download a game and there's so much as a whiff of having to compile or make anything then it's goodbye from me and onto the next game. Having a young son, I have very little time to play games, so anything that looks like it's going to cost me more time than it should gets discarded.

It's having this in mind that has caused me many a headache in trying to make Nuclear Graveyard instant and accessible. After I'd first completed it up to version 1.0, it had about 12 keys, like "shoot", "wait", "autofire", "guard" etc... A few comments from prospective players had informed me that this had understandably put them off, so I changed it to a menu system.

Unfortunately, I still don't think this has placated them. When you first run the game, it looks like an FPS, so I imagine a lot of players wonder why they can't run around and shoot stuff. (This is because of things like Action Points). I've tried putting big warning signs on the screen saying things like "Out of action points!", and other things to give people an idea of how it works. I just fear that in this day and age, they'll have gone onto another game before they get the idea. Maybe originality doesn't pay!

Thursday, July 19, 2007

Shooting


Now that I've implemented shooting in Last Remaining, getting a good "shooting" feeling in my FPS is proving hard. My first version of shooting was just to move a cylinder away from the player. It generally works, the player can see that they are shooting, and thanks to collision detection, the enemy knows when they have been hit. However, it feels like the player is using a pea-shooter. There's no umph behind it. This may be for several reasons:-

* No sound effect
* No muzzle flash when the bullet comes out
* No sparks where the bullet hits the target
* No camera shake when the player shoots

I think all of these add up to make a good shooting effect, and make the difference between a pop-gun and a BGF9000. I just need to work out the best way to implement them now.

I notice that some shooter don't actually draw the specific bullets. They have all of the above though. Maybe this might be the way to go - it will certainly save on processor time by not having to draw them all.

Tuesday, July 17, 2007

A Mention on Freegamer

I've managed to garner more than my fair share of paragraphs on the excellent Freegamer blog! Thanks Charles. Knowing people are taking an interest in my games, and maybe even gleaning a small amount of fame, is what keeps me programming.


Here's another screenshot from Last Remaining:-



I like the shadows in this one.

Passenger Perspectives

I've started changing the 3D engine I use for Passenger from JOGL to JMonkeyEngine. Unfortunately, I seem to be having trouble with my perspective:-

It seems to be drawing the closest objects first (and even the closest parts of the cloest objects first), which are getting over-drawn by objects that are further away. Still, it all moves at a good speed, and as soon I sort this out it should make the game a lot better. Maybe I could use this new feature for a psychadelic 3D puzzle game?

Monday, July 16, 2007

"Last Remaining" - Now on Sourceforge even more!

Last Remaining has finally been uploaded to Sourceforge - link here. It hasn't made it to the number one position yet, but surely it can be only a matter of time before enough people download this rollercoaster ride of action suspence and adventure! I've added the source code, and another nice screenshot.

Saturday, July 14, 2007

"Last Remaining" - Now on Sourceforge!

..though I haven't had time to actually upload anything yet. It will probably be Monday.

Friday, July 13, 2007

"Last Remaining" Update

I've just mastered two other features of JMonkeyEngine - fog and stars! Actually, after thinking about it, the two are pretty much exclusive, as if there's fog you shouldn't be able to see any stars. However, as my previous post alluded to, realism isn't the name of the game.


Unfortnately, the non-disclosure agreement I have with myself prevents me from telling you what this particular map is, whether it is populated by unfriendly aliens, or where it fits into the story. It may or may not be set in space, and may or may not be some kind of spaceship, and the aliens may or may not want to kill you.

What I can tell you is that I've added some rudimentary sound effects (always good for atmos) and even some fitting music. No word back from Sourceforge yet though...

Wednesday, July 11, 2007

Scenery

IMHO, one things that makes a good 3D game is scenery. Call it blindingly obvious, but any 3D game without scenery might as well be Wolfenstein (or even 3D Monster Maze, and that's sooo 1980's). To this end, I've just added some signs to the map that the player starts on, to make it more homely and, err - I can't think of the word. Realistic? Maybe, but it's set in the future anyway, so realism isn't exactly top of the agenda. More natural? Easier to navigate around? I dunno, I give up.

I've almost done the first "episode" of this game that I've christened Last Remaining, and as soon as Sourceforge get off their *rses and accept my project, the sooner the proles can play it and hopefully give me some feedback. It's far from complete (what comes before alpha?) but has the makings of a could-be-good game.

Monday, July 09, 2007

"Last Remaining" - We have Lift Off!


I've finally had some great ideas for the story for my new game Last Remaining. I won't go into too much details here, as "the story" is going to be this games biggest selling point, and revealing it now would strip anyone of the main reason to play the game. However, basically the player plays the part of a space-wreckage-investigator (I'm sure there is a more succint way of describing that, but there you are).

I had a bit of a quandy as to how best to show the speech by the NPC's - do I show speech bubbles, showing writing along the bottom of the screen, or destroy my whole reputation and have a go at some voice acting? In the end I decided to go for the pseudo-speech bubble option, as it was easiest.

Another minor request for advice - I had amazing trouble trying to get the OrientedBoundingBox to work in JMonkeyEngine. In fact I still can't get it to work, so I decided to use Rays instead to check for LOS. Does the OrientedBoundingBox actually work in JME?

Anyway, now I've got all the major functions for a 3D RPG, like LOS, speech bubbles, collision detection and map files, I'm all set. Downloads are here, but are probably a bit out of date. I've just registered the project on Sourceforge, so I'm just waiting for them to accept it (or otherwise...)

3D Model Drought


The biggest problem I have with writing 3D games is finding free decent models. And yesterday I thought I'd hit gold with Google's 3D warehouse - a whole website of free 3D models with the usual excellent Google search facilities! I was set for life!

Unfortunately, the commercial reality has set in. The models are all in Sketchup format, and in order to export to any other format (with the exception of Google Earth) you need to buy the Pro Edition of Sketchup. Grrr!

Unless I can find a free convertor somewhere on teh interweb?

Friday, June 29, 2007

I've started a new game!

My latest project, which as usual has started out in a flurry of exceitement but will soon fizzle out as the real world of programming problems set in, is a 3D adventure in the style of Deus Ex. Here's a screenshot of the setup. There's no game, just an environment to walk around in:



So far I've got sliding doors, some stairs, and a man with a pidgeon chest, so there's plenty of stuff to do, like a story and pretty much everything.


BTW, this is written in Java using the excellent jMonkeyEngine.

Monday, June 25, 2007

Feedback

I don't know if I should feel slightly annoyed with myself or with the open-source community. I uploaded a new version of Nuclear Graveyard on May 2nd. Since that date, the number of players slowly dwindled, and I was wondering why. I thought people had maybe got bored of it. However, it was still being downloaded 2-3 times a day.

Then, just today (June 25th) I received an email from a kind soul who has informed me that the download from Sourceforge is corrupt! Aaaarrrgghhhhh!! I know it was my fault for uploading a corrupt file and then not testing it, but you would have thought that one of the 100+ people that have downloaded it might have just sent me a quick email to let me know!

Friday, June 22, 2007

Programming 3D Games is a PITA!

I'm going to log here all the small problems I have with 3D programming, hopefully so that I don't succumb to them again. Most of them are probably applicable to programming 3D in any language or platform.


Q. Why can't I see my 3D bullets, which are cylinders? They worked when they were spheres!?
A. It's because you are shooting them from the camera's location. If they are not "closed" cylinders, and you are culling the inside of the cylinder, then they are effectively invisible since the camera is not looking at the outer surface, which is the only visible part.


Q. Why can't I see anything?
A. It could be any of a million things. Is the camera at it's correct location/direction? Is the camera inside the 3D object that it is trying to look at?

Wednesday, June 20, 2007

Manhunt 2 banned in the U.K

So Manhunt 2 has been banned in the U.K. God knows I hate censorship! It's like religeon - why do some people think that they have the right to determine what other adults can and cannot see? What makes them so special?

And in a deliberate turn of irony, I'm going to try and get it, just to find out what the fuss is about. If it's been banned, it must be good.

Friday, June 08, 2007

Online Gaming Organiser

Updates to my games have been a bit slow recently, and I think I can now announce why. I've just set up a brand new website called "NewGame!", and it's designed to be an on-line gaming session organiser.

One of the problems with a lot of on-line games (especially the not-so-famous ones) is that the worlds are often very sparse of players. I run a couple of on-line games that get several players a day, but unfortunately it's quite rare that they will join at the same time, making the players experience a lot less fun.

This website is designed to help this siutation by making it easy to organise a gaming session for a particular game, and then automatically email everyone else who has highlighted that game as being one they play. The date and time are chosen, and voila! Everyone plays at the same time and the gaming world is populated by more than bots. It does other helpful stuff like take into account players' timezones, and links to the games home pages, and also highlights which games are free.

By the way, the address is http://onlinegameplanner.no-ip.org. It's just started, so the membership is pretty sparse. However, I'm hoping people will just add their names on the off-chance that someone will organise a session for their favourite game, and slowly the numbers will increase.

Wednesday, June 06, 2007

Microsoft Developers Don't Even Understand the Licence Agreements

Buried in this story of typical Microsoft bullying (briefly, a programmer won an award from Microsoft for developing an add-on for Visual Studio, and was then threatened with legal action for developing the very same add-on) was this email from the Microserf:-

From: Jason Weber [Micro$oft]
To: Jamie Cansdale [bedroom programmer]
Date: Dec 9, 2005 4:37 AM
Subject: RE: Follow-up Information

Since I'm not a lawyer I shouldn't comment on the license. However if
you read the Express SKU EULA you'll see verbiage around reverse
engineering, and if you read the VS SDK license (the license that covers
all native API's that you're accessing when you QueryService from your
add-in) you'll see additional terms that are relevant to your hack.
Sorry that I can't be more specific, but I'm just a developer ;-)

Later - jason


So Jason, the Microsoft clone with an army of lawyers at his disposal, doesn't understand the licence agreements, but he's expecting the poor bedroom programmer to understand them? Programming is hard enough without threatening lawyers letters from the chief innovation-destroyer!

Tuesday, June 05, 2007

jMonkeyEngine

I may well have been the last person in the world to discover this little gem, but discover it I have. It's a 3D Engine that sits on top of LWJGL or JOGL to make a lot of OpenGL (especially the more complex bits, like lighting) much easier. I'm currently changing Passenger to use it. That should make it look a lot more realistic, and I should hopefully be able to add more interesting scenery, like neon lights.

Wednesday, May 30, 2007

Unreliable XBox 360's

It looks like Micro$oft is doing an Apple, and completely denying that there's a serious problem of XBox 360's lasting approx 12-18 months before crashing and burning. No doubt it will only be when the mainstream media get hold of it that they will acknowledge that there's a problem. However, at the moment there's profit to be made from charging people ~£80 to repair something that shouldn't have broken in the first place.

Will I ever need to power-down my PC that quickly?

Who's idea was it to incorporate a power-off button onto keyboards? What is the point? And especially, why put it next to another commonly used key? On my Genuisnet.com keyboard it is just below the Delete key. I've lost count of how many times I've knocked it, and all my applications have suddenly closed right in the middle of programming. Aaarggh!! If I want to turn my PC off, I'll press the power button that sits on the case approximately two feet away! Why do I need it on the keyboard?!?!

Tuesday, May 22, 2007

Latest Releases

I thought I might as well mention the new releases of my games, in case anyone's interested!

Nuclear Graveyard - The biggest complaint about this game was all the keys. I've now added a new menu system, so all the functions can be accessed from this. You can now also click on a units stats to select them, and click on the map in the top-right corner to change the view mode.

Passenger - I changed this so that it now uses floats for the angle, rather than integers. This has led to much smoother turning. I still need some decent animated 3D models though!

DangerMan - I changed the targetting on this so that the mouse pointer is a crosshairs (just like Abuse). I think this improves the playability. I also changed it so that the sprite coords are floats rather than integers. I thought this might slow things down, but it seems okay. I need to work on the maps now.

HoloRacer - This now compiles some of the OpenGL shapes for improved performance, and I also widened the track. I also got it to remember which level the player reaches, so if they restart the game, then can jump straight to the latest level. I've managed to get to Level 5 - beat that!

Thursday, May 10, 2007

When to Check Collision Detection?

This post is not going to cover the actual detection of collisions between sprites; I think there's already more than enough of that on the net for a lifetimes reading. I'm talking about "when" we check for collisions...

I previously used to process all my game objects sequentially, and check for collisions against every other object. However, the problem with this is that the program will be checking for collisions between object A and object B, and then checking object B for collisions with object A. This is time wasted, as presumably if object A hasn't hit object B, then object B hasn't hit object A. (This assumes that all object movement has been carried out already)

What I now do is loop through each object, and only check for collisions against all the objects placed after the current object in the game's "list of objects". So object A is checked against object B and C, and object B now checks only against object C, whereas previously it would also have checked against object A as well.

So if my game had 100 objects, it was checking for collisions 9,900 times in each game loop (100 objects x 99 other objects). However it now only checks 4,950 (I think) times!

Watch Out for Eclipse and Subversion

If you're using Eclipse and Subversion at the same time, beware. When compiling, Eclipse copies the src directory over the bin directory. Presumably this is perfectly okay for most people. However, if you're using Subversion, this means that it will also copy the .svn directory that is inside src. The upshot is that Subversion now thinks that your bin directory is your src directory: it will think all the source files are missing, and try and update them.

And don't make the mistake that I did, before I discovered the above problem: I svn-deleted the source files from the bin directory, assuming they shouldn't be there (which technically they shouldn't). However, when I then update my src directory, it deleted all the source files from there as well! It did this because when I deleted them from the bin directory, Subversion thought it was the src directory!

I'm now trying Subclipse...

Friday, March 23, 2007

Self-Indulgence

Sometimes, in a very self-indulgent way, I like to search for my games on the internet and see if anyone else has mentioned them. I think this is one of the main reasons why I write games - for fame! (Not fortune, as they are fully open source, though donations are welcome). Sometimes I strike gold, and sometimes I don't. 90% of the links that are to my game are just agregators for Sourceforge, but here are a few mentions I've got:-

Nuclear Graveyard:
A mini review - though someone has replied complaining that it's multiplayer only, which it definitely isn't. (The review even mentions the AI!)

Holoracer
"Holoracer 3 announced!". What? They make me sound like a proper software company that does press releases! I don't remember "announcing it". I unleash it! (Sometimes via a magazine, it seems)

Friday, March 16, 2007

The Quality of Open-Source Software...

..is too high, especially where graphics in games are concerned. My own projects pale in comparison, and it's got me wondering whether it's worth starting a new project unless you've got an excellent graphic designer on board.

Unfortunately, graphics to play a large part in the popularity of a game, whether it's getting people to play it, or getting them to enjoy it. Back in the day, when I wrote my games for the Spectrum, it wasn't a problem as all games looked awful. But now it's different, and with games like Tremulous setting the standard, what hope have we got?

Sunday, February 11, 2007

Apache2 and PHP5

[For ref - to be updated]

LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
AddHandler php5-script php
AddType text/html php
#
# Cause the PHP interpreter handle files with a .php extension.
#

SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 9524288


AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Wednesday, January 31, 2007

Java "Interval" Class

One of the most useful classes I've ever written is this Interval class. Games always have a main game loop, which gets run every game cycle. However, often you don't need something to be done every cycle, such as the AI re-examining it's environment. For this reason I wrote a simple Java class which is used in the following way:-

Interval check_env = new Interval(1000); // Millisecs

while (game_looping) {
...
if (check_env.hitInterval()) {
// Do slightly more involved stuff.
}
...
}


It's not the worlds best class ever, but I find myself using it all the time. Here it is:-

public class Interval {

private long last_check_time, duration;

public Interval(long dur) {
super();
this.duration = dur;
this.last_check_time = System.currentTimeMillis();
}

public boolean hitInterval() {
if (System.currentTimeMillis() - duration > this.last_check_time) {
this.last_check_time = System.currentTimeMillis();
return true;
}
return false;
}

}

Wednesday, January 24, 2007

GTA Autopsy

I was getting a bit worried that my latest game Passenger was starting to turn into another GTA clone. Which it is. But it's my GTA-clone, and I can claim I wrote it! However, it also gave me reasons to think about the flaws in GTA that I can hopefully improve upon, and there are a few. Off the top of my head:-

* The camera - They slowly improved this from GTA3 - 5, but it's still a pain. Try running down the road, stop, turn 180, and then run back. You can't see where you're running! What's the point in that? It ruins the immersion as you realise you are playing a game and must think about how to get the camera to spin round.

* Targetting - I prefer direct control over my targetting, old-skool shoot'em-up style. Simply pressing the "target" button and letting the computer target for you takes all the fun out of it. Where's the skill?

* Character movement - This is actually quite cludgy. I've played San Andreas all the way through, and I think the last mission is probably the most frustrating, which is a combination of probably all these points but mainly this one. If you compare the slick control of, say, a Mario game (sorry), you can see that there is no fine-grain control. It's just a case of move, spin round, press target, shoot someone, hope they don't kill you first, and repeat.

* Frustrating missions - I realised a long time ago that most of the missions, IMHO, aren't that much fun at all. They are more frustrating than anything, and the only incentive (and it is a strong incentive) to complete them to continue the story. And I have nighmares about the missions that involve radio-controlled vehicles.

Needless to say, GTA is an amazing game, but the most fun I have out of it is by playing simple "antagonise the police" games. Anyway, I won't let Passenger end up with the same criticisms.

Friday, January 05, 2007

Multi-Player On-Line GTA Variant

That snappy name is the unofficial title of my latest programming adventure called Passenger. It was originally intended to be a remake of Turbo Esprit (a Spectrum game from about 1984), but after developing it, I discovered that due to the type of game Turbo Esprit is, if you write an updated version, you pretty much end up with GTA.

I'm trying to avoid copying GTA, but it's hard trying to think of any new gameplay aspects that they haven't included. Still, it's pretty rewarding to write a free multi-player GTA, even if it's not quite as good (yet).

Anyway, feel free to give it a whirl and let me know what you think.

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.

Thursday, December 15, 2005

More Microsoft Shenanigans

Expect OpenGL in Vista to be approximately 50% slower than DirectX (made deliberately slower my M$). From the posting:-

  • OpenGL performance will be significantly reduced - perhaps as much as 50%
  • OpenGL on Windows will be fixed at a vanilla version of OpenGL 1.4
  • No extensions will be possible to expose future hardware innovations
More here at the Wikipedia article:-
Microsoft has taken the decision not to release the information necessary to allow third parties (such as those at NVIDIA, ATI or the other large graphics card manufacturers) to develop replacement drivers, leaving no way to avoid the 50% speed drop.



Wednesday, December 14, 2005

Where's the 3D On Slow PC's?

With the latest programming technology and libraries, how come is it that 3D now requires the latest top-of-the-range graphics cards? I'm not just talking about the latest commercial games, but open-source projects. I run a bog-standard 600Mhz PC with no special graphics card, and I can't run any modern 3D game, apart from the ones I write. Half-Life (1) and Quake run vert smoothly without a problem, but for some reason anything written in the last 5 years either runs like a dog or not at all. It's one reasons why I make sure all my 3D games can run on the lowest spec PC. Why should we lose out on all the fun?

Thursday, December 08, 2005

Piracy Lies!

More lies about piracy are being peddled by the industry. Lets address a few:-

Why should we fight piracy?

  • Piracy/counterfeiting is illegal and punishable by fines and jail sentences. - Especially now that the lobbying of governements has got into full swing; you can put put away for longer for pirating a game than beating someone up.
  • Counterfeited/pirated games are often mixed with obscene or pornographic material. Where? And why haven't mine?
  • Consumers have no recourse under law for faulty pirated games, which can damage hardware. True, they can damage your hardware if you drop a box of them on your PC.
  • Local and national jobs are lost as a result of pirate operations.
  • Proven links exist between piracy and organised crime, including drugs and pornography. Yes; they are both on their web page.

Tuesday, December 06, 2005

New Upload of Emergent Mercenary (v0.4)

It's finally turning into a game! In the latest upload, you start in a deserted field. A ship then flies overhead and teleports down some comrades; just in the nick of time as something seems to be moving in the distance...

The unit intelligence is getting better, and they look more realistic now, especially with their moving legs.

The game is freely available here.