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?