November 24th, 2008

OK, so I’ve been missing for 3+ months, sorry for the lack of posts.  I suspect there’s almost no-one reading this anyhow.  So far I’ve had 1500+ comments and only one I’ve found that I don’t think is spam – and it’s not on topic either.  As a result I’ve closed posting comments to only registered users.

So what have I been doing?  Well, I played around with the phone game and decided to auto generate a landscape/wilderness to play over.  I got basic terrain generation working using a Perlin noise method (fixed for only using integar maths).

Then I got sidetracked and ported a simple OpenGL game engine and game I have from linux/cygwin to windows native builds using visual studio.  That took a while of fighting the different compilers.  Then I took some time off programming and played some Neverwinter Nights seeing as I’d never finished it the first time around.  That’ll have to wait as I’ve not finished it still!

Then my wife had her semester break so I took some time off to hang out with her – we went and climbed an active volcanoe, swam in the hot and cold springs, did some horse riding in a Del Monte pineapple plantation (pineapples as far as the eye can see) as well as just some general hanging out at the beach.  So I had a really nice month of holiday!

Sadly after this my laptop hard drive started to make horrible clank-grrrr-clank noises and unsurprisingly wouldn’t boot let alone allow me to read anything off it.  I lost the source code to some test applications for my game library (newly ported to windows) and a whole bunch of other things.

More recently I spent a while checking out the iPhone SDK – I think I’m going to be doing some iPhone development as it’s a nice platform, ideal in many ways for gaming.  Also I’ve got an iPod touch so can play and test the games on there.

Lastly I decided to add hardware vertex buffer support to my GL engine (instead of just doing vertex arrays which are held in system memory rather than graphics memory).  To this end I decided to implement a COLLADA importer to get data in.  The reason for this is simple – I should be able to export COLLADA from most 3D artwork apps such as Max, Maya and the open source Blender.

Today I’ve taken the brave step of publishing (however quietly) my first executable version of the game.  Check out this page for more information on the game. It really is only in it’s elemental stages right now though.

Optimal code and Netbeans

August 2nd, 2008

So I coded up visibility for my game.  It turned out to be a pretty simple task. As I think my approach is slightly novel I’ve documented it for anyone interested, feel free to comment! Hopefully it’s pretty optimal.

The next thing on my list was some really basic AI, I got a creature to be able to follow me around, I added a simple item class and a weapon class and made it possible to fight. All of which works nicely up to the point of dying – a the moment you can just carry on!

I then worked on some interface for the phones so you could open your inventory. A small learning process but not particularly daunting. The major drawback I can see of my chosen target platform (midp 1.0) is that if you create a list menu with implicit selection there is no way to know when the selected item changes. Which means you can’t create ‘soft button’ menu’s that vary on say the item type in your inventory list, instead you have to create a submenu based on selection. No big deal and I think something fixed in midp 2.0. If someone does know how to do this, please let me know.

Finally I decided that I should refactor my code. Originally the whole thing was based around simply using the mipd TileLayers to specify what things are where. However I wanted all of my game code to be orthogonal to the underlying display SDK it was running on – who knows I might port it to an applet or a standard Java game some time. So I went about building a Level class that represented the game world. In the process of doing this I discovered some interesting things about writing Java. If you create an array in a class as follows

int array[] = { 1, 2, 3, 4, 5, 6, 7, .... };

then that uses up a lot of memory as it has to produce byte code to load each value into each array slot. Then when it’s running you also need the space for the array itself. So it turns out if you want to create a large grid with tile indexes for each element you’re much better off saving out a data file and loading it up when you need it. Especially in the case of the code produced by the Netbeans game designer which just uses this array to initialize a tile layer – once that’s done the original array if effectively finished with and could be removed from memory. So as far as I can see the code the Netbeans game designer produces is almost as bad as it possibly could be when thinking about targeting a mobile device with a small amount of available memory… way to go!

Also of course rather than ints, in my case we’d be better off with bytes or shorts if I end up drawing more than 255 tiles (the zero index is reserved for an empty tile).

I’m now thinking I’ll either

  1. write my own tool to draw tile layers (hmm perhaps integrate it with eclipse as at the moment I still prefer it over Netbeans).
  2. find another tool that’s a bit smarter.
  3. improve the Netbeans game designer.
  4. not worry about it as I’m planning on randomly generating most of my content.

At the moment I’m going with 4!

Next up I think I’m going to look at that random level design.

Sidetracked – upgrading wordpress

July 28th, 2008

Every time I log in to write a page as I did at the start of my lunch break today WordPress was asking me to update to a new version.  So I wondered what was improved in the latest shiny 2.6.  It turns out I can preview new themes without making them go live.  Great that’s a good excuse to upgrade so I thought I’d give it a go.  Apparently it’s as simple as a three step solution.

  1. backup
  2. copy over the new files and merge just one wp-config.php
  3. log in as admin and update the database.

Great, even I can do that.  So I downloaded the new installation here, played with the cPanel app at HostMonster until I was happy I’d a backup and then copied the new files over using Filezilla ftp from my windows box.  Then I merged up the configuration file, creating three new lines in my old one for new security using a website to generate random seeds.  All good – except then I couldn’t do step 3.  Fortunately my backups worked so I went back and tried again – nope.  So I got SSH access to my server, I needed to request it and the HostMonster help desk had enabled it within about 2 minutes after a quick e-mail.  Great!  I tried again, this time doing everything from the ssh log in as the process of unzipping and ftp-ing the php files appeared to have mangled line endings.  Still no luck.

Finally I read the more expanded instructions which make no mention of merging the wp-config.php file, instead just keeping your original.  As if by magic it works.  After some digging it turns out the automatic key generation had failed me and generated something that was messing everything up.  I generated new keys and added them for safety and now I’m on to the new WordPress 2.6.  Still sadly now there is no time for me to play with themes or write the blog I originally intended… bah!

First steps at mobile game

July 22nd, 2008

So over the weekend I spent a few hours working on my first ever mobile game. I installed NetBeans, the latest Java SDK and the Java Mobile SDK. Then I fired up NetBeansand started to follow the mobile development tutorial. Very quickly though I got bored of that and started to work on my own game.

For now I’m going to use the game designer application and draw up a simple town level which I can move around. To get things moving quickly I’m using the tiles that came with the sample game so I can’t actually distribute any of my versions until I rewrite it all.

I’m working on a roguelike game. At the moment everything is tiled based and the game doesn’t run in real time – instead it’s turn based. As I want to play it (and might be the only player) I’m making it so that the levels for the dungeon are autogenerated, infact the whole inspiration comes from Moria and later variants like Angband.

I might regret this later as I think it would be very cool to make the game run in real time so be much more like the Diablo series. If I did this then I’m sure the combat system would be inspired from that used by Bioware in KOTOR and Jade Empire. Here the game is effectively turn based however you input or queue up a series of commands for your protagonist to follow as combat unfolds.

So far I’ve found Netbeans to be an OK environment, although I miss the familiarity of Eclipse when writing Java. Also there is something wrong with the auto completion – when I ask it to tell me the arguments for a function call they’re always listed as “type arg0, type arg1, type arg2…” rather than showing me the argument names. Which is a bit annoying but I’m guessing a result of using a non-stable version of Netbeans.

So where have I got to with the game development? I’ve built a primitive map and can move my character around it, collide with walls/creatures and have my view port updated so the character is kept within the centre of the screen. Next up I’ve decided to tackle visibility – what can the character see. There’s some interesting articles on this on a site I found all about roguelike development called RogueBasin. There’s even a link to a java library that implements some of these functions – sadly it heavily uses generics for lists and generics don’t work on the mobile Java run times as far as I can tell. Also I want to optimize maths where possible to be integer based as I think that’s what the hardware supports and I want to minimize memory usage. This should be interesting as normally doing games I have control over what memory I’m using and how but not in the same way with Java! It will force me to think at the algorithm level much more than at the machine level.

Mobile games

July 19th, 2008

I’ve always been interested in mobile phone games. They make a great way to pass the time whilst stuck waiting for something with little else to do. A common occurrence here in the Philippines. So I decided that as a project I’d have a go at writing my own game for a mobile phone – for my own fun and education.

I recently bought a new mobile – A Nokia 3120 Classic which has a nice big screen. Sadly however it’s not a S60 device, only a S40. I have two options developing for this phone, I can write in Java or I can try my hand at embedded development. However I write C/C++ for a day job and as this is a personal project I feel the urge to try my hand at Java. Also it should work on pretty much any mobile phone that way too without a great deal of effort.

I’ve used Java from time to time. At university I taught myself Java by writing a snake game as an applet which I might try to dig out. Then my second year group project was also Java with a fair amount of JNI – a plugin system for a VR world their research department worked on which allowed you to edit your avatar. Also my third year project – which was a ‘rogue like’ game editor was in Java. Actually in my third year I ended up being a lab assistant for the first years as their teaching language had changed and not enough of the teaching staff knew Java. Then more recently I dabbled with the some bits and pieces in eclipse using the SWT.

The first thing to do is to choose an IDE. For the sake of education I’ve decided to try out net beans. I don’t know if this is a good idea as it’s something else new to learn but that is the point. I’m already familiar with Visual Studio for C/C++ and Eclipse for for both Java and C/C++. Now I’m going to try my hand at Netbeans. Besides they appear to have a nice easy to use integration for just what I want. Being adventurous I’ve decided to download the cutting edge version, 6.5M1 and we’ll see how it goes. I’m going to use this blog to keep a development diary of this project under the category Mobile Games.

Setting up the site

July 19th, 2008

So I’ve never actually owned a web site or domain before. Sure as a computer science student at the University of Nottingham I had a web page – we all did. However my page wasn’t the most inspiring of things. I was a first year back in ’96 when Netscape 4 was king of the browser and the web was a very different shape than today. So excuse me if I’m a little rusty!

I’ve been considering setting up this site for a long time. My first concern was finding a hosting service and also registering a domain name. I’ve been keeping my eye out on different hosting services and such and reading some reviews and in the end settled on wordpress blog and now I’m happily typing away with my second entry detailing it. So far everything has been as easy as following tutorials and clicking in the web site.

The PageWizard tool was an interesting experience – it’s really trying to be a web 2.0 tool allowing wysiwyg web page creation. I feel it’s a bit rough around the edges though to be honest. It took me a while to find out how to change the page title for example. Also sometimes it complains that my browser (firefox 3) can’t handle html text entry fields. Which is strange because it appears to work. Eventually I intent to had code my html but I wanted to get up and running quickly.

The only other thing that I’ve had any problems with is what would be a cool tool that is supposed to be provided that allows me to map a windows drive to my web space and browse it that way using windows explorer. I guess I’ll have a fiddle with that although it’s not so important – at some point I’ll try out the ftp and will probably publish my own, hand crafted html that way, if I ever get around to it!

So far so good, my experience with the Monster hosting service is a good one.

New challenges

July 19th, 2008

Welcome to my brand new blog.  So why have I setup this web site and blog? Well as the front page say’s I’m a freelance games programmer. This is a blog for covering news and my thoughts for all things computer/technology related in both my professional life as well as hobby ideas. I’ve set up this site for a number of reasons. If anyone reading this knows me I’ve also got a personal blog where I try to keep my friends and family informed and in touch – however I’m pretty poor at posting there and my facebook account is probably a better way!

Firstly I feel it would be appropriate to have a site to send to prospective clients so that they can get an idea about who I am. Secondly I want somewhere I can talk to the world in general about my strange ideas and pet projects. This was all catalyzed however by the very sad demise of Pivotal Games a place where I was originally working in house and then more recently have been contracting for. I’ve been working with Pivotal almost since the very beginning, I’ve worked on every title they produced and it’s very sad. I’m hoping that some kind of phoenix will be able to rise from the ashes – they’re a very hard working and talented team and deserve to continue on and produce more great games.

So why did I leave Pivotal and become a contractor. Simply my private life interfered – for the better! I found myself in love and married to a wonderful Filipina – Lea. She wasn’t so happy living in Bristol (UK) and missed her home. I personally found the lure of living in the beautiful Philippine islands very strong indeed and so out we came. Both Pivotal and I wanted out professional relationship to continue and so now here I am.