Friday, 22 May 2009

r.g.r.d. Roundup #2

Another entry in the occasional series of some of the best recent threads from
  1. "Savefile Design" One of the best threads I've ever seen on r.g.r.d. this thread discusses in detail a subject that is both close to and swinging ominiously over my heart - save files. I'm not implemented them in Kharne yet because in Delphi, serialisation is an utter pain, and I'm saving the worst to last, as it were. I suspect that implementing saving and loading will result in no-small degree of refactoring, when the time comes.
  2. "On AI - ~The best systems". The AI in Kharne is currently very primitive. I had started writing a much more realistic AI for Prelude, but until I recover from the current Assignment Fever, I won't be doing any porting of ideas across into Kharne. For my money though, the best explained treatment of AI in a roguelike game is still the Angband 4th Generation AI.
  3. "SOL Pics". This new roguelike is already a contender for the most beautful looking ASCII roguelike ever, despite only a few screens being completed. I hope the rest of the game (when done) lives up to what we've seen so far.
Roguetemple has also been a hotbed of activity recently, and the recent mention of Quickband reminds me that I've never played it (at all). Might just be the thing to keep me sane during the next few weeks.

Monday, 18 May 2009

0.02c delayed...

I've been snowed under with Minkowski Diagrams for the last week and will continue to be so for the next couple of weeks. Work on getting 0.02c with the changes in ranged combat included will resume after that...

Monday, 11 May 2009

Hello World Libtcod.NET Style

After quite a bit of unanticipated kerfuffle,I finally got the demo project to compile and run:

Its a start. :-)

Friday, 8 May 2009


Verity Stob on the proposed new C++ standard.

Tuesday, 5 May 2009

Amarok help requested

I now do my development of Kharne almost exclusively on my new laptop, which as I've mentioned before is now dual-boot with Vista and Ubuntu 9.04. I'm very happy with Ubuntu, especially the ability to play Crawl online) apart from two main factors: I cannot get the iPlayer to work and Amarok doesn't work (it opens and seems to play the file, but no sound comes out; incidentally the default media player does indeed work, but the sound output from it isn't very good).

I installed and had a quick play around with Lazarus - it looks very familiar and very easy to use. I may end up taking the advice of Mario in the comments and move to Lazarus full time.

In other news, this book is making me nostaglic for my late-last-century days of writing code in C/C++ on Unix.

Monday, 4 May 2009

Refactoring Madness

I know what Krice is going through...some days it seems like most of the code I've written is utter garbage. Its not as bad as that, and it won't need doing what Netscape famously did (with disasterous results), but I do sometimes wonder, late at night/in the wee small hours/during the long dark tea time of the soul, what I was smoking when I wrote a particular chunk of code...

The main problems I've got with a lot of my current code are what Joel Spolsky refers to in the article above as "architectural problems":
First, there are architectural problems. The code is not factored correctly. The networking code is popping up its own dialog boxes from the middle of nowhere; this should have been handled in the UI code. These problems can be solved, one at a time, by carefully moving code, refactoring, changing interfaces. They can be done by one programmer working carefully and checking in his changes all at once, so that nobody else is disrupted
I'll give you an example of something that was a pain in the arse to fix but when fixed has really added value to the code. Previously (before 0.02b), the function to output text to the message log at the bottom of the screen took two parameters as input:
  • the text to add (as a string)
  • the colour to display it in (as a TColor).
As I'm only human, the natural result of this was that the colours were inconsistently used - a message in one section of the code for would be a different colour to a message resulting from another section of the code even though both messages were used for the same purpose.

Of course, with hindsight, the correct way to handle this is obvious - now, instead of a colour, a message type is passed in, which happens to be a enumerated TColor type, e.g. all messages that refer to killing enemies now are passed in with the second parameter of 'mesPlayerKill' which evaulates to the colour Orange.

Simple, yet the correct solution eluded me the first time.

Now imagine this multiplied by a factor of 50 and this is the task ahead of me (and most other roguelike developers it seems)

Are we masochists or perfectionists? You choose.

Sunday, 3 May 2009

Kharne 0.02b available

v0.02b is now downloadable, following the maxim of 'release early and release often'. The full changes in this version are as follows:
  • Combat/Defense and Subterfuge Skills have been implemented.
  • The nutritional value of food has been quadrupled.
  • You can no longer removed cursed items by swapping uncursed items into their slot.
  • The display font has been changed to a standard system font (Courier).
  • Message Colours have been changed and standardised.
  • A welcome message is now displayed when you first start the game.
  • A Low Hit Point Warning has been added.
  • You can now only target hostile creatures with ranged weapons.
  • Projectiles have been fully animated.
  • Fountains can now be found in all dungeons apart from the Elemental Planes. They can have both beneficial and harmful effects.
  • Whilst the Wizard screen is displayed, death is optional.
No proper ranged combat just yet. Its a heck of a lot of work, and the next release will probably just contain its implementation. The refactoring necessary for it will also make implementing spells and targeting thereof much more easier as well.

Friday, 1 May 2009


After much faffing about trying to remember the procedure for reinstalling components into a fresh copy of Delphi, I've got Kharne up and running on the Vista side of things.

Here is a screenie of the Plane of Fire Dungeon:

Our brave hero is in considerable trouble, being attacked in melee by a Fire Elemental and from distance by a Fire Drake. I think currently, without potions and magic being implemented, the game is much too tough. But we'll see.

One thing I would like to add soon is more features to the dungeons, e.g. the plane of Fire should have molten lakes of lava, rivers of fire, and all sorts of features.