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!