Showing posts with label Combat. Show all posts
Showing posts with label Combat. Show all posts

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)?

Thursday, 6 August 2009

Flavoured Yummy Combat

Up until now, combat in Kharne has been pretty boring. You hit the monster. The monster hits you. You hit the monster back. And so on. Until one of you drops.

But no longer.

Ogres bash, slam and smash. Bees sting. Wraiths claw you. Hounds bite and claw. And Minotaurs gore you.

Tuesday, 4 August 2009

Spicing up ASCII: Combat

I was browsing through the archives of r.g.r.d. when I came across this thread about indicating attack results within an ASCII paradigm.

I've had a similar idea in mind for Kharne for a while now. To summarise:
  • if you take damage, the character's symbol (@ of course) flashes red briefly. How deep a red depends upon how much damage has been taken.
  • if you inflict damage, the symbol of the monster that has taken damage flashes red briefly. This is not graduated.
  • if a monster attacks you, its symbol changes briefly to a green colour.
  • if a monster has a status effect, for example, held, paralysed, sleeping, poisoned, then its ascii character is shaded a different colour.
Thoughts?

Friday, 31 July 2009

Critical Hits

Currently, players and monsters can both score critical hits (1 in 20 chance in fact).

The base damage from a normal melee or ranged hit is:

DamageInflicted := Random(LocalMonster.AttackDamage) + LocalMonster.AttackDamageBonus + LocalMonster.GetBonusDamage(LocalPlayer.SubRace) + 1;

This is then subsequently modified by armour:

Absorption := (LocalPlayer.AC / (ARMOURCAPACITYCAP * 8));
DamageInflicted := DamageInflicted * (1 - Absorption);
Result := Trunc(DamageInflicted);

The constant ARMOURCAPACITYCAP is currently set to 25, hence an AC of 200 (not currently achievable) could potentially block all incoming physical damage (AC is currently linear, unlike EV, which is non-linear).

However, the damage from a critical hit can potentially one-shot a player at lower levels. For a critical melee or ranged hit, the damage is:


DamageInflicted := LocalMonster.AttackDamage + LocalMonster.AttackDamageBonus + LocalMonster.GetBonusDamage(LocalPlayer.SubRace) + 1;

For example, a non-weapon wielding Greedy Adventurer has a base AttackDamage of 8 and an AttackDamageBonus of 1, thus on a crit, it could do 8+1+1=10 points of damage, before absorption by armour. The usual starting AC is 20, which means 1 point of damage is absorbed, leaving 9 to get through.

The only classes that are normally capable of withstanding this at level 1 are Warriors and Knights. If the monster is carrying a magical weapon, then it will do more damage and thus potentially one-shot any character.

I don't like one-shots.

So the question is: should monsters be able to critically hit? And even if not, should their damage always be limited to, at maximum, the player's maximum health - 1? Or some other fraction of the players' health?

Monday, 20 July 2009

The Xvart who wore Woolen Mittens...

Sometimes this game is unintentionally amusing:

A Xvart comes into view! It is wearing some Polished Woolen Mittens
A Greedy Adventurer comes into view!
A Xvart comes into view!
The Greedy Adventurer attacks but misses you
You hit the Greedy Adventurer
You have killed the Greedy Adventurer!
The Xvart glares evilly at you!
The Xvart attacks but misses you
The Xvart attacks but misses you
You hit the Xvart
You have killed the Xvart!
The Xvart hits you but your armour absorbs the blow
The Xvart attacks but misses you
You hit the Xvart
You have killed the Xvart!
You see some Polished Woolen Mittens here
You pick up some Polished Woolen Mittens
You now have some Polished Woolen Mittens
You put on some Polished Woolen Mittens
They are some Woolen Mittens [1, 0]!

It sounds like some mad Dr Seuss story, possibly writen under the heavy influence of drugs: "The Xvart who wore Woolen Mittens".

Friday, 17 July 2009

0.03 Preview #2 - Atmosphere in the Dungeon

One of the features I'm currently coding for inclusion in 0.03 is customising the message to give more atmosphere in the dungeon. Monsters will speak, and do things, and the combat messages will be much more flavoursome. Here is an except from the message log with highlighted flavour text for Kobolds:

There is a portal leading to the Fortress of Ablach here
You have travelled through the portal to The Fortress of Ablach
You open the door
You open the door
You open the door
The Xvart sees you!
The Xvart critically hits you inflicting 5 points of damage
You hit the Xvart inflicting 5 points of damage
You have killed the Xvart!
You open the door
You open the door
Something close by is alerted to your presence!
The Kobold attacks but misses you
Something close by is alerted to your presence!
The Kobold glares at you with hatred!
The Kobold attacks but misses you
The Kobold hits you but you deflect
The Kobold attacks but misses you badly
The Xvart attacks but misses you
The Xvart attacks but misses you
You critically hit the Xvart inflicting 12 points of damage
You have killed the Xvart!
The Kobold barks loudly!
The Kobold hits you but your armour absorbs the blow
The Kobold hits you but you block
There is a fountain here...
You take a draft from the fountain
You feel something in the fountain!
You drink from the fountain. The water refreshes you
The Kobold attacks but misses you badly
There is a dried-up fountain here...
You see an Elaborate Iron Kite Shield here
You pick up an Elaborate Iron Kite Shield
You have an Elaborate Iron Kite Shield
The Kobold hits you but you deflect
The Kobold glares at you with hatred!
The Kobold says "I'll have your guts for garters"!
The Kobold attacks but misses you
The Kobold says "I'll stick you full of arrows like a porcupine"!
You hit the Kobold inflicting 3 points of damage
You have killed the Kobold!
You see a Opaque Green Potion here
You unwield a Bronze Kite Shield [4, 0]
You wield an Elaborate Iron Kite Shield
It is an Iron Kite Shield [4, +1]!

Eventually, I'd like to have flavour text for the character's own combat as well, for example, warhammers would "smash" and "thump", whereas daggers would "stab" and "slice", and so on.

Wednesday, 29 April 2009

New UI


This is the result of the tinkering I've been doing over the last few days. Good old Courier font.

I do have a question though: does displaying the amount of damage that the player or monsters do add any value to the game? Not many roguelikes display this amount of combat detail. Should Kharne?

Tuesday, 28 April 2009

Ranged Combat - some thoughts

I originally had planned on releasing the next version of Kharne this week which was going to include fountains, skills and ranged combat. But I've rethinking the ranged combat interface and it is going to need a lot of work, so I think I will just put out an incremental release (0.02b) with fountains, skills and a few bug fixes out this week and reserve ranged combat for the next release after that.

The rethink of the ranged combat interface will bring it much closer to the standard one for roguelikes (with support for mouse-targeting as well). It will also introduce proper ammunition. The ranged combat changes also tie in with a couple of other changes, such as adding mouse-over hints for monsters and items (providing the same information as is displayed in the right-click popup windows).

Since ranged combat is notoriously hard to get right, I'm inviting comments on the following proposed interface. This is something I want to get correct from the off. The amount of code to implement this is not trivial, so I really don't want to have to go back and recode it in the future if I can help it.

You have an inventory slot currently designated as the quivered item(s). This can be either ammunition, or a weapon (e.g. a dagger). If no quivered item is designated, then the first suitable item that is picked up is allocated. Pressing { and } will cycle between any suitable ammunition or weapon in your backpack). You can also select the current quivered item(s) from the inventory screen via the mouse. The current quivered item(s) is displayed on the main screen.


Mouse:


Left-clicking on a monster (in view) will fire the currently selected item at that monster.


Keyboard:


Pressing f will bring up a heads-up display overlaid on the current view with all hostile monsters in view highlighted. If you've previously fired at a monster in view, this one will be pre-selected. Pressing TAB will cycle between visible monsters, or monsters can be selected manually by using the cursor keys. { and } will still work for selecting ammunition at this point. Pressing ENTER will fire the item. Missiles/items that do not hit the target will either fall short or fall long and some of them can be picked up again and reused.

If you've previously fired at a monster, and that monster is alive and in view, then pressing F will fire the currently selected item at that monster again.


The best-case keyboard sequence for firing will be thus be f-[ENTER] then F, F, etc. Best-case mouse sequence is left-click, left-click, left-click...


Thoughts?

Sunday, 5 April 2009

AI and Melee Combat

Here is a video showing the first version of the Monster AI and Melee Combat in action. The video shows a Dwarf Warrior (the most melee-centred class) fighting creatures in the first level of the Wilderness and ends with him advancing to Level 2.



The AI routines are still slightly buggy - occasionally the positions that the Dungeon Object holds for the Monsters and the locations that the Monsters think they are at get out of sync. - this could lead to invisible monsters attacking the Player Character. I have no idea yet why that occurs, but it will need to be investigated further. Currently there is a hack in place to zap any monster that gets into this situation, but that's only a temporary fix at best. But having said that, I am pleased with progress on this, even if combat is currently horribly unbalanced (in favour of the Player Character)

Saturday, 28 March 2009

Character Dumps

This is a first attempt at a Death Screen. There is much missing and yet to be implemented (for example, dungeon events, victory lists and suchlike). Currently the only way to bring it up is to commit suicide. You'll notice the combat messages at the very bottom. I've partially implemented melee, but there is no framework yet for Ranged and Magical attacks.
----------------------------------
Kharne Alpha v0.01d Character File
----------------------------------

Agrendaa the Level 1 halfling Priest

Began the game on 28/03/2009 23:09:49
Died 138 turns later on 28/03/2009 23:09:49

On Level 1 of The Mausoleum

-------
Summary
-------

HP: 11/11
MP 8/8
AC: 15
EV: 9
SP: 3

Gold: 0
Burden: 50/130 lbs

XP: 0/0

----------
Attributes
----------

Strength: 13 (3)
Agility: 10 (0)
Endurance: 10 (0)
Intelligence: 17 (7)
Resolve: 20 (10)
Charisma: 15 (4)

------
Combat
------

Accuracy: 1
Damage: 0
Blocking: 0
Deflection: 0

------
Skills
------

Fighting: 3
Melee Combat: 2
Ranged Combat: 0
Unarmed Combat: 0

Defense: 0
Heavy Armour: 0
Medium Armour: 1
Light Armour: 0

Subterfuge: 0
Thievery: 0
Thievery: 0

-----
Magic
-----

Base Skill: 5
Elemental Fire: 0
Elemental Water: 0
Elemental Air: 0
Elemental Earth: 0
Nature: 0
Healing: 4
Cursing: 0
Combat: 1
Protection: 2
Lore: 0

-----------
Resistances
-----------

Base Resistance: 0
Fire: 0
Earth: 0
Air: 0
Water: 0
Poison: 0
Lifedraining: 0

---------
Inventory
---------

Head: a Bronze Coif [3, +2]
it increases your armour class (+2)

Neck: [NOTHING]
Chest: a Hide Harness [4, 0]
Arms:
[NOTHING]
Hands:
[NOTHING]
Legs: some Hide Chaps [2, 0]
Feet: some Leather Boots [2, 0]
Mainhand: a Tin Hand Axe [0, +0]
Offhand: an Alder Buckler [2, 0]
Ranged:
[NOTHING]
Back:
[NOTHING]
Left Finger: a Copper Ring of Demon Slaying
it increases your damage against demons (+4)
it increases your charisma (+1)

Right Finger:
[NOTHING]

Carried:

a Potion of See Invisible
a Leather Cap [2, 0]

-------
Dungeon
-------

############################################~~~~~.~~~\~~~.#.#####
############################################@##############.#####
############################################~##############.#####
############################################.##############.#####
############################################.##############.#####
############################################\##############.#####
############################################z##############.#####
############################################.##############z#####
############################################.##############.#####
##############################..~...#######..##############.#####
##############################.....~#######.###############.#####
##############################......#######.###############.#####
##############################..@@~z......\.###############.#####
##############################......#######################.#####
##############################......#######################z#####
##############################......#######################z#####
###########################################################.#####
###########################################################.#####
###########################################################.#####
###########################################################.#####
###########################################################.#####
###########################################################z#####
###########################################################.#####

--------
Messages
--------

127: You open the door
127: Something close by is alerted to your presence!
127: The Zombie hits you [Rolled 11+1=12] inflicting 5 points of damage
128: The Zombie hits you [Rolled 12+1=13] inflicting 1 points of damage
129: The Savage Rune Hunter hits you [Rolled 9+4=13] inflicting 3 points of damage
129: The Savage Rune Hunter attacks but misses you [Rolled 4+4=8]
130: The Savage Rune Hunter hits you [Rolled 18+4=22] inflicting 1 points of damage
130: The Savage Rune Hunter hits you [Rolled 10+4=14] inflicting 2 points of damage
131: The Savage Rune Hunter hits you [Rolled 9+4=13] inflicting 1 points of damage
132: The Savage Rune Hunter hits you [Rolled 19+4=23] inflicting 4 points of damage
133: The Savage Rune Hunter hits you [Rolled 14+4=18] inflicting 8 points of damage
134: The Savage Rune Hunter attacks but misses you [Rolled 3+4=7]
135: The Savage Rune Hunter hits you [Rolled 12+4=16] but your armour absorbs the blow
136: The Savage Rune Hunter attacks but misses you [Rolled 4+4=8]
136: You see a pile of bones here...
137: The Savage Rune Hunter attacks but misses you (fumble)
137: You take off a Leather Cap [2, 0]
137: You put on a Bronze Coif [3, +2]
137: You put on a Copper Ring of Demon Slaying
138: You decide life is not worth living any more...