Tuesday, August 31, 2004

The search for intelligence

Game AI is a lot more involved than I originally thought. Presently the logic of the program has to consider three things based on the difficulty setting applied by the user.

1. When the CPU player decides to move.
2. Which move it decides to do.
3. How quickly the CPU moves.

Obviously, the higher the difficulty, the faster the CPU moves and it decides when to move in a more tactical manner. So far I’ve managed to design code to handle the first two instances and I’m quite close to implementing the third. I’ve decided to create an AI class. This class will use the game engine as if it’s a separate player.

The single player game class will have the game engine, AI class and handle the display and key capture. I’ve still got to decide if it’s a single shot practice for the multiplayer or to keep the player playing, while ramping up the difficulty. I’ll see how difficult the latter is to implement before making a decision.

I’ve also got to work on the nag screens, to remind players to upgrade.

Wednesday, August 25, 2004

Complete Hot Seat.

Well, the first and easiest part of the game is complete. It allows two users to play the game using the same handset. I’ve completely dropped any alert functionality due to the Nokia 6600 being unreliable with it. Instead, the users just get a timed message and then it returns to the menu.

This raises an interesting issue. One of the reasons I use J2ME is that the standard code and form elements are supposed to be compatible over all the whole range of phones. Already Nokia has shown they have problems implementing this, so I can’t assume that one set of standard code will work on another.

The other issue is Bluetooth support. The Bluetooth API is only really supported in MIDP 2.0. This game has been coded in MIDP 1.0. Now, the question I have to answer is ;-

Do I want to recode the game in MIDP 2.0 to take advantage of all the extra functionality that’s available? It’s a lot of extra work and will I hit my deadline.

Monday, August 23, 2004

A. I. ?

I’ve been working on AI routines all weekend (when I could) and I was working my way through the code trying to improve on the algorithm when I hit on the solution. I was able to use recursion. Normally this is only taught on courses and people forget about it, but in my case it saves so much time it will probably cut time off the project (for once).

There are two outstanding bugs remaining with the Hot Seat version of the game.

Thanks to the Nokia 6600, the alert functionality is not available. I have to come up with an alternative.
The RMS Code requires examination.

I should really get these two out of the way before continuing with the AI Code.

I’m also going to be posting the source code for the bluetooth functionality required by the game. There have been requests for this kind of tutorial on various forums (not specifically for this game), so it will be nice to view it through the learning process.

Wednesday, August 18, 2004

Progress Report

Bloody Nokia. Well I can forget using their latest SDK because it can’t handle paths that have spaces in them. As I work with XP Pro, The project is under the ‘Document and Settings’, so no JAD can be found. Back to 0.3 SDK then!!

More pain from the 6600 as well. It has problems with some of the basic classes of J2ME, the alert dialog. Workarounds have been suggested and investigated but they are all specific to the phone. I’m going to have to write my own custom alert screen to get round this and keep it working on all the phones I planned for. I’ve still got to do a little investigative work into the capabilities of MIPD 2.0

I did start work on the AI for the single player game. It doesn’t appear as complicated as I thought but it will take a little while to implement. The only procedure I have left outstanding is the AI’s analysis of the game map. Once it’s worked out where its priorities should be then playing the game is pretty straight forward.

I’m going to remove the times I have set against my milestones because when you see them turn red you just get depressed.

On a more positive note, I’m getting a lot of help about the java Bluetooth from a website called http://www.benhui.net. It’s an invaluable source and the people on the forums are well clued up!

Monday, August 16, 2004

It's Alive Part 2 !

I've got a prototype working on my Nokia 6600. I've hit a know issue with the Alert Screen but it actually works with the hot seat version. This is fantastic news and boosted my confidence no end. I have notice a couple of problems though.

1. The map not regenerating if you select a second game.
2. Canceling the new user dialog, still creates an RMS user.
3. The graphics are off by one pixel.

But these are minor problems which I will have ironed out quite quickly now that I have the debugger working.

As this game in now going to be exclusively MIDP 2.0, I'm going to attempt to move the SDK from the 0.3 Beta to 2.1 Beta and see how it responds. It also means rewriting some of the dialogs so they format better but as I've pointed out earlier, minor issues. There also should be a new Development Kit from Nokia in the next few days which will be interesting to look at.

I even tested the hot seat version on the N-Gage. Worked fine. Still gnashing my teeth over the Bluetooth issue though. I'll be doing some part time investigation work into how difficult it would be to translate the game to C++ but that is low priority.

Thursday, August 12, 2004

SHOWSTOPPER !!

Well, I've just realised that I've wasted a lot of money on the N-Gage. The Blasted thing does not support Bluetooth in Java. Only C++ is supported ! This destroys My game plan totally.

I now have two options, re-write the whole game for the n-gage in C++ or forget the n-gage and only code for the MIDP 2.0 + JSR-82 spec. This cuts down on so many available phones it's hurtful!, 50 odd potential phones.

This leaves the 6600 I have and the Emulator to test the whole thing with and I'm really having a lot of trouble with the Bluetooth Dongle at the moment.

It would take a month to get to the stage I've got with C++, so I'll leave it.

Wednesday, August 11, 2004

It's Alive !!!

The debugger is now working (kind of). It's only taken me four months to sort out. It seems a bit ropey but it will do for my purposes. I'm going to check out a couple of new JDK and Emulators over the next few days to find out which are the most reliable.

I've been searching for decent sounds to use with the game and the fewer the better IMHO. I'm not going to have a catchy theme tune or any music playing in the background, just spot effects for the clock countdown and the activation of a pathway. I will, however, have to have different sounds for each theme otherwise it will feel cheap.

Now it's time to look at the multiplayer aspect. This means the Bluetooth will have to be looked at. I have a couple of test applications to run to get my head round what will be needed.

Presently I'm looking at a release date sometime towards the end of September to mid October, but as I've discovered on many occasions during this project, the will probably be set back.

Monday, August 09, 2004

Bad News.

I tried the new settings I found in the various documents around the Nokia Website and have had no success. There has been no reply to any of my queries so I'm getting a little worried.

admittedly, the only items which are Nokia specific are the screen display and sound management, so I could continue to code using a standard J2ME and only add in the various bits I need when the others have been debugged.

It might even be a blessing in disguise because is might force me to be as generic as possible, thus making porting between Phones easier.

Sunday, August 08, 2004

A Miracle.

I Acctually got a little work done on the game over the weekend. It wasn't much, it was just getting the hotseat version working properly on a Nokia Emulator but after almost two months of no activity, it was such a relief.

The problem is although the program runs using the emulator, I'm having real trouble getting the debugger working though and Have had to ask for help on the Nokia forums. You need a good debugger to handle the more complicated code. Especially when a bug pops up from nowhere (Which has happened far too many times!)

Menus look a heck of alot better with little icon next to them. The UI is not as dry as it was. I've also noted quite a few places where the code can be optumized.

Progress all depends on the debugger working within the next few days. It will make or break this or any other project I want to do with J2ME.