Rabid Lion Games


Well, a lot has happened in the week or so since I last posted.

I now have a fully functional Tile editor based on Winforms. I was concerned after learning a bit more about the integration between XNA and Winforms that it wasn’t going to be possible to create a comprehensive Editor for Alta using Winforms, as the only method I could see for running the game in the Editor was to hook an update method into the Application.Idle process, which seemed a bit of a hack to me.

A quick query on the XNA forums seemed to suggest that this was fine though, so I’m going to carry on heading in that direction.

James Silva’s book (http://www.amazon.co.uk/Building-XNA-2-0-Games-Professionals/dp/1430209798/ref=sr_1_2?ie=UTF8&s;=books&qid;=1279808646&sr;=8-2) arrived late last week, and I’ve been blasting through it ever since. I’m both impressed and dissappointed by this book.

On the one hand, the content covered include things that you just can’t find anywhere else, like a strategy for level editing, basic 2D terrain-type collision detection, a character/ animation editor, and (the most impressive in my opinion) scripting. Also the game created looks the part, and unlike any other game that I’ve created by following a book, I would actually be proud to sell it (had I come up with it myself obviously!).

So why am I disappointed? Two reasons. First, simply put, the editing is attrocious. Whilst the source code that you can download from the book’s website is all correct, the code in the book seems to be a hodge-podge of various itterations, with variable names changing within the same function, and a constant switching between C# properties and manual GetYourVariable and SetYourVariable methods. Its fairly clear that someone has started rewriting the code for the book (to make it more readable perhaps? see below) but hasn’t finished the job. This makes it very difficult to follow, and I was constantly flicking between the book and the online source code to see if I could tell what a function was supposed to do, and then make sure that it did it.

Which brings me to my other disappointment with the book: the code itself. Now I’m not the sort of programmer who lifts code wholesale from books/ tutorials and sticks it in my own projects without understanding what it does, but I do like to be able to look at the code I’m working with, and see what each part of it does, so that I can refer back to it if I ever need to do anything similar. With the code in this book, that simply isn’t possible. James admits himself that there are a lot of hacks in the code to get something working quickly, and that its not as neat as you would normally like. Unfortunatley this is a contender for the understatement of the year.

Because James uses spritesheets, his code is full of crazy little bits of code to determine the correct source rectangle to use for textures, which I can live with, if they’re a little annoying, but the placement of everything in the tools is hard coded (presumably figured out by a lot of trial and error on James’s part, and fairly complex functions are just copied in, with a single line in the text to explain what purpose they perform. I’m not looking for a line by line explanation, but if you are creating a (fairly good looking) full screen effect, I’d like to know exactly how it achieves it!


That’s probably an unfair assessment of James’s book, given that I’ve taken away a LOT of useful tips, tricks, and techniques from it. But that’s what I was looking for from the book. If anyone was looking at it with only a limited understanding of XNA then it would only serve to confuse them.

It probably should have a place in the learning path of a budding XNA developer, but I would put it after having cloned a few classic games in full to learn the ins and outs of XNA. Just my 2p…

Anyway, next up for me is creating the Tile map for PacMan, and then trying out some rapid development of the gameplay. The trickiest bit will be the AI, which I’ve never really had to deal with previously (the AI in pong left much to be desired!).

Until next time…

Leave a Reply

× five = 40

Proudly powered by WordPress. Theme developed with WordPress Theme Generator.
Copyright © Rabid Lion Games. All rights reserved.