Monday, 30 November 2009

More on stairs and monsters

I think that, further to the comments on my last post, I won't bother, for now, allowing monsters to follow the character up and down stairs.

Thursday, 26 November 2009

Hiatus

As you'll probably have noticed, posting is light at the moment. I've decided to take a break for a few weeks from development.

Wednesday, 11 November 2009

Stairs and Monsters

I'm currently writing some code to allow monsters to travel the stairs with the character, following the behaviour of those in Crawl.

As implemented, all adjacent monsters will travel with the character, as long as there is room on the destination level for them to do so.

However, I'm nearly sure that (from last time I looked at their source) Crawl puts a limit on the monster types that can come up stairs.

Do you think this is a better solution? And if so, what criteria should be used to determine ability to travel up stairs? (I don't have any Dalek monsters alas)

Monday, 26 October 2009

More on achivements

Unlike the achievements in MMOs, I want them to be a bit more than just fun, and affect gameplay.

For example, let's say there is an achievement that can be obtained by killing 10 vampires. Let's call it "Wannabe Van Helsing" (as suggested by my muse - I think I prefer slightly humourous titles).

I'd like to give characters who complete this a tangible game benefit. For example, a small (but significant) damage bonus against vampires. Or slightly increased resistance to vampiric drain attacks.

Or for an achivement for eating every single different type of food ("I'm not fat, I'm just big-boned") which allows 10% extra nutrition from food.

I'm going to throw open the comments for suggestions for possible achivements If your suggestion is taken and used, you'll get game credit! The titles should be somewhat humourous, and referencing either common fantasty-tropes or the roguelike milieu where possible.

Tuesday, 20 October 2009

Ahem...

That's me told off...both DoomRL and Lambdarogue have achievement systems.

I've also been thinking about a couple of minor other features: stairs, and player ghosts. Adjacent monsters should be able to climb stairs with the character, and ghosts should retain a proportion of the gold and an item or two as reward for the character killing them.

And I should really play some of the roguelikes I mentioned here.

Saturday, 17 October 2009

Achivements & Reputation

Some day (cue wistful music and sepia tones), I'd like to implement an achievement system, like you find in MMORPGs:


I'm actually quite surprised that there aren't any, as far as I know, roguelikes with an achievement system. Though you could argue that the game score is a measure of achievement in itself.

Further to that, I'd like to implement factions & reputation (with faction quartermasters):

Of course, you could argue that the deities in Crawl are effectively factions.

Friday, 16 October 2009

Roguelikes I have never played....

1. DOOMRL

2. Incursion

3. Nethack


No, seriously, I have never actually played the above three roguelikes.

Wednesday, 14 October 2009

Scrolls and Potions oh my

Now that the first tranche of scrolls have been implemented, and my exams are finally over for the year, the next thing to add to the game are potions. Potions are slightly more complicated to implement than scrolls, given that scrolls are one-off effects and potions have effects over time. A while back, I listed the various types of potions I'd like to implement, but as with scrolls, I'll probably only implement a subset of these at first, and add more in later. I will release 0.0.5c when I have potions implemented.

Tuesday, 13 October 2009

Configuring and compiling Kharne - a brief guide

(this is a copy of CODING.TXT which is found in the source code distribution. I will also add a permalink to this post for reference purposes)

Contents:
  1. Introduction
  2. Required 3rd Party Components
  3. Licensing Notes
  4. Other Notes
  5. Contact Details
1. Introduction

Welcome to Kharne. Kharne is a standard Delphi Windows application that uses a certain number of third-party controls and libraries for additional functionality above and beyond that provided in Delphi.

I have developed Kharne using Delphi 7, but provided the external controls can be installed, it should be compilable in any version of Delphi newer than 5.

2. Required 3rd Party Components

Due to licensing terms, I can't provide these components or distribute their source with my own distribution.

You will need to download and install the following before you open the source in Delphi for the first time:

a. TGradLabel
http://www.delphi32.com/vcl/929/#

It is my intention to phase the use of this component out entirely.

b. TAStarPathPlanneer
http://www.riversoftavg.com/tastarpathplanner.htm

c. TQProgressBat
http://mapage.noos.fr/qnno/pages/delphi_en.htm#TQProgressBar

d. TSQLLite
http://www.itwriting.com/blog/a-simple-delphi-wrapper-for-sqlite-3

You may need to add the path of this component to the Project Search Paths.

e. THotLog
http://mapage.noos.fr/qnno/pages/delphi_en.htm#hotLog

This isn't a component as such, simply copy hotlog.pas into the source directoy and make sure it is added to the project.

f. TKeyboardHandler

As this is no longer available *anywhere* on the web, I've included the source in the components subdirectory. Longer term I want to phase use of this component out and duplicate its functionality,

g. sqlite3.dll

This is the SQLLite interface library, is public domain and thus is included with this source distribution.

If any of these components become unavailable, contact me (starbog@gmail.com) and I will send them to you direct (I will only do this under these circumstances). I will then try and remove any dependency upon them from the next version.


3. Licensing Notes

I have released Kharne under the MPL as opposed to the GPL because I'm not convinced that the latter allows a Delphi program to link with components that are not GPL themselves.

I've had a reply direct from the FSF telling me that it does provided I add an additional disclaimer to the GPL License that gives explicit permission. However, as I'm not convinced about this (the GPL itself is quite fuzzy in this regard), I'm releasing Kharne under the MPL to avoid any doubt.

However, just to clear things up, I'm am granting an irrevocable right to link my code released under the MPL to any other custom component, library or API no matter what the license.

The source code file UnitOtherFuncs uses a few small routines freely available on the web - I have indicated carefully what these are in the source and their origins, and this file is obviously not released under the MPL.

The distribution also includes a copy of the Bitstream Vera Sans Mono Font (veramono.ttf) which can be freely distributed and is in the public domain. If you are doing development, please copy this and install it in the usual way before opening the source code.

4. Other Notes

I have no idea if Kharne will compile with Lazarus, I suspect the custom components may prove to be an unsurmountable obstacle, but anyone is welcome to try porting if they wish. I'd like Kharne to run multiplatform without using WINE, but that may have to wait until cross-compiling for Delphi becomes a reality (it has been promised for the version due out in 2010.)


5. Contact Details

I can be emailed direct at starbog@gmail.com or reached via the blog at kharne-rl.blogspot.com. Or you can reach me on #rgrd regularily where I am known as "starbog".

Monday, 12 October 2009

Kharne 0.0.5b now available

Kharne Alpha 0.0.5b is now available (source code is available as a ZIP as well as from the SVN).

The big change in this version is the addition of Scrolls (press r to read them). There are currently nine different types of scrolls available, there will be many more added over forthcoming releases.

The full list of changes is:
  • Scrolls have been implemented.
  • Scrolls and potions are no longer PseudoIDed.
  • Hunger is now increased by wearing magical items.
  • Fixed a bug with cursed fountains not causing the character to hunger correctly when drinking from them.

Sunday, 11 October 2009

Automatic notifications of commits

Does anyone know of a way to automatically post a message to a blog with summary details of a commit that's been made to a Googlecode SVN? (but not the email that's generated with all the changes)

Saturday, 10 October 2009

More frequent releases or not?

Should there be more frequent releases of Kharne? (perhaps weekly?) Or should releases be restricted to when major new functionality is available?

Obviously anyone can download the most recent code and build it, but for those who can't or won't, what do you want?

Friday, 9 October 2009

Scrolls

I've implemented scrolls:


They basically work like they do in most other roguelikes.

I've implemented the following types to begin with:
  • Enchant Armour - enchants a random piece of worn armour with greater AC.
  • Enchant Weapon - enchants a randon wielded item with either greater +hit or extra damage.
  • Remove Curse - removes curses from carried and wielded/worn items.
  • Teleportation - instantly teleports to another point on the level (as in the screenshot).
  • Identify - identifies all carried items.
  • Magic Mapping - gives knowledge of the current level.
  • Forgetfulness - the opposite of Magic Mapping; takes away knowledge of the current level.
  • Blank Piece of Paper - the old favourite!
  • Cursing - curses a random worn/wielded item.
The enchant and identify scrolls I'll change at a later date to target only one item as they're currently much too powerful; and its also currently possible to get a magic item for free by cursing and then uncursing a common-quality item.

I've uploaded the changes to the repository.

Thursday, 8 October 2009

Progress Report#18

Sorry for the lack of progress recently. I'm spending over 3 hours a day revising for forthcoming exams and that combined with a full time job, significant other AND two cats means I get little time for coding at the moment. I managed to do a couple of small changes but the next thing on the agenda is scrolls and potions, and those will be quite hefty to implement. And as such, I need to get these exams out of the way first. before I really start them/ After that, normal service will be resumed of course.


Sunday, 4 October 2009

Saturday, 3 October 2009

Kharne 0.0.5a now available

Kharne Alpha 0.0.5a is now available (source code is here).

Changes are:
  • Fixed a bug that caused text in the character creation screens to be cut short.
  • Fixed an error that occurred when loading one of the sample characters.
  • Logging can now be switched on with the "/log" command line parameter. The default value is off.
The source code distribution also includes the fixes mentioned in my previous post.

I've also managed to set up a local subversion repository which I'll be hopefully shortly exporting to googlecode.

Source Code Issues #1

dunkel^ on #rgrd has discovered a couple of gotchas with the current source code distribution that prevent compilation.

In the uses clause in the interface section of UnitDisplay.pas (line #33) I left an errant reference to a component I no longer use. If you remove BtChkBox from this clause, it solves this problem.

The new uses clause should look like this:

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, KeyboardHandler, DateUtils, jpeg, ImgList, Menus, ComCtrls, ToolWin, Gradlabl, PathPlanner, QProgBar, AppEvnts, hotlog, UnitDungeon, UnitDefines, UnitConst, UnitVars, UnitFunctions, UnitItem, UnitCreature, UnitMonster, UnitInit, UnitGame;

Also, the logging component, THotLog seems to be unreliable and AVs a lot. To disable it for now, just comment out the hLog.StartLogging call in the TFormSplash.FormCreate method in UnitSplash.pas (line #66):

{ Form Create }
procedure TFormSplash.FormCreate(Sender: TObject);
begin
{ Set up Logging }
hLog.hlWriter.hlFileDef.append := False;

{ Start Logging }
//hLog.StartLogging;

{ log System Information}
hLog.add('{OSVI}');
hLog.add('{CPUI}');
hLog.add('{mem}');

With these changes, Kharne was able to be compiled and ran successfully.

Friday, 2 October 2009

Now what?

Now that the source code is out, what's next?

For my own part, there are still a few things in the code that I feel need tidying up. The code for creating, placing and dropping items, for example, really needs to be refactored further as it is duplicated in about a dozen places in the code.

Then I need to blitz the googlecode documentation and learn how to use that, to set up the repository.

After that, its time to look at what new features I'd like to implement.

The old roadmap was quite specific about what functionality would go into (then) future releases:
  • Character Milestones
  • Potions/Scrolls
  • Multiple Items on a Title
  • Timer Handling
  • Corpses
  • Magic & Spellcasting.
  • Saving/Loading
  • Ranged Combat
  • Damage Brands
  • Interface/Control Upgrade
  • Mutations & Corruption
  • Town NPCs
  • Victory Conditions
  • Traps
I've bolded the items that are currently fully or partially implemented.

But this still leaves quite a lot. I feel the next release should work towards new functionality, and the ideal candidates are, as I've been hinting at for some time, potions/scrolls and ranged combat.

But, of course, one of the joys of open source is that anyone can help, so if there is anything you'd like to see in Kharne, and you know Delphi/Pascal, and you can understand my extant code, just download the source, install it and start coding!

Thursday, 1 October 2009

Kharne 0.05 and source code released!

Kharne Alpha v0.05 is now available, and has been released as open source under the MPL v1.1

This version is functionally identical to v0.04a.

The source code is available here or via the downloads menu.

Please read CODING.TXT in the docs subdirectory before attempting to load the Kharne project into Delphi.

If you have any questions, or difficulty getting the source to compile, feel free to leave a comment here or email me on starbog@gmail.com.

Refactoring Completed

Its the 1st of October, and suitably, the great code refactor of 2009 has finally been completed.

As soon as I write a guide for obtaining and installing the various 3rd-party libraries, APIs and custom VCL components that Kharne uses, I will release a source code distribution under the Mozilla Public License (MPL).

Shortly after that, I hope to set up the source code repository on GoogleCode.

Wednesday, 30 September 2009

Memories

As part of the refactoring process I came across a random executable dated mid 2007 and found it was a prototype I had written back before the rewrite became public knowledge.


It doesn't actually do anything other than display this screen, but it does illustrate that, back in that day, I was obviously still wedded to the "moar windows!" paradigm. Now, on the other hand, I'm frantically trying to emulate an X-term using a RAD Application Tool.

Oh the irony!

Tuesday, 29 September 2009

Refactoring Progress #5

The refactoring is almost complete:

I've just spent about five hours in total dealing with bugs I introduced into the TDungeon level generation code while refactoring, which was mainly due to doing the refactoring offline, i.e. not within an environment where the code could compile. It has been a useful exercise, as well as removing any code that I'd be ashamed of releasing (now there's just a lot of code left that I merely dislike), I've reaquainted myself with a lot of code that has been written for quite a while now and which I had forgotten the purpose of. The code also conforms a lot more to coding standards.

The only major source code left to refactor is UnitDisplay.pas which, as the name suggests, is, contains the code that interfaces with the screen and the GUI-handling code. Its about 4000 lines of code. I'm on target to finish the refactor within the week or so.

Its a messy unit, full of code like this:
Procedure TFormDisplay.ListViewMonstersCompare(Sender: TObject; Item1,
Item2: TListItem; Data: Integer; var Compare: Integer);
begin
if ListViewMonsters.Items.Count = 0 then Compare := 0
else
begin
if (StrToInt(Item1.SubItems[6])) > (StrToInt(Item1.SubItems[6])) then Compare := 1
else if (StrToInt(Item1.SubItems[6])) = (StrToInt(Item1.SubItems[6])) then Compare := 0
else Compare := -1;
end;
end;
I'm not coding C, so there's no virtue in conciseness. The refactor turns that code into this (note that some of the indenting may not display properly, but the final code is indented properly):
{ Sort Routine to sort entries in the Visible Monsters display - compares two
TListItems and returns a comparison based upon TMonster.Level }

Procedure
TFormDisplay.ListViewMonstersCompare(Sender: TObject; Item1,

Item2: TListItem; Data: Integer; var Compare: Integer);
var
FirstItemLevel: Integer;
SecondItemLevel: Integer;

begin

{ Logging }
hLog.Add('{now} {lNum} TFormDisplay.ListViewMonstersCompare()');

{ Default result which is that both items are equal}
Result := 0;

try
{ Make sure there are items to compare }
if ListViewMonsters.Items.Count > 0 then
begin
{ Get the monster levels from the Listview Items }
FirstItemLevel := StrToIntDef(Item1.SubItems[MONSTER_LEVEL], 0);
SecondItemLevel := StrToIntDef(Item2.SubItems[MONSTER_LEVEL], 0);

{ Compare the Monster Levels of each items }

{ First > Second }
if FirstItemLevel > SecondItemLevel then
Compare := 1

{ First <>
else if FirstItemLevel < style="font-weight: bold; color: rgb(0, 0, 102);">) then
Compare := -1;

end;
except
{ in case of error, log the Exception }
on
E: Exception do hLog.AddException(E);
end;
end;
After I finish that unit, I'll have to put together the instructions for downloading and installing the various 3rd party components that I use, and then technically I'll have a source code distribution ready for when I release Kharne under the MPL.

Monday, 28 September 2009

Kharne 0.0.4a available

After a few issues were pointed out with 0.0.4 I've decided to release a new version, 0.0.4a (836K zip file, link is also on the usual place on the right-hand side) to address them. Changes are as follows:
  • Blocked repetitive keypressing whilst in character creation to avoid selecting multiple options with the same keypress.
  • The various character creation steps can now be undone.
  • Pressing [CTRL] on the background tab in character creation will now generate a random background.
  • Half-Orcs are now Orcs everywhere in the game.
  • Character Dumps should no longer report dwarven characters as halfings.
  • Character files which belong to characters who have died are now moved to the morgue subdirectory.
  • Upon death, a copy of the character dump is written to to the morgue subdirectory.
  • Common items can now be pseudo-ided.
  • Fixed a minor spacing error in automatically generated backgrounds.
Note that one of the changes here is when a character dies, the character file is moved to the morgue directory and flagged as a dead character. This is in preparation for implemention of saving and loading. Character files are currently not scrambled or encoded, so if you want to undeadify your character file, load it into a text editor and change the first line from "Dead" to "Alive". ;-)

Sunday, 27 September 2009

Kharne 0.0.4 available

"Release early, release often" as a wise man once said.

Kharne 0.0.4 is now available here, or via the link on the right-hand size. This is not the version with lots of promised yummy new features such as scrolls/potions magic and so on (I'm getting tired of saying that, but that version will come soon, I promise).

(Update@3.08 PM GMT: I've fixed the bug that would mean characters started with millions of MP, and I've reduced the amount of logging that takes place. I've replaced the old version of the distribution with this updated version)

Here is what is included:
  • Character Creation functionality has now been incorporated into the main window and no longer uses an external DLL.
  • The inventory screen has been redesigned.
  • Multidrop functionality via the keyboard has been implemented (press 'd').
  • Eating functionality via the keyboard has been implemented (press 'e')
  • Added PseudoIDing of items held in the inventory for a certain amount of time.
  • Added key summaries to the bottom of each subscreen.
  • Monsters have had their hit points and damage increased.
  • The application should now exit correctly and not hang around in memory.
  • Upon levelling, two appropriate skill categeories for each class are now increased by 1.
  • The chance of cursed items appearing has been more than doubled.
  • Added an item view to display detailed item information from the inventory.
  • Characters that do not know any magic can no longer access the spell screen.
  • The character dump now displays the monster kills for the character.
  • Monsters that have special plurals should now be referred to correctly in the plural form.
  • Fixed a few minor spelling mistakes in the character dump and a few layout mistakes on the high-score screen.
  • Female characters should no longer be referred to as "he" in the character dump.
  • When digging a reminder is now displayed of the keys used.
  • Drinking from fountains now uses a turn up.
  • Monsters in zones are now scaled more appropriately.
  • Not wearing any armour at all will significantly increase the rate at which the defense skill is learned.
  • The character 'back' slot which was never used in game has been removed.
  • Sneak attacks are now flagged in the message log.
  • Thieves now get extra sneak-attack damage when using ranged weapons.
  • The thievery skill now grants a chance to open and close doors without allowing monsters to react.
  • Monsters that are carrying items no longer have their items disappear on death when killed in ranged combat.
  • The change in 0.03 to not display messages upon opening and closing doors has been reversed.
  • Trying to open or close doors when there are no doors in range will produce an appropriate message in the message log.
  • Opening doors as part of movement will now cause a turn to pass.
  • Tunnelling now takes only half as long.
  • Tunnelling now displays a message indicating if it has been aborted due to nearby monsters.
  • Attempting to tunnel through impassable walls now doesn't use up any time.
  • Trying to dig on the town level results in a warning message.
  • Walking into walls now uses up a turn.
  • The rate at which subterfuge skills are learned has been dramatically increased.
  • The rate at which ranged combat skill is learned has been dramatically increased.
  • Trying to pick up an item with a full inventory no longer gives the message that an item has been successfully picked up.
  • The message log now reports that Undead monsters are 'destroyed'and Outsider creatures are 'banished' instead of 'killed'.
  • Identified items that are cursed now have 'Cursed' as an integral part of their name, e.g. they are called "A Cursed Longbow [-1,-1]" instead of "A Longbow [1, -1] (Cursed)".
  • Unidentified artifacts have now the correct prefix in their name.
  • Fixed a bug where an error would occur when trying to write a Hiscore to the HiScore table if the table was empty.
  • Special terrain tiles are now described correctly inside an elemental invasion zone.

Saturday, 26 September 2009

Stashes

Over at #rgrd the topic of stashes came up, and a couple of suggestions were made* to, within the frame work of persistent or semi-persistent dungeons, reduce the backtracking and hoovering that they can introduce:
  • The stashes themselves are unreliable and items in them slowly dissappear from them over time.
  • The stashes are rented and cost money.
  • The stashes attract extra monsters keyed to their contents.
  • Some monsters can raid stashes and take some items from them
Thoughts?#

P.S. part of the reason I suck at playing roguelikes so much is that I never use stashes.

* Thanks to tametick, kaw_, jmr and fs| for their thoughts on the subject - a most illuminating debate.

Item Descriptions

Item Descriptions in Kharne are pretty boring currently.

For example:

An Iron Hand Axe [+0, +0]

Location: Wielded
Type: 1-handed Weapon
Weight: 10 lbs
Slot: Main Hand
Damage: 1d6+0


How about this for an alternative description?

An Iron Hand Axe [+0, +0]

This is a large metal-headed axe designed to either chop down trees or chop down your enemies with equal gusto. It is made out of iron and is inscribed with the initials "E.M.". It is of average quality, and is slightly dented.

It weighs 10 lbs and is designed to be held in your main hand. You are currently wielding it. It does 1d6 damage normally.

Or for a magical version:

An Iron Hand Axe [+3, +5] of the Torrents

This is a large metal-headed axe designed to either chop down trees or chop down your enemies with equal gusto. It is made out of iron, covered in orcish runes and plated with mithril. It is well made.

It weighs 10 lbs and is designed to be held in your main hand. You are currently wielding it. It does 1d6 damage normally.

This item has been enchanted. It increases your chance to hit (+3). It does extra damage (+5). It increases your resistance to Water Magic (+18)

Friday, 25 September 2009

Another new version soon

I think I'll release a new version this upcoming weekend, which I'll designate 0.0.4. It won't be the promised open-sourced potions/scrolls/ranged combat/magic/corpses version, but it will have the interface changes (multidrop etc), the in-built character creation and a lot of other smaller changes. There's also been a lot of tidyup of the interface and game text. Things are starting to fall into place.

When I do release it, I'll probably de-link the older versions from the right-hand side, but keep them available on the webpage for...some reason, I guess.

Update. Here's the current feature list for 0.0.4:
  • Character Creation functionality has now been incorporated into the main window and no longer uses an external DLL.
  • The inventory screen has been redesigned.
  • Multidrop functionality via the keyboard has been implemented (press 'd').
  • Eating functionality via the keyboard has been implemented (press 'e')
  • Added PseudoIDing of items held in the inventory for a certain amount of time.
  • Added key summaries to the bottom of each subscreen.
  • Monsters have had their hit points and damage increased.
  • Upon levelling, two appropriate skill categeories for each class are now increased by 1.
  • The chance of cursed items appearing has been more than doubled.
  • Added an item view to display detailed item information from the inventory.
  • Characters that do not know any magic can no longer access the spell screen.
  • The character dump now displays the monster kills for the character.
  • Monsters that have special plurals should now be referred to correctly in the plural form.
  • Fixed a few minor spelling mistakes in the character dump and a few layout mistakes on the high-score screen.
  • Female characters should no longer be referred to as "he" in the character dump.
  • When digging a reminder is now displayed of the keys used.
  • Drinking from fountains now uses a turn up.
  • Monsters in zones are now scaled more appropriately.
  • The character 'back' slot which was never used in game has been removed.
  • Sneak attacks are now flagged in the message log.
  • Thieves now get extra sneak-attack damage when using ranged weapons.
  • The thievery skill now grants a chance to open and close doors without allowing monsters to react.
  • Monsters that are carrying items no longer have their items disappear on death when killed in ranged combat.
  • The change in 0.03 to not display messages upon opening and closing doors has been reversed.
  • Trying to open or close doors when there are no doors in range will produce an appropriate message in the message log.
  • Opening doors as part of movement will now cause a turn to pass.
  • Tunnelling now takes only half as long.
  • Tunnelling now displays a message indicating if it has been aborted due to nearby monsters.
  • Attempting to tunnel through impassable walls now doesn't use up any time.
  • Trying to dig on the town level results in a warning message.
  • Walking into walls now uses up a turn.
  • Trying to pick up an item with a full inventory no longer gives the message that an item has been successfully picked up.
  • The message log now reports that Undead monsters are 'destroyed'and Outsider creatures are 'banished' instead of 'killed'.
  • Identified items that are cursed now have 'Cursed' as an integral part of their name, e.g. they are called "A Cursed Longbow [-1,-1]" instead of "A Longbow [1, -1] (Cursed)".
  • Unidentified artifacts have now the correct prefix in their name.
  • Fixed a bug where an error would occur when trying to write a Hiscore to the HiScore table if the table was empty.
  • Special terrain tiles are now described correctly inside an elemental invasion zone.

Necrophilia revisited

I really like the ideas suggested in my previous post about corpses. Thank you all for responding, I've decided to go with your ideas!

So....how about this for corpse-handling:
  • Corpses are always dropped where possible unless the body was hacked up beyond repair or use (but for non-corporeal beings they may not be corpses per se, but rather 'essence of blah')
  • Corpses aren't permanent but decay after a while.
  • Corpses do not provide any intrinsic nutrition (or at the most, a very small value) upon eating (perhaps even the opposite - corpses make you hungry?).
  • Eating corpses provides a temporary intrinsic thematic boost to something, e.g. a stat, a resistance, a skill etc (for example, eating the, er, flesh of a fire elemental grants a temporary boost to fire resistance).
  • Carrying a corpse belonging to a creature will grant living creatures of that type a small bonus to attack and damage ("hey, you killed my friend and you're carrying him about with you!")
I'd like the use of corpses to be a 2-edged sword somewhat, unlike Crawl, for example, where apart from the (now easily identified) poisoned corpses, and the risk of mutation, they are pretty much benefical, nay essential (unlike Crawl, I intend to be a bit more generous with standard food though)

Thoughts?

Thursday, 24 September 2009

Monster Kills

I've added monster kill totals to the character dump:
-------------
Defeated Foes
-------------

7 Giant Rats
1 Xvart
6 Giant Ants
5 Giant Bees
7 Giant Scorpions
5 Giant Bats
3 Initiate Rune Hunters
4 Snakes
5 Greedy Adventurers
3 Griffons
2 Jackals
1 Large Snake

Total: 49 creatures defeated

Progress Report #17

Time for a progress update, I think. I've been pleased with the amount of work I've been able to do on Kharne recently, even though I should be studying. It has almost got to the point where I'm running out of things to do before I have to bite the bullet and start implementing potions, scrolls and spells.

I've implemented a form of Pseudo-ID. After a certain number of turns carried in the inventory, an unidentified magical item will pseudo-ID itself as such:


In the inventory, pseudo-IDed items will be marked with their quality:


Currently, the time it takes to Pseudo-ID an item is dependent only upon the quality. But there are many other factors that could influence the time it takes for Pseudo-ID to kick in. If you drop the item, the Pseudo-ID 'counter' resets and all progress towards Pseudo-ID is lost.

Of course, wielding/wearing them will still immediately identify it:


I've also extended the keyboard/inventory revamp to eating:

Pressing 'e' will bring up the inventory screen with edible items highlighted. Pressing the associated letter for an item will eat it, just like if you drag the item to the eat icon.

I think I will release the next version soon, even without the scrolls, potions and magic, or the refactor being completed. I just have to finish the keyboard revamp of the magic screen and I'll get 0.04 out the door for you good folks!








Wednesday, 23 September 2009

Inventory Revamp

Although I have my exams coming up, I've hit an unusually productive streak of coding - I'm in the process of revamping the inventory completely to follow conventional roguelike standards and to enable full control via the keyboard as well as the mouse.

This is the new design at a glance:

Pressing the key associated with the inventory slot now displays a detailed description of the item (the same information as was presented previously via the mouseover):

I've also implemented multidrop (accesible by pressing d):

Here I selected three items to drop by pressing their associated keys. Pressing ENTER then drops all the items:
I'm also going to implement similar type of funationality for eating food ('e'), reading scrolls ('r') and drinking potions ('q'), as well as for wearing and removing jewellery, weapons and armour.

If you like mouse control, you'll be glad to know I've left in the current method for dragging-and-dropping items.

Tuesday, 22 September 2009

Character Creation Changes

I've revamped the character creation, simplified it and have finally incorporated it into the main window, thus many of the problems caused by the DLL should no longer occur.

I'll run through the new character creation briefly here.

Upon selecting the option to create a new character from the main menu, as before, the first thing to be done is entering the character's name. There is still an option for a random name:

The next step is to select gender:

Then racr:

And then class:

Currently the final screen is background:

I've decide to remove, for the time being, what was previously the 'full' character creation method. Pressing ESC on the background screen saves the character and starts the game as before:

There are quite a few things I could tidy up in this - a final confirmation screen that shows your character and allows you to cancel, more information on the various character creation choices and what affect they have on the character being created, and so on.

Incidentally, these changes reduce the size of the redistributable package to under 900K.

Monday, 21 September 2009

Refactoring Progress #4


UnitEngine.pas, which is one of the biggest source files, with almost 6000 lines of code, has finally been fully refactored. That means out of a grand total of 25500 lines of code, some 15000 lines have been refactored.

The largest remaining source code files to be updated are UnitDungeon.pas and UnitDisplay.pas (with 4000 lines each),

Leaving aside the larger changes in the next version that I've already talked about (potions, scrolls, corpses, keyboard controls and so on), the following smaller changes have been made to the current dev version (mainly as a result of repeated playthroughs and the refactoring picking up bugs):
  • Characters that do not know any magic can no longer access the spell screen.
  • Fixed a few minor spelling mistakes in the character dump and a few layout mistakes on the high-score screen.
  • When digging a reminder is now displayed of the keys used.
  • Drinking from fountains now uses a turn up.
  • Sneak attacks are now flagged in the message log.
  • Thieves now get extra sneak-attack damage when using ranged weapons.
  • The thievery skill now grants a chance to open and close doors without allowing monsters to react.
  • Monsters that are carrying items no longer have their items disappear on death when killed in ranged combat.
  • The change in 0.03 to not display messages upon opening and closing doors has been reversed.
  • Trying to open or close doors when there are no doors in range will produce an appropriate message in the message log.
  • Opening doors as part of movement will now cause a turn to pass.
  • Tunnelling now takes only half as long.
  • Tunnelling now displays a message indicating if it has been aborted due to nearby monsters.
  • Attempting to tunnel through impassable walls now doesn't use up any time.
  • Trying to dig on the town level results in a warning message.
  • Walking into walls now uses up a turn.
  • Trying to pick up an item with a full inventory no longer gives the message that an item has been successfully picked up.

Sunday, 20 September 2009

NLarn

One of the legendary roguelikes (and thus one that I'm also not very good at) is Larn. Its currently being remade and looks absolutely gorgeous:


It almost makes me regret not having an overland map. If I had continued with development of the original Kharne, then I would have had an overland map. I managed to dig this out of an archived folder which hadn't been touched for eight years or so:


This would have been the overland map for a future release of Kharne the Revelation.

Saturday, 19 September 2009

Attempt #45556433 to make thievery a viable playstyle in roguelikes

In the next version sneak-attack damage will be added to both melee and ranged physical attacks carried out by the player upon unaware foes.

The basic sneak attack damage doubles the inflicted damage, but thieves get a bonus to this - for every three points in the subterfuge skill, the damage scales up (e.g. a subterfuge skill of 6 will mean that sneak attack damage is four times normal damage).

In the long run this may prove to be horribly unbalanced, but I hope it will make playing theives more attractive in the short term.

I've also got an idea to add an additonal weapon brand that does extra sneak attack damage.

And eventually, I want thieves to be able to open doors without making monsters aware of their presence.

Anyone got any other ideas for making thievery a valid playstyle?

Friday, 18 September 2009

On magic...

I've been doing some thinking, and I think that I'll start work on implementing magic for the next version. To speed this up, I think I'll make the control system for casting spells to be mouse-based for now, so that we have:
  • left-mouse button: fire ranged weapon (the current behaviour)
  • right-mouse button: fire current spell
If the spell doesn't have a target (e.g. if its a self-buff), then there is no need to click on the player symbol.

In a later version, I can then implement the full blown keyboard/targeting HUD control malarkey.

Tuesday, 15 September 2009

Kharne 0.03d available

Due to the hanging bug occuring too often for my liking on the current released version, I've decided to release a new interim bug-fix version, 0.03d.

It does not have any of the main features (potions/scrolls, integral character creation and so on) that are due to be in 0.0.4, nor is it be open-sourced, like 0.0.4 will be, but it will be a good basis upon which to release the next major version.

You can either get it here or via the link on the right-hand-side under 'Downloads'.

One small issue with this version is that due to the logging threading, after you exit the game, it takes a few seconds to clear itself from memory. I'm currently investigating that.

Here are the changes in this version:
  • Bitstream Vera Sans Mono is now the only font used throughout the entire game.
  • Ranged/magical attacks for monsters now use differening appropriate and meaningful ASCII symbols.
  • Ranged/magical attacks for monsters now are described correctly (and differently from melee attacks).
  • The status/info panel can now be hidden (F1/F2 to toggle).
  • Grammar and punctuation has been corrected in various locations throughout the game.
  • The Monster description window has been removed from the game.
  • The Item popup window has been removed from the game.
  • OOD Monsters and Uniques have had their stats adjusted.
  • Wearing and removing magical items now produce additional atmospheric messages.
  • The magnitudes of item enchantments have been modified.
  • Attacking with a missile weapon now produces appropriate feedback in the message log.
  • Monsters that haven't detected the player yet are grayed-out.
  • Monsters can no longer critically hit the player.
  • Skill levels now contribute to Game Score.
Ill shortly be starting a period of fairly intense revision for my Cosmology exams in mid-October, and coupled with my full time job and a family (significant other and two cats) my time is fairly limited so I don't anticipate 0.o4 to be out until after that.

Monday, 14 September 2009

Necrophilia

...or how I learned to love corpses.

...in a roguelike way, of course.

So, how should I handle monster corpses in Kharne? Should they be used for food, like in Crawl? How often should they drop? Should they be used for anything else?

Any thoughts?

Sunday, 13 September 2009

Sleeping Monsters & Stairs into Vaults

I've added some code to gray out monsters that aren't aware of the character yet:


The mouse over hint will also tell you that they're not aware of you yet. When they wake up, they return to their natural colours:


Incidentally, this was an instance of stairs from the town level leading directly down into a vault. It's not very common, and can only happen on the first entrance to a dungeon branch. The question is, should I disallow stairs from being located inside vaults?

Saturday, 12 September 2009

Interface Improvements in the next version

The next version will feature an overhaul of the interface. I want to bring the interface more into line with the traditional roguelike capability of being able to control everything as much as possible via the keyboard (as well as using the mouse).

Hence, 0.0.4 will allow you to examinem wear, wield, drop and use (drink/eat) items via keyboard commands. Now that multi-item tiles have been implemented, I'll also allow multi-drop, and enable mouse-over item hints on items.

And of course, 0.0.4 will be released under the MPL with the source code repository on googlecode.

Friday, 11 September 2009

Improving the AI

I've noticed the following situation quite a lot:

...where the player can see the monster but the monster cannot see the player (and thus is still asleep) This is because the player FoV is calculated using Recursive Shadowcasting, and lacking a working noise model, monsters initially use a simple implementation of Bresenham's line algorithm to calculate if they are aware of the player or not.

In an ideal world, the monsters would either use a noise system or recursive shadowcasting of their own to find the player, but in the meantime, I need to think of a better way to make monsters active. I'm proposing that, for now, if a monster is in the FoV of the player, but cannot directly see the player, then that is equivalent to having direct line of sight (via Bresenham) to the player, and the monster will awaken and then move in a random direction to try and achieve direct line of sight.

And to answer some questions I've had about screen resolution, here is the main window maximised on my laptop running at 1366 x 768 and with the main display minimised, giving a tile display of 112 x 22 using Bitstream Vera Sans Mono, 11 pt. text (click to zoom in to see at full resolution):

The mininum (default) size is 900 x 730.

Thursday, 10 September 2009

Bug Fix & Criticals

I think I've fixed the problem with the game hanging that currently occurs seemingly at random. This was due to an infinite recursive loop in the energy allocation for monsters. I've played through a couple of early branches (with wizard mode and logging on) and it doesn't hang, so fingers crossed. The fix will be included in the next release.

In other news, should monsters be able to critically hit (and miss)? Should players be able to critically hit (and miss)?

Wednesday, 9 September 2009

Tuesday, 8 September 2009

Fullscreen vs not Fullscreen and other UI questions

  • Should Kharne start maximised to the full screen size
  • What screen resolutions should Kharne support? (and should it be optimised for any of them?)
  • What fonts should Kharne use? (and what size should they be?)
  • Would you like to see any of the current screens and displays rearranged in any way? And if so, how?
  • Should I get rid of the Splash Screen?
  • Are there any other UI enhancements you'd like to see?

Thursday, 3 September 2009

Progress Report #16

Things have been quite recently on the Kharne front due to considerable real-life interference.

I have been able to continue work (slowly) on the refactor, and also on integrating the character creation into the main window. I've decided to remove the 'full' character create option, and leave just the 'quick' and 'random' methods available. I'll post some screenshots when I have it working enough to do so.

To answer a few questions that have recently come up in the comments:
  • There will indeed be a tiled version of Kharne eventually. Most of the code to handle tiles has already been written, but it hasn't been called anywhere. I'll probably go with the David Gervais tiles (just like the old Kharne did)
  • When I finish the refactor and release the next version, Kharne will officially go open-source (probably on GoogleCode). There will be a repository and bug-tracker set up to handle error reports.
  • Following a reply from the FSF, it is likely that Kharne will be released via the GPL instead of the MPL.
  • In a later version, pretty much all of the game settings will be configurable (via both appropriate windowed dialogs, or INI files).
  • Yes, Potions and Scrolls are coming, and will be in the next release.
  • No, I don't yet have a timescale for the next release. My last exam is on the 12th October, so I expect it to come out sometime after that.

Sunday, 30 August 2009

Zoom!

One of the last things left on the UI to do is to implement a real-time zoom:


Ideally, I'd like this to be controllable via the Scroll-Wheel of the mouse as well as with keyboard shortcuts.

Saturday, 29 August 2009

Making the most of the screen

In the next release, you will be able to minimise the information window by pressing F1:


And restore the standard view by pressing F2:

This works even if the screen is resized. But what information should be displayed along the top of the screen in the full view?

Wednesday, 26 August 2009

This was unexpected...

I didn't expect this.

Tuesday, 25 August 2009

Refactoring Progress #3

With real life interfering quite a bit, things are going quite slowly on the refactoring front - It also doesn't help that I'm in the middle of doing some of the larger units (e.g. UnitFunctions, UnitEngine, UnitDisplay, UnitCreature etc).

Here is the current progress:


In other news, I'm having another wibble over licensing. This is interesting and seems to indicate that I can release Kharne as GPL (instead of MPL) (this and this may also be relevant). Does anyone have any experience of this with regards to Delphi and use of 3rd party custom components? I may end up just emailing the FSF to clarify.

Friday, 21 August 2009

Kharne on Linux....

Running via WINE, courtesy of elig (from the comments below).

Thursday, 20 August 2009

The Crawl Poll

There's a Crawl Poll out. Crawl is my favourite roguelike. Hence are my answers.

1. What is you age?

Let's just say Thirty-something :-)

2. Which country do you live in?

The United Kingdom.

3. Do you play locally, on a server or both?

Usually locally. I've tried playing on CAO, but the intricacies of setting up terminal options so that they're just so discourages me a bit.

I do like to be the voyeur and watch others playing though.

4. Do you play Tiles or ASCII or both?

Both. I would love the full screen mouse-tile interface to work with an ASCII version though. ASCII tiles perhaps? (hinthint)

5. Which Operating Systems do you use at home?

Primarily Windows (Vista, urgh...it came with the laptop, its not a patch on XP). I do have it dual-installed with Ubuntu which I do occasionally use (I was a former UNIX monkey. And before you ask, XEmacs).

6. Which Roguelikes have you played before? (Nethack, ADOM, Angbandetc.)

Of the big ones (and in order of time spent playing in descending order): Crawl, TOME, Angband, Unangband, Sangband, ADOM, Rogue.

And lots and lots of the minor ones.

You'll notice no Nethack. That's deliberate. I'm also especially crap at ADOM.

7. Where did you learn about Crawl?

I think it was actually r.g.r.m.

8. And when?

A long time ago, but not that long ago - I think it was just after Stone Soup came out and I had gotten back into roguelikes after a long time away. I should really play some b26 as well to see what that feels like in comparison to SS.

9. How often did you win Crawl? (If none, you may specify your best game.)

Win? You're having a laugh! My best was a 2-rune MDFi 19 that died due to "let's-die-from carelessness-for-no-good-reason-at-all-because-I-didn't-quite-have-my-Crawl-head-after-shortly-commencing-another-session-of-play-the-next-day" syndrome.

10. If you take part in the Crawl tournament: where did you hear about it?

I don't take part mainly due to lack of time and my own general crapness at Crawl.

11. Did you ever recommend Crawl to someone?

Yes, several. Including my other half, who has recently given up playing due to Orc Priests getting nerfed.

12. Which computer game played most in the last month (July)?

In July? Hardly any. Though I did reinstall and subsequentlydelete Civilisation 4 for what seems like the umpteenth time.

Big or small levels?

Big levels or smaller levels? is a question that has come up in the long-running Exploitation and Evasion thread over on r.g.r.d.

So...should Kharne keep its current (IMHO) big levels or move to smaller levels?

(if it helps the discussion, I intend for the shortest path through the dungeon to be forty levels, split over four dungeon branches, and for the maximum character experience level to be XL20).

Wednesday, 19 August 2009

On rehabilitating old roguelikes...

Krice appears to have given up his attempts at taking over and restarting development of Abura Tan. Its a shame, as it showed a lot of potential.

Another two old abandoned roguelikes that seemed full of potential were Nethermost Wanderings and The Legend of Saladir.


Both of these have not been updated for a long time (Saladir since 1998, NW since 2005.) If I wasn't so involved with a part-time degree, coding Kharne, and occasionally dabbling in C#, I'd be very keen on taking over one of these projects.

Of course, the problem with Saladir was that, as far as I'm aware, the source code was never released. Perhaps there's a lesson to be learned there?

The code for Nethermost Wanderings on the other hand, is freely available. Perhaps someone else out there is masochistic enough to try some new development? (although it doesn't say anything on the website, when you look at the current CVS source, it has actually been GPLed)

Mind you, I hope in years to come people don't talk about Kharne in the same way...but at least by releasing the source code, if something does happen, at least it has a chance of living on.

Saturday, 15 August 2009

Refactoring Progress #2

Ironically, one of the most irritating things about my existing code is the tendancy for it to have crept over 80 characters in length (on each line). According to the Object Pascal Style Guide (and to common sense), lines longer than 80 characters are verboten.

I'm still working on the UnitItem unit which contains the definitions for the TItemEnchantment, TItemArchetype and the TItem classes (which all do exactly what they say on the tin). Its taking longer than I thought because, frankly, the code is a mess. But already, I'm starting to see the difference both in terms of understanding and readibility, and even performance has improved slightly.

Friday, 14 August 2009

More on Item Effects

One of the things I've found whilst doing the refactoring is some code I wrote which allows suitable messages to be passed to the message log when you wear or remove items to reflect the properties of said items. Until now it has never been called or used.

For example, consider an amulet that grants +alertness and +reslifedraing.

This would be the display in the message log when you wear-identify it:

You see an Ornate Copper Amulet here
You pick up an Ornate Copper Amulet
You now have an Ornate Copper Amulet
You put on an Ornate Copper Amulet
You feel more resistant to lifedraining
You feel more alert
It is an Copper Amulet of Being!
You take off an Copper Amulet of Being
You feel less resistant to lifedraining
You feel less alert

I personally like this, though I'm a bit worried that it may clutter up the message log a bit too much. What do you think?

Thursday, 13 August 2009

Refactoring Progress #1

Here's the current progress in the great Refactor/Tidyup/Open Source project. Red lines represent Units/Forms that have been completed.

(yes, that is the View->Project Manager dialog for the main Kharne executable)

Here's an example of an unrefactored procedure in all its hideousness (including, you'll note, no comments, the shame):

function TMonster.GetSinglePrefix: string;
begin
if (Length(Trim(UniqueName)) <> 0) then Result := ' ' else
begin
if (MonsterName[1] in ['A', 'E', 'I', 'O', 'U', 'a',
'i', 'e', 'o', 'u']) then

Result := 'an '
else
Result := 'a ';
end;
end;

And here is the refactored version:

{ Return the singular form of the prefix }
function TMonster.GetSinglePrefix: string;
begin
{ Logging }
hLog.Add('{now} {lNum} TMonster.GetSinglePrefix()');

{ Default result }
Result := '';

try
{ Again, Uniques do not have prefixes }
if (FUnique) then
Result := ' '
else
begin
{ Deal with vowels }
if (Vowel(FName)) then
Result := 'an '
else
Result := 'a ';
end;
except
{ in case of error, log the Exception }
on E: Exception do hLog.AddException(E);
end;
end;

Its still not perfect, there are still many optimisations that could be done (e.g. raising exceptions properly, dealing with those spaces that keep appearing in many of my punctuation routines), but the second excerpt I'd be happy to see released into the world with my name on it.