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.
Archive for February, 2009

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.