Title Image
Twitter Logo
http://tiny.cc/cznl3 gotta love Harry. 5 days ago
Follow me on twitter @stewartmatheson

A few more details on my masters research project…

22nd
6 / 2010

A very rough draft of what the first map in the game might look like.

I mentioned in my last post that started work on a hush-hush project. When I say hush-hush I really mean a project in which the details have not quite been refined. I can now reveal that the project I’m working on is a Flash-based Web game. The game is going to be a turn-based strategy game. The game will feature an isometric view with tiles. Here’s my first rough version of the tiles that I want to include in the game. The colours are not quite right and there needs to be more variety however it is a good starting point. Don’t be too rough on me. I’m not really a designer.

I can also tell you that this game will feature an artificial intelligence system that I have not seen anywhere before. Instead of the artificial intelligence been coded into the game the artificial intelligence is housed within a Web application. The game requests back to the Web application asking the new artificial intelligence instructions. This is my dissertation for my masters. It’s my final research peace. A system like this probably doesn’t have any place in a commercial title. What I am really hoping to achieve is a proof of concept. Can a single artificial intelligence system operate across a distributed player network? I’m not sure but stick around if you would like to see the results.

Up and running with Rails3 beta4

18th
6 / 2010

Like everyone else on the rails community I am very excited about the upcoming release of rails3. I had some free time yesterday so I decided it’s time to install rails 3. I had some headaches. I don’t know if it’s me being misinformed however I initially attempted to install rails three with Ruby 1.9.2. This was a disaster. Well not quite a disaster it wants however painful. Rails itself installed fine. The gems were configured I was just having some problems with the application generator.

I decided to cut my losses and go to Ruby 1.9.1. Again I ran into trouble. This time up problems came when I was attempting to save records into the database. This error is known to the community and I got the impression that it was the version of Ruby I was using.

In the end I decided to cut my losses and go back to Ruby 1.8.7. As Ruby 1.8.7 has proved time and time again its the version to go with. Everything is working now and I am currently using rails3.

If you’re using a Mac like I am I would recommend compiling a fresh version of Ruby from source. This way you don’t interfere with your previous Ruby installation. If you need to run multiple versions of Ruby I suggest you check out Ruby version manager.

I am very excited about a lot of the changes in rails three. Full credit to David and the team for acknowledging that there still is quite a hefty barrier of entry for new users. The bunder gem is a welcome addition. I think this will ease some of the pain for new users. Especially new users joining an existing rails project.  In addition there have been several refinements in the API. The routing API has been considerably refined and it’s a much cleaner interface.

I can’t wait to get moving. I got some work to do today but once I get that finished in going to start specing out my first rails3 application. WOO!

A new theme, a twitter client and a hush-hush project.

16th
6 / 2010

Today I uploaded a new theme to this blog.  This is the first time I have ever changed the look and the feel of this blog since its launch two years ago. It makes me happy. Change is as good as a holiday.  I have been working on the design the in the last day and a half. Nothing special. You might not even say it’s better than the last design however I can say that this is 100% my blog now. No one else on the Internet has a design like this. It was a bit sad going to other blogs and seeing the exact same design. Not any more. A pat on the back to wordpress as well. Despite the fact that it’s written in PHP it’s actually very easy to theme. Well done guys an excellent blogging platform.

There are some problems. The HTML does not validate completely however this is due to the plug-ins I am using. I noticed that all of the code causing breaking HTML validation is outputted by the various plug-ins I have installed. No bother the page seems to render okay. That said I have not tested in Internet Explorer yet.  I’m not sure about the links on the left hand side. The event model is not working correctly sometimes the links jut up and down. I might disable the JavaScript if it gets really annoying.

I have also added my latest twitter status to the page. I love twitter and use it constantly. It will be good to have my status there. At least something on this blog will get regularly updated :-) . My use of twitter has increased greatly over the last few months and I have noticed a distinct lack of any decent twitter client for Windows. That’s why very shortly I will be posting my own twitter client that quite frankly leaves all of the other twitter clients I have used on Windows in its wake. It doesn’t say much about existing social applications on Windows as it only took me two or three days to write.

With the new theme for my blog and a completed twitter client I can now focus on my dissertation. I will not have much time to post on this blog. I hopefully however will put my dissertation online and make it available for download. As many of the details are not finalised I will not go into them yet.  I can tell you I plan to build a web server that encapsulates an artificial intelligence algorithm to serve out artificial intelligence as a normal web server would serve documents. Hopefully that wets your appetite enough to come back to this space for updates in the future.

An update and a few recommendations.

9th
3 / 2010

Some of you may or may not know I have commenced my masters in London. I don’t have that much time for web development at the moment so posts here have been fairly sporadic. I can however update on what I have been doing for my masters. Firstly I’m doing my masters in computer game technology. I’m exploring many different game technologys and I want to share a few of them with you right now.

Box 2-D

Box 2-D is a fantastic physics library. I’ve been programming quite a lot using box 2-D and I really enjoy it. Box 2-D supports joints, bodies and the number of various other components that can be used to model real worlds. It’s written in C++ but there is also a port available in action script. There are a number of flash games that are using this port to various levels of success. The possibilities are endless and I am sure I can find a way to incorporate this library into some Web work or to use it to animate an interface that is not necessarily game orientated. Something I would have never considered before starting this course.

Simple fast multimedia library

The simple fast multimedia library is a tool for producing desktop games. It supports Linux, Macintosh OS X and Windows. It can produce both 2-D and 3-D games. It produces 3-D games by providing interfaces to OpenGL classes and methods. It produces 2-D games by providing classes that handle the displaying and updating of sprites.  It’s also got classes for sound and controller imports. There’s a handy integration project for Xcode so you can develop easily on Macintosh OS X if you choose to. I’m pretty sure the same exists for visual studio on Windows but I am not 100% sure. A welcome change as there is a lot of computer game engines that specifically run on Windows. Not that I would hold a grudge against any gamer who are solely interested in Windows. Let’s be honest there’s not a whole lot going on around Macintosh in the gaming industry.

Microsoft XNA

XNA is a platform developed by Microsoft. It supports both Windows games and Xbox games. It installs itself as an extension to visual studio. It’s completely free and anyone can download the express edition of visual studio as well as the Microsoft XNA installer. The really cool thing is that you don’t have to pay to start developing games. You are however limited to C# Microsoft’s proprietary implementation of Java. There is quite an extensive website for an and it’s very easy to publish to the Xbox live Arcade once you have finished developing a game. As is the custom with Microsoft, XNA almost in its own world ignoring other technologies and platforms out there. It uses exclusively Microsoft directX with no support for OpenGL. Again you can’t really begrudge Microsoft for wanting to support their own platform. It is however ironic when they say that XNA supports multiple platforms. Windows and the Xbox. Ironic.

There are so many other game technologies are available and so many other resources at the game developers disposal you feel spoilt for choice. Much like the Web there are different tools out there that are good at different things and it’s up to the developer to choose the appropriate tool for the job. I’m surprised because I thought more of the games industry was based around building up proprietary libraries and not really sharing a whole lot of code. Whilst the big players undoubtedly do this and so they should they have the budget to do so there is room for the Indy game developer. People in my position who want to get started in the industry but don’t have a lot or even any money to spend on licensing engines and technology. Whilst it’s hard to break into the gaming industry there are certainly plenty of tools around to help you do it. Really encouraging stuff.

First impressions of Django

19th
12 / 2009

For a long time now I have been a Ruby on Rails user. Then Django came along. Although there were other web frameworks out there it seemed like all of sudden Rails had a competitor. It’s strange to regard the two frameworks as competing with one another as they are different in their own respects however this competition is inevitable. It’s also futile. Both frameworks are written in different languages both have different features, paradigms and patterns. Comparison is crazy but as I said inevitable.

I wanted to create this blog post from a new Django user’s perspective. I’ve never worked with Django in any kind of significant way before and want to offer my thoughts and feelings. At this point it’s probably significant to mention that my Python experience is limited. I’ve never written code in Python outside using Django. So without further or do here are some things I liked about Django.

Built-in authorisation system

Django provides a built-in authorisation system. It’s part of the core. The system can be customised to any specific needs without having to couple it to your application. When ever I evaluate a new framework one of the first things I attempt to do is create a user login system. It’s a fundamental part of any public facing web application and represents my yardstick in evaluating new web frameworks. Because of this, I was positively excited to learn that Django has this functionality built in. The functionality was easy to implement and provided almost everything that I needed to get up and running.

Templates

Generally there are two schools of thought in encapsulating HTML output. The first is Rails that uses ruby code everywhere. Even in its views. The other approach is to have an independent template language. While both approaches have their good and bad sides I have to say that I really enjoyed the way Django implements its templates. It’s an easy system to use its sensible and flexible. I love how every file is .HTML file. This is great for designers. While most designers have a bit of an idea about HTML and are familiar with CSS it doesn’t go far beyond this. Designers also tend to use Dreamweaver which again doesn’t do very well beyond PHP and HTML. The syntax and markup is handy and it definitely insures you don’t accidentally encapsulate any logic in your views.

URL configurations

Rails implements a model view controller system. This is a fantastic way to Organise a Web application. It’s a proven pattern that works well and keeps things relatively loosely coupled.

Django takes things in a slightly different direction. Django implements models views and templates.While this can be considered as a model view controller pattern simply renamed Django offers a little more flexibility than rails does. Rails dictates that each controller has seven views. When creating a new controller in rails these methods are generated. As it is desirable to keep models fat and controllers skinny I have found myself a few times recently trying to “shoehorn” functionality into models.

It’s great to have a structured pattern in place however a number of times I felt the application I was attempting to design did not fit in with that structure.
Django circumvents this problem by allowing users to manually configure each individual URL. URLs are matched up via regular expressions and mapped to special methods in Django called views. This method seems flexible for two reasons. Firstly I write code only for URLs that I intend to use, secondly I can keep my application more loosely coupled for use later. I will explain exactly what I mean by this later in the post.

The startapp command

When creating a new Django application a relatively empty application skeleton is generated. This is in stark contrast to the rails default application. To start developing in Django additional commands need to be run. A Django site may consist of one or many applications. Applications in Django are internal mechanisms for decoupling functionality. An example: I may have a forum application next to a blog application which forms a news site. Applications are completely self standing including their own views and models.

Django tucks extra s functionality away in this way and allows users to import it using the fantastic name spacing system that Python utilises. This also ensures that your applications are loosely coupled. Because of the flexible URL configuration mechanism several applications can be incorporated into one project seamlessly. This includes the authorisation system I mentioned before in this Post. It’s simply a Django application. You import it. You map the URL is according to your site requirements and you’re done.

Fantastic documentation and source code

Django has amazing documentation. In fact it’s some of the best documentation I have ever read. It uses real-world examples to construct a site that almost any developer can relate to. It covers topics that are very relevant and is jampacked with code examples.

It’s clear documentation was one of the projects initial goals. It shines and makes it fantastic for new users such as myself to get started with Django. The source code is also highly readable. This is in part due to Python. Because I am directly importing Python packages and modules finding the relevant parts of source code is a cinch. I was also able to start posting tickets of issues that I found. I’ve never felt any reason to delve in to the rails source code primarily because I don’t know how it is organised. In Django it’s all totally obvious and I felt a number of times that I could extend core functionality in a way meaningful for my own requirements. This felt very empowering.

To sum up Django is a fantastic framework I enjoyed working with. I can see myself being a regular user in the future. With pre-existing functionality built in and an emphasis on writing less code I find I am writing reusable and readable Web applications. There is a learning curve that could be considered greater than Rails but the rewards are there if you stick it out. If you’re a Rails developer or God forbid a PHP or Java developer then you should definitely take some time to explore Django.

Feedback for the Feedback

27th
7 / 2009

Thanks to Jogger’s suggestions I have added a page to this blog. Its a selected list of sites I have worked on. Check out the my work section.

+1 to mod_rails

15th
6 / 2009

Today I finally updated to mod_rails. The install was easy. I was missing a few requirements however the install process told me in exact terms what I needed to do. After rerunning the install everything worked. The mod_rails install process seemed almost too easy.

For those not in the know mod_rails handles everything you need to bring your rails app to production. All you have to do now is plonk your app on a server set up the database. Mod_rails does the rest. Mod_rails also removes the need for a mongrel cluster thus reducing the amount of memory used by the server. Very handy for users such as my self running on small hosting slices. The configuration is also much easier. I reduced a 36 line configuration file down to 4 lines. The only regret I have about mod_rails is that it renders my post on setting up a mongrel cluster with proxy balancer useless. Mod_rails … it just works. That is all.

Check out mod_rails when you get a chance.