Welcome to Nexfinity

G'day. My name is Christopher Johnson and I'm a University student studying Software Engineering at the University of Adelaide. Nexfinity.net is my website in which I'll cover programming related projects that I am working on as well as other tidbits from my day to day life. I have a passion for video games and computer programming and I hope that you I can share this with you through Nexfinity. Thanks for stopping by. I hope you enjoy.

Twitter Update

Follow me on Twitter

Current Project

Paint Prototype - C++ - SDL

Navigation

Categories

Most Recent Articles

Browse by Month

Blogroll

Content Syndication

Meta

CC-GNU GPL
The software on this website is licensed under the CC-GNU GPL version 2.0 or later. Unless otherwise stated.

PIRC Spelling Bot - Side Project

June 20th, 2009

Throughout the semester I’ve been playing around with extending the functionality of Java by using the additional open source libraries. This started off when I was looking to improve the GUI on our TimeTrack group project which you can check out via my portfolio. After stumbling upon SwingX and Substance which I used to improve our graphical interface, I continued to look for more libraries. Some of the more notable ones I found were PIRC Bot, an IRC based library for Bot creation, GraphViz, a library that plugs into the C library which is used to generate graphs and Jazzy, a spell checking library. I decided to put some of these to work. I used GraphViz for an AI assignment and I decided to use PIRC Bot, and Jazzy for a custom created Spelling Bot.

Today I am happy to say that I’ve finished creating this Spelling Bot. You can download the source code here. This spelling bot has a few nifty features including:

  • Spelling suggestions offered to users that misspell words in a channels that the bot has joined
  • Predefined(Aspell) and Custom Dictionaries
  • Following orders from a master such as adding custom words, joining and leaving channel

So be sure to put your those poor spellers to the test with this bot! I’m sure that you probably know a few.

New Project - Paint Prototype

April 2nd, 2009

It has been a while since I have finished programming Draughts and I think that it is time to move onto a new project. About a week ago from today I met up with a few friends of mine whom share a common interest in creating games. Together we discussed potential game projects and ideas. As I mentioned on Twitter, creating interesting game ideas is hard.

One of my biggest inspirations for game development, Everyday Shooter

One of my biggest inspirations for game development, Everyday Shooter

By the end of the night however we all agreed upon several ideas that we wanted our game to incorporate. The feeling of true consequence in a game and the sparing use of color and sound to signify importance of things in the game world. Over the weekend we all individually thought up potential game concepts that were based around these ideas. One thing that became quickly apparent to me while brainstorming is that having real consequence, consequences that makes the player feels guilty or sad about is hard. After this realisation I removed this idea from my mind and focused on an emphasis on color and sound. After some more brainstorming I came up with a concept that I thought was interesting but not entirely a good representation of what we had discussed. I discussed this with the group who also shared this enthusiasm for my idea. Another idea had fluctuated to the surface that was also interesting. The aim of my next project is to develop a prototype for the idea that I had designed. I want to keep the details of this idea behind closed doors for now because it is most definitely not concrete.

paint

Paint, so much game potential here.

Currently I am intending on creating the prototype in C++ using my old pal SDL. Before finish I will tease a clue, it involves paint and a lot of different colors. I will keep you posted.

Points - The Hidden Money Grab

March 14th, 2009

I thought I’d change my tune with this post and express my opinions on something that concerns me a little. With the internet connectivity being a strong focus for the current generation of consoles, we have seen the emergence of online stores that digitally distribute games, additional game related content and lots of other goodies. Two of the three major console manufacturers currently use a custom currency on these digital distribution channels. This in itself annoys me because in my mind it appears to mask the real cost of a piece of content. Since a Microsoft point or a Wii point isn’t a common currency I believe that people tend to undervalue its worth and hence buy more content on this fact alone. This is however not my major gripe with the system. I am very dissatisfied with the methods of buying a game through this point system.

super_mario_rpg

To explain my point I want to refer back to an incident that happened a few weeks ago. My brother and I were buying some virtual console game via the Wii Shop Channel, the digital distribution service for the Nintendo Wii. We wanted to buy around four games that we’d previously missed out during our youth. We searched the store to find our first game, Super Mario RPG which was valued at about 800 points. We then followed through the prompts to purchase the game since we couldn’t add it to a shopping cart and bundle it with our other purchases. We were soon arrived at a screen saying that we had to buy a block of points to buy the game. The lowest increment of Wii points was 1000 at $15 AUD. This means that we had to spend $15 to get a game that was really valued at $12 AUD. If we were buying a NES game that usually sell for 500 points then we would have to pay twice the price for it. Overtime we will likely buy more games and use up those points but it is highly likely that we will get to the stage where we don’t want to buy any more games and have several hundred points sitting in our account.

points

Let’s play with some numbers to get a rough idea of how much Nintendo are profiteering from this concept. According to VG Chartz there are about 48million Wiis sold around the world at the time of writing. Let’s make the assumption that only 5% of Wii users are online and of those 3.75% have some Wii points left in their account. Lets continue with some more assumptions and assume that on average there are 120 unused points in an average account. If my figures are correct this means that 1.8 million Wiis have a total of 216 million Wii points sitting in their account. This works out to a total of $3.24 million AUD and they are making this money for free. Do you feel a little cheated now? I know I do. Of course the Wii user base will continue to increase in the future as will the amount of users buying content for the Wii Shopping Channel so this figure will surely increase.

Don’t take these numbers too seriously but do take note of the extremity of these values. I believe that the Xbox 360 Marketplace uses a similar sort of system so Nintendo is not alone on this one. To heighten the amount of unused Wii points the current bundles of Wii points are not easily divisible in common pricing structures for games. Of course for cases where you buy a point card at retail this problem is inevitable by design but could be avoided by a more realistic point allocation. So the next time you invest in a block of points think about how much you are really paying for that 800 point game. Be back soon.

Draughts Game Complete

March 8th, 2009

I’m happy to say that I have finished adding all of the small touches to Draughts and it’s ready for public consumption. According to the deadline I set I am a bit overtime which is slightly disappointing. I think the biggest contributing factor was a lack of planning. By the time I finished implementing the baseline functionality, the game states or the game engine weren’t implemented. Despite being a tad late I feel that I’ve learnt a lot about some new tools such as Valgrind and bit about how game engines work.

I’d like to thank Roald Strauss for the music. I discovered his music at Indie Game Music which is an excellent resource for finding game music.

I have only provided the source code for Draughts since I didn’t want to have to deal with request about any compatibility issues. You can however compile the source code yourself and play. The game requires the SDL, SDL_image, SDL_ttf, SDL_mixer libraries. Here is a great tutorial about compiling SDL applications for your system.

Download Draughts Source Code

Everything provided in this zip file except for the background music is under the CC-GNU-GPL license. The background music is owned by Roald Strauss and he’s permission has been granted for use in this game.

If you would like to leave feedback then you can enter a comment below or drop me an email. I have a few ideas floating around for what I want to do next, probably something more ambitious with SDL since I enjoyed using it. For now my brother has a few web related things for me to do which I should get to. Hope you enjoy playing.

Draughts AI - My Approach

March 4th, 2009

I am happy to say that I have finished programming my Draughts game. If you have been following my Twitter then you may have noticed that there is one thing holding me back from releasing it, memory leaks. I personally expected to have a few since I haven’t had a great deal of experience writing more sophisticated applications in C/C++. I got around to checking these leaks the day before I was heading back to University for the semester so I haven’t been able to address all of them yet but plan to soon. For the mean time I would like to discuss the AI that I have used in this game.

One of the fundamental concepts behind AI is the Turing Test as discussed in Alan Turing’s 1950 paper “Computing Machinery and Intelligence“.

A human judge engages in a natural language conversation with one human and one machine, each of which tries to appear human. All participants are placed in isolated locations. If the judge cannot reliably tell the machine from the human, the machine is said to have passed the test. In order to test the machine’s intelligence rather than its ability to render words into audio, the conversation is limited to a text-only channel such as a computer keyboard and screen.

With this in mind I decided to brainstorm several things that would cause my game to fail this Turing Test. The first notable thing is moving a piece into a position in which the opponent can jump that piece when there are other more advantageous positions on the board. The second is if the computer player doesn’t take the obvious jumps and double jumps. To put these into play I decided to assign a priority to all of the possible moves that a computer opponent could take. Any moves which resulted in capturing an opponents piece would would receive an increase in priority and any moves that resulted in being captured by the human player resulted in a decrease in priority. The computer would then take a random move out of the list of moves with the highest priority.

The system described above is the crux of the AI. Overall effect works really well towards the start of the game but sort of falls apart as the pieces become scattered across the board since the AI moves pieces at random. I’d like to think that the aggressiveness of the computer early on makes its flaws less apparent towards the end but this not always the case.

Thanks for reading. Hopefully towards the end of this week you should be seeing the source code of Draughts here. For now enjoy some of these screen shots.

Draughts Progress

February 20th, 2009

So far I’ve been working on the Draughts project for several hours over the last week and I am happy with the progress that has been made. I am right on target to meet both deadlines that I have set. One thing that I have underestimated is the amount of planning that was required. Initially the overall game structure was planned out. This included things such as the data structures used, object orientated models and code structure. There are two things that I didn’t plan for and I want to talk about them today.

The first issue I found is how the player should move their pieces. I wanted to make this process as intuitive as possible, so intuitive that the user wouldn’t need the controls explained to them. I came up with two strategies to solve this issue.

Drop and Drag

The drop and drag method involved the player clicking on the piece and then dragging it to the location they desired. My first thought was that this approach was rather intuitive since it mirrors the movements that someone would take in real life. I then thought back to my experience with other games that required you to move pieces such as Puzzle Quest and Bookworm Adventures. Both of these games don’t make you drag pieces across the screen and there is a good reason for it. After a while it becomes a tedious process. Other issues arise such as collision detection between pieces and squares as demonstrated below. Technically it also ads to the code complexity and processing oomf that is required.

Refresh 5 times twice?

Refresh five times or twice?

Click and Select

This method is the one I used in my version of Draughts. It is simple to program and simpler for the user. You simply click on the piece that you want to move and then click where you want to move it. One of the greatest benefits compared to the previous approach is that you are required to update the screen less often. You only need to refresh the screen once the player has made a choice and then refresh the squares that are modified in that choice which tends to be two squares. The square where the piece existed and the square where the piece moves to. Whereas with the drop and drag approach you have to update the screen every time you incrementally move the mouse, in order to create the result of the piece following the cursor. What makes this worse though is that you also have to refresh the squares that the piece moves over.

The second issue that I came across was how to handle the multiple jumps in draughts. Initially I wanted to show all of the possible moves a player could make in one turn and highlight the respective squares. This became impossible when you think about trying to represent it on the screen. What struck me though was that by showing all of the possible moves to a player was that I was showing them too much. So I decided to limit the scope of what was shown. This was restricted to a domain of one jump. Since most players would naturally recognise one jump moves I decided that there was no real advantage of showing them the potential moves. To handle multiple jumps I decided to break the moves up into single jumps in which subsequent jumps are still highlighted and forced the player into not being allowed to revert their previous jump. I also allowed the player to choose to not undertake a subsequent jump if they choose not to.

Double meaning

Double meaning

By the time you read this I should have finished the base functionality. I was intending on posting my current progress online but I am requesting permission to use some music and haven’t received that yet so I will hold off until I finish it. Will be done soon.

Draughts Project

February 11th, 2009

As I mentioned in my last blog post the first project that I plan to share is a draughts game. The aim of this project is to give myself some practice with SDL and an idea at the sort of time frame I can produce small games in. Below is a rundown of the current specifications and milestones of the project.

Draughts Game

Programming Language: C++

Libraries: SDL, SDL_image, SDL_ttf

Baseline Functionality:

  • Human Controlled Game of Draughts for two players
  • Piece Movement and capture
  • Piece advancement
  • Graphics Blitting
  • Background Music and Sound Effects
  • Simplistic Game Configuration

Advanced Functionality:

  • AI based Opponent
  • In Game Configuration
  • Game Menus and Restarts
  • Move Count
  • Match Timer

Time Frame: Baseline Functionality 10 days - 21st February

Advanced Functionality 15 days - 26th February

Over the development period I will post some details about how things pan out. Hopefully I can finish everything well before the expected time frame.

Back in the Saddle

February 10th, 2009

After several months away I have decided to get back in the saddle and get back to updating this blog. I’m sorry for disappearing for a while but I’m back now. Over the last few months I’ve been playing around with a few things which I plan to quickly run through today.

Firstly I have switched over to the Dvorak key bindings on my keyboard. Dvorak is just different layout for the keys on the keyboard such that you don’t need to stretch as far to hit the commonly used keys. As a result typing related injuries are greatly reduced and in some cases people improve their typing speeds. Before using Dvorak I didn’t consider myself a good QWERTY typist so I also used this opportunity to teach myself to correctly touch type. I used a combination of the fabulous GNU Typist and ABCD: A Basic Course in Dvorak. Another change that I have made to my typing is a change in keyboard. I have switched over to the Microsoft Ergonomic Destop 4000 as recommended by the users at Stack Overflow. It’s great keyboard once you have adjusted to the greater split between your hands and the slightly curved keys, highly recommended. You really only notice how good this keyboard is once you switch back to a standard keyboard. I think the same applies to the Dvorak key bindings.

ms_ergo_desktop_4000

Secondly I have been playing around with a few different libraries in C and C++. The first of which is NCurses which is a library that is used to create TUI’s in the terminal. NCurses works by treating the terminal as a grid and allows the creation of Windows, forms and menus. It’s a lot of fun to play around with. I found this site particularly useful for learning the ins and outs of NCurses. If you enjoy playing around with NCurses then I suggest you try the Curses Development Kit. I started programming a platformer game with the terminal but I the jumping didn’t go as smoothly as I would have liked so I abandoned that project. In the future I’d like to work with NCurses for another project.

Another library that I have been playing around with is SimpleDirect Media Layer(SDL). The SDL library allows you to integrate audio, images, pixel manipulation, keyboard handling and much, much more into your programs. It is commonly used to created 2D games but also has the functionality to work with OpenGL. Learning SDL has been very enjoyable and exciting. I have been through all of the excellent tutorials by LazyFoo and intend to implement a draughts game which I will cover later. The SDL Documentation is also very good and highly recommended.

SDL

Probably one of the biggest changes to occur in the last few months is the fact that my family is now on Naked ADSL. Previously we were on dial up since the distance between our house and the telephone exchange was too far and hence the signal degeneration was too high. But with Naked ADSL, in particular Internodes Naked ADSL Extereme we were able to just get Naked ADSL despite the fact that our line attenuation is still very high. With Internodes Naked ADSL Extreme, the ADSL signal is pushed further since Agiles’ DSLAMs don’t have to worry about handling the PSTN side of things. The switch to Naked ADSL has been great and Internode has been very responsive to any problems we have had. I’ve been enjoying a lot of unmetered content from Steam and Games.on.net.

Internode Loge

With the switch to Naked ADSL also came the switch to Ubuntu Linux. I had been using Ubuntu on my Acer Aspire One netbook for several months and have been really enjoying using it. I did try to setup before on my desktop but things were too tedious and not always functional with Linmodems. Currently I use Ubuntu as my primary partition and I switch to Windows Vista for gaming.

I’ve also been doing alot of gaming over the break, possibly too much. Notable titles that I have been playing are Farcry 2, GTA 4, Metal Gear 1-2, Metal Gear Solid 1-2, Wario Shake Dimension and Mega Man Powered Up. I am currently playing GTA4 and some Pixel Junk Eden on the side. As usual there is a mountain of games to play which is never a bad thing.

4803-gta-iv-screenshot

That pretty much concludes what I have been doing over the last few months. I almost forget my twin brother returned from Shanghai, you can read about that at PrimeScape or read his games blog at DanielPrimed.com. As you may have noticed there are some small tweaks to the site. The most notable one is the Current Projects Box on the side. Within the next few days I will post up the details about that. Stay tuned.

Welcome to Nexfinity.net

October 5th, 2008

Hello and welcome to Nexfinity.net. I’ve finally decided to post something on the site after several months of delay. My initial plan was to start posting during mid July but that didn’t happen. I’m here now and am keen to start posting. It’s a great time for me to start too since there is only about two months until I’m finished University for the year and I have several ideas for projects that I’d love to share. If you haven’t done so already check out my about page. It will have contain some more details about myself. Hopefully over time some of my personality will shine through the words I share on this blog.

It's about time!

It's about time!

In the past I have run several personal blogs with little success. Success in terms of the fact that they haven’t been running for very long nor have they been very interesting to read. In this instance of Nexfinity I plan to rectify these past blogs and bring more energy to the table. I’m not sure on the posting frequency that I plan on adopting but I’m hoping that I’ll be posting once a week. My intention with Nexfinity is to create a place where I can try to improve my writing skills since I eventually intend to enter the communication driven world of software engineering. If my writing is good enough to generate any form of readership then that is great bonus. Currently there may be a few technical problems on the site but overtime these should be ironed out.

You can subscribe to my RSS feed to receive updates when I post new items.

Happy reading.