Do It For Charity 5km Run – Sponsor Me!

Hello there!

Well, with the desire to increase my fitness level I joined the gym about 6 weeks ago. My fitness level has been increasing quite quickly and so I decided to set myself a bigger target, a 5km run, and what an opportunity to Do It For Charity! and help The Stroke Association to do something amazing for someone out there. I have registered for their Manchester 5km run on the 11th October, wish me luck!

I would like to ask that anyone out there who happens to come across my website give me and The Stroke Association a helping hand by sponsoring me for as much or as little as you can afford to. I have set up a page with JustGiving which can be found here. Also check out the JustGiving widget below for information and to sponsor me. They accept major credit cards and PayPal.

Thank you very much for taking the time to read this, and thank you to all those who make a donation to The Stroke Association.

Maybe next time I’ll be doing a 10km run!

Comments for this post (0)

BPoker is playable

I’ve been working on BPoker quite a bit over the last few days and this version is finally playable! Since the previous version I’ve rewrote a lot of code to achieve a better code structure and I’ve incorporated better graphics and animations. In order to demonstrate the animations etc in this version of BPoker I created a screencast which can be found on youtube. My next BPoker update will incorporate the options and help screens into the game. After that I plan to begin porting the game to Java ME and get it up and running on the mobile phone platform.

Comments for this post (0)

Unreal modding and BPoker update

I’ve bought myself a copy of Unreal Tournament 3 because I want to experiement with modding the Unreal Engine seeing as it’s one of the biggest commercial game engines going. It’s also where I began experimenting with creating content for games. I’m starting off by working through some tutorials over at the ModDB website but I aim to eventually create a new game mode.

I realise that I haven’t posted any updates on BPoker for over a month now. To be honest I haven’t really worked on it much recently. I have a new screenshot for now, which shows the new game interface. Overall the game is getting very close to completion for the desktop version. I’m quite looking forward to porting it to the mobile platform once this version is complete!

BPoker in game interface

BPoker in game interface

Comments for this post (2)

Reading an RSS feed with PHP

Here’s one for my friend Dominique Briggs. Yesterday he mentioned the idea of having my recent blog posts appear on his blog. I figured it wouldn’t be hard to read an RSS feed using PHP (seeing as RSS is based on XML) so I set about trying it.

A quick Google search brought me to a quick and simple tutorial on parsing XML using PHP. The process is as simple as creating the SAX parser, setting up call-back functions, and passing the XML data to the parser. In about half an hour I managed to set up a simple PHP based RSS feed reader (not fully featured, but enough for my needs).

For convenience I decided to turn it into a simple WordPress plug-in, SimpleFeedReader. To install the plugin, extract the simplefeedreader.php file and upload it to your WordPress wp-content/plugins directory. Log into WordPress and go to the plugins page, find SimpleFeedReader and click the Activate link. Now a slight modification of your WordPress theme is required in order to make use of the plugin.

At the appropriate position in your WordPress theme (for example within the sidebar.php file), insert the following code:

<?php if(function_exists(”simple_feed_reader”)) simple_feed_reader(”url”, 5); ?>

This will output an unordered list with the class simplefeedreader that contains the first 5 items of the RSS feed at the specified url. Change “url” to the RSS feed URL that you wish to read from, and change 5 to the maximum number of items that you wish to display.

On a final note, WordPress 2.7.1 is now available. I urge anyone who uses WordPress to keep up to date mostly for security reasons, but also for bug fixes and new features too.

Comments for this post (0)

Algorithms: Path finding and maze generation

Last week I dug up an old game development demo that I wrote back when I had more time on my hands. The demo shows off a couple of graph searching algorithms (A*, and depth-first search) and how they can be applied to game development problems, in this case the generation of mazes, and solving them. I also wrote an article that provides instructions for using the demo, but more importantly, explains the technical details of how the algorithms work. More information and downloads of the demo can be found on my A* Path Finding page.

Comments for this post (0)

A new look and some automatic game design

NickBloor.co.uk has a new look! Many thanks to Sarah Needham for creating my sidebar image, which I turned into a valid XHTML/CSS template for WordPress (using valid XHTML 1.0 Strict, valid CSS 2.1). I’ve now got a pretty cool looking website if I may say so myself!

BPoker is slowly but surely becoming polished. The main update I’ve been working on is the introduction of active rendering and a main game loop. Now that I am ready to incorporate animation into the game, the animations will need to be updated whilst they are running and not just when an event occurs (whether the event be a mouse click or the repainting of the application window). The main loop constantly calls an update method (which updates animations etc) and a render method (which draws the current state of the game) until the application is closed. All of the rendering is done to a back buffer and once the rendering has completed the back buffer is copied to the window at once in order to achieve flicker free animation.

I have also decided to ditch the Swing/AWT GUI components and write my own code to implement the game GUI. The key reason for this is that ultimately I intend to port the game to the mobile phone platform and so I need to keep in mind that a mobile phone user won’t have a mouse to click buttons with. I’ve currently implemented a main menu whereby the selected item can be changed with the up and down arrow keys and activated with the enter key (on a mobile phone the up/down keys or 2/8 keys and the select or 5 key). The main menu items can also be activated using a mouse which is important because some mobile devices have touch screen or stylus input methods available to them.

BPoker 1.1 Main Menu

BPoker 1.1 Main Menu

As you can see from the above image, I have been creating some graphics for BPoker. I’m not a very artistic person but I figured it wouldn’t be too difficult to create some playing cards and casino chips so I set about creating a main menu image. After a few hours experimenting I arrived at the above image, click the image for a Flash slideshow showing how that image evolved. I’m quite happy with the result!

I’m going to finish up this blog posting by diverting from what has been the main subject of this blog, BPoker, and mention an article that I came across recently. The article is written by a Swiss artificial intelligence researcher, Julian Togelius, and it is about automatically generating (or evolving) rule sets for games by using artificial intelligence techniques such as genetic algorithms and neural networks. It is a nice idea however it would take a lot of work to be truly effective. The article can be found at http://togelius.blogspot.com/2008/12/automatic-game-design.html.

Comments for this post (0)

Happy 2009 and a BPoker update

Happy new year everyone!

Okay lets see, it’s been a month since my last update, I’ve been due one for a while. I guess coursework deadlines got in the way of things, coursework and the whole Christmas and New Year period I guess. I’ve still been working on BPoker though, and over the last month I’ve done several key pieces of work:

Java Animation Demo

Everything I’ve done regarding game development has so far been in C++ (or Visual Basic 6 very early on), and I don’t have much experience with graphics programming in Java. Because of this I decided to experiment within a new project to develop and test a simple animation system for flipping playing card images over. I also implemented double buffering into the animation demo to create flicker free animation.

The following is a screenshot of the animation demo. The screenshot isn’t very interesting but the animation works! The animation itself is quite simple, the card image simply shrinks horizontally and then un-shrinks as the other side of the card.

Java animation demo

Java animation demo

Java ME Graphics Demo

I began developing this poker game because I wanted a poker game that didn’t have horrible controls and that I could play on my mobile phone. Yet I’ve only just touched on programming with Java ME (Java Mobile Edition). I’ve been reading various articles on Java ME game development and I eventually got around to developing a simple application that does full screen graphics on a mobile phone. The demo simply displays a snow effect but it’s a start for Java ME development.

BPoker Re-structuring

The final big piece of work I’ve been doing is a major re-structuring of my poker code and classes, the result of which will make my life much easier with adding in new features later on. I also now have a much more powerful codebase to work from.  The bulk of the work has consisted of breaking down my classes to be more flexible and sensible. For example: a hand class no longer has methods to determine the type of poker hand it represents, instead I have a generic hand class that simply represents a set of cards. Evaluating a poker hand is now down to the class PokerHandEvaluator, and a PokerHandResult class that represents the “value” of a hand.

PokerHandResult objects are comparable to determine which of two hands is better. The PokerHandResult can also provide better information about a poker hand, for example the toString method will return “Fives full of aces” as opposed to the previous code only being able to return “Full house”.

My next task is going to be re-building the graphical version of BPoker to make use of the updated codebase and then to properly implement animation and options screens, maybe some better graphics!

Comments for this post (0)

BPoker Version 1 Complete

I have now completed the first graphical desktop version of BPoker! The game is fully playable in its current state however from this point onwards I will be building more features on top of the basic game to make it nicer looking and more enjoyable to play. The list of features I’m planning to implement includes: animation, sounds, and a whole range of configurable options.

Although it’s nothing too fancy, I wanted to show a set of screenshots from the game in this blog post, however I didn’t want a big list of screenshots clogging up the page. Instead I decided to whip up a very quick slideshow using Adobe Flash and ActionScript 3.0. The results of this can be found by clicking the image below:

Desktop BPoker Version 1

Desktop BPoker Version 1

Finally, a quick note on the card images that I’ve been using. The images are public domain, created by Brian Huisman, and they can be found over at Brian’s website GreyWyvern.com. Despite these images being in the public domain, I do intend to create my own set of playing card images to use in my game later in the development process.

I’ve also been doing some research into J2ME and the process of developing a mobile phone game. It seems fairly easy once I learn the libraries. I think it will be much easier to develop the game as a desktop game and then port it to the mobile phone though, so I’m continuing development on the desktop version for now until the game is thoroughly polished.

Comments for this post (0)

BPoker first draft complete

Over the last two days I have worked on determining what poker hand the player has achieved. I began by looking at the poker hands that my game needs to distinguish between:

Based on this information it is clear that poker hands share three key traits:

The first function that I implemented was to check for a flush because it was the simplest to do and the checks for royal and straight flushes could then delegate work to this function and save me repeating the same code.

Next I implemented a function to check for a straight hand. At this point I decided to, prior to determining the poker hand, make a copy of the hand and sort the cards by their valurs. With a sorted hand the flush check will be unaffected, and the straight check will only require a single run through the hand to determine if it is a straight or not.

The final problem was determining if the hand has two or more cards with the same value. For this I implemented a function that returns a list of the lengths of each same-value run found with the sorted hand. For example if the function is given a list of cards with values (5, 6, 6, 7, 8) then it will return the list of lengths (1, 2, 1, 1). From this point it was trivial to test for the other types of hands. For example a four of a kind hand has two same-value runs and one of the runs has a length of four.

Text-based BPoker Demo (screenshot 2)

Text-based BPoker Demo (screenshot 2)

 

Now I have a working “jacks or better” video poker style poker game up and running in a console application. Next I’m going to create some card images and turn it into a graphical game.

Comments for this post (0)

Mobile Poker Game

I enjoy playing Poker (particularly Texas Hold ‘Em) and a while ago I came across a version of five card draw poker made by DS Effects (they don’t seem to distribute it any more however it may still be found here: DS Poker) that runs on a mobile phone. The game is very similar to this online Flash game, Royal Poker, however there is one small problem: when placing a bet you can only increase or decrease your bet by 1 each time you press the key.

So instead of just complaining and removing the game from my phone, I decided I would put my Java programming skills to a non-academic use and create my own five card draw poker game for my mobile phone.

After completing my work and getting it marked in my lab session today I decided to hang around for a bit writing some Java code to form the basis for my Poker game. I have begun the development process by writing and prototyping classes in a text/console environment and I intend to write the first version of the game in this environment before moving to a graphical game and then on to the mobile platform. So far I have created and tested the following classes:

So far I have a basic skeleton of the game up and running with the above classes and I only need to implement code to evaluate the player’s hand and pay out winnings and the first version of the game will be complete.

Text-based BPoker Demo

Text-based BPoker Demo

Before leaving my lab I had a brief think about how best to go about evaluating what kind of hand the player has but I didn’t come up with much more than deciding that I would need to check for different types of hand from best to worst (i.e. starting with royal flush). The next update will include more on this!

Comments for this post (0)