Author Topic: LambdaHack and new content  (Read 18034 times)

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
LambdaHack and new content
« on: May 19, 2015, 05:21:19 AM »
I have been poking around with LambdaHack engine again and got couple things I need to understand better. Decided to ask here instead of mailing the author directly so other will benefit from the answers too.

How do items work? Especially are aspects of all items that are being carried active or only those that are currently equipped?

What are EqpSlots used for? For example, ring of Rush has
Code: [Select]
EqpSlot EqpSlotAddSpeed "".

How does rarities work? ItemKind has field rarity that has array of tupples. First value is dungeon level and the second one is rarity. But what does rarity 1 or rarity 10 signify?
Everyone you will ever meet knows something you don't.
 - Bill Nye

Man of Letters

  • Rogueliker
  • ***
  • Posts: 68
  • Karma: +0/-0
    • View Profile
    • Email
Re: LambdaHack and new content
« Reply #1 on: May 19, 2015, 10:37:17 AM »
Thank you for asking. These things have changed many times, but now they stabilized as a part of the v0.5 content API, so it's the perfect time to spell them out and see it they make sense. :)

Quote
Especially are aspects of all items that are being carried active or only those that are currently equipped?

The latter. You can verify, using the ! menu, that only aspects of items in equipment (menu E) and among organs (menu @) add up to the total actor stats.

Quote
What are EqpSlots used for? For example, ring of Rush has EqpSlot EqpSlotAddSpeed "".

The slots do not influence stats that the item confers.
Slots are used by AI to decide what the main use of an item is. This is not obvious when an item has many aspects and possibly also effects. E.g., the Ring of Rush has a couple of other aspects added to balance it: https://github.com/LambdaHack/LambdaHack/blob/v0.4.101.1/GameDefinition/Content/ItemKind.hs#L405

Slots are also used by UI to decide whether to put an item in equipment on pickup by default, or not. The user can always override the default or just move the item elsewhere afterwards.

Quote
How does rarities work? ItemKind has field rarity that has array of tupples. First value is dungeon level and the second one is rarity.

More precisely, the first value is a level number assuming there are exactly 10 levels.
If there are more, the level number is scaled. E.g., if dungeon has 100 levels, rarity specified as 5 actually refers to level 50. In this ways the same item definitions can be used for dungeons of various sizes.

For levels not mentioned among the rarities, the value is linearly interpolated (always rounding up), assuming that level 0 and level 11 have rarity 0.

Quote
But what does rarity 1 or rarity 10 signify?

This is a relative rarity among all items that can be generated at the given level. E.g., on a bookshop level that can only hold "any scroll" items, we consider all items that have "any scroll" in the ifreq field, take the value from that field, multiply it by the rarity at the level depth and then item is picked randomly with this relative frequency. See https://github.com/LambdaHack/LambdaHack/blob/v0.4.101.1/GameDefinition/Content/ItemKind.hs#L615
« Last Edit: May 19, 2015, 10:41:36 AM by Mikon »

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: LambdaHack and new content
« Reply #2 on: May 19, 2015, 05:03:09 PM »
Cool, thanks for the help. I'll continue tinkering with the space privateers and probably ask more basic questions as I progress.
Everyone you will ever meet knows something you don't.
 - Bill Nye

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: LambdaHack and new content
« Reply #3 on: May 22, 2015, 06:08:36 PM »
I was experimenting with creation of wands, but didn't manage to do anything useful (I either burned myself with wand of fire or just threw it away). Looking at https://github.com/LambdaHack/LambdaHack/blob/5476c9352782f6ce688e984673ef06224fef6b04/Game/LambdaHack/Common/Ability.hs I didn't see anything about zapping specifically, so I guess wands aren't currently possible?

Btw, good catch with storm hammer being overpowered. I added a short charging period on it and now it's not as effective at keeping enemies at distance as it was before. I might add some secondary effects on it still, like you have.
Everyone you will ever meet knows something you don't.
 - Bill Nye

Man of Letters

  • Rogueliker
  • ***
  • Posts: 68
  • Karma: +0/-0
    • View Profile
    • Email
Re: LambdaHack and new content
« Reply #4 on: May 22, 2015, 06:45:27 PM »
I was experimenting with creation of wands, but didn't manage to do anything useful (I either burned myself with wand of fire or just threw it away). Looking at https://github.com/LambdaHack/LambdaHack/blob/5476c9352782f6ce688e984673ef06224fef6b04/Game/LambdaHack/Common/Ability.hs I didn't see anything about zapping specifically, so I guess wands aren't currently possible?

Yep, they are incomplete and disabled in the LambdaHack content. The best you can do currently is have multiple copies of a wand instead of wand charges. But the UI still tells you that you 'throw a wand' instead of 'shoot a want' and in the end you have no wands instead of an empty wand with all charges spent, as you would in, e.g., Angband. I'm still undecided if I the two differences are all there should be to wands or if we should somehow make them yet different from a stack of projectiles. Perhaps when we implement your distance cone attacks proposal, etc. that will make it different enough.

OTOH, it's already possible to define fully featured Angband rods that take time to recharge and can be stacked and then the UI should tell you '5 rods, 3 still charging'. I haven't defined any yet, because I prefer one-time items, such as scrolls, potions and flasks, since they are easier to balance (you easily have an interesting decision if you lose the item the moment you apply it; but if you only have to wait for it to recharge, too often the decision is a trivial 'use as often as possible').

Quote
Btw, good catch with storm hammer being overpowered. I added a short charging period on it and now it's not as effective at keeping enemies at distance as it was before. I might add some secondary effects on it still, like you have.

Well done. When I had stolen the pushing hammer idea from you, I made it a halberd, and an artifact one. I have no other effects on it (long item descriptions are hard to read and remember). Keep going, I need more ideas to steal. ;)

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: LambdaHack and new content
« Reply #5 on: May 24, 2015, 09:10:27 PM »
I was playing with wands because I thought they could be used to create guns and such. But there's plenty of other things to do, so that can wait. I'm not even completely sure if I want guns in game or not :)
Everyone you will ever meet knows something you don't.
 - Bill Nye

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: LambdaHack and new content
« Reply #6 on: May 26, 2015, 08:48:03 PM »
Created some more books that can be used to boost your stats. One such is book of close combat, that gives 3% damage to close combat, but 3% penalty to ranged one.

I also noticed a bug in the engine. If your character has maxed equipment (as many items equipped as possible) and you try to equip one more, the game crashes with error message: execFailure: cannot equip any more items

LambdaHack has pretty refreshing take on inventory management and used items. I like that I'm able to equip several weapons that boost my stats and use the strongest one in combat.
Everyone you will ever meet knows something you don't.
 - Bill Nye

Man of Letters

  • Rogueliker
  • ***
  • Posts: 68
  • Karma: +0/-0
    • View Profile
    • Email
Re: LambdaHack and new content
« Reply #7 on: May 26, 2015, 10:04:17 PM »
Created some more books that can be used to boost your stats. One such is book of close combat, that gives 3% damage to close combat, but 3% penalty to ranged one.

Fun stuff, as well as the librarian that often carries those. From my experience in my games (but YMMV), 3% bonus to damage dealt is not worth an equipment slot, and if there's a penalty, it's not even worth the turn spent picking it up. OTOH, if you scale up the bonus and the malus, players may be tempted to wear some items for melee combat and take them off for ranged combat. Which may be fun on levels with corridors, where you risk that you start a fight with wrong equipment, but is rather tedius on open levels, where you just need to remember the routine. The joys of endless balancing. ;)

Quote
I also noticed a bug in the engine. If your character has maxed equipment (as many items equipped as possible) and you try to equip one more, the game crashes with error message: execFailure: cannot equip any more items

Thanks a lot. Could you give the the git hash (or commit message) of the commit on the LH master branch that you work with? Also did it happen when the player's leader tried to equip, or another player's actor or the AI faction?

Quote
LambdaHack has pretty refreshing take on inventory management and used items. I like that I'm able to equip several weapons that boost my stats and use the strongest one in combat.

I'm glad to hear that. The idea was to make the inventory management as automatic as possible, given that the player controls many actors and also given that newbies should be taken care of until they learn to make their own equipment choices (the 'make your own detailed equipment choices' part is partially WIP, e.g., we still don't have a way to order the actor to attack with a particular weapon).
« Last Edit: May 26, 2015, 10:06:08 PM by Mikon »

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: LambdaHack and new content
« Reply #8 on: May 27, 2015, 04:08:54 AM »
Created some more books that can be used to boost your stats. One such is book of close combat, that gives 3% damage to close combat, but 3% penalty to ranged one.

Fun stuff, as well as the librarian that often carries those. From my experience in my games (but YMMV), 3% bonus to damage dealt is not worth an equipment slot, and if there's a penalty, it's not even worth the turn spent picking it up. OTOH, if you scale up the bonus and the malus, players may be tempted to wear some items for melee combat and take them off for ranged combat. Which may be fun on levels with corridors, where you risk that you start a fight with wrong equipment, but is rather tedius on open levels, where you just need to remember the routine. The joys of endless balancing. ;)

I would like to avoid encouraging micro-management as much as possible. But if 3% is too little for player to consider using the item, I think I'll scale it upwards a bit and maybe introduce some variation to score too.

Quote
I also noticed a bug in the engine. If your character has maxed equipment (as many items equipped as possible) and you try to equip one more, the game crashes with error message: execFailure: cannot equip any more items

Thanks a lot. Could you give the the git hash (or commit message) of the commit on the LH master branch that you work with? Also did it happen when the player's leader tried to equip, or another player's actor or the AI faction?

It's commit 06ee15ce77d656b1b23a7ab898150ac41d7eebef (Fix followers that got stuck when leader targeted unwalkable tile). I haven't checked what changes the latest LambdaHack has, I should update sometime soon.

From the error message, it was bname = "Hero 1". It wasn't AI controlled at this time, but by me.

Quote
LambdaHack has pretty refreshing take on inventory management and used items. I like that I'm able to equip several weapons that boost my stats and use the strongest one in combat.

I'm glad to hear that. The idea was to make the inventory management as automatic as possible, given that the player controls many actors and also given that newbies should be taken care of until they learn to make their own equipment choices (the 'make your own detailed equipment choices' part is partially WIP, e.g., we still don't have a way to order the actor to attack with a particular weapon).

Great, looking forward to see what kinds other new stuff the future will bring.
Everyone you will ever meet knows something you don't.
 - Bill Nye

Man of Letters

  • Rogueliker
  • ***
  • Posts: 68
  • Karma: +0/-0
    • View Profile
    • Email
Re: LambdaHack and new content
« Reply #9 on: May 27, 2015, 08:31:04 AM »
Bummer, I cannot reproduce the problem even with exactly the engine version you indicated. Could you send to mikolaj.konarski@funktory.com all the data you have, including a savegame (the whole saves/ directory to be sure), if you can reproduce (or just seeds if you manage to reproduce with automated tests)? Thank you.

Edit: I reproduced this using the command I never use normally: the 'e' command available when the game shows me the description of an item.
« Last Edit: May 27, 2015, 10:11:46 AM by Mikon »

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: LambdaHack and new content
« Reply #10 on: May 27, 2015, 05:48:12 PM »
I didn't have save left for the time the problem first occurred and when I tried to reproduce it, I couldn't get it to manifest. Kind of an odd situation there, but I'll keep my eyes open and see if I can get it to occur again.
Everyone you will ever meet knows something you don't.
 - Bill Nye

Man of Letters

  • Rogueliker
  • ***
  • Posts: 68
  • Karma: +0/-0
    • View Profile
    • Email
Re: LambdaHack and new content
« Reply #11 on: May 28, 2015, 12:19:13 AM »
Thank you again for the report. It's fixed now on branch master. I couldn't reproduce it, because I never use the 'e' command available when the game shows me the description of an item (the noun-verb command). Instead I use the standalone 'e' command and only then pick the item to equip, changing display modes as needed (this is the verb-noun command).

BTW, you probably noticed that your henchmen (non-leaders) sometimes move items from equipment to pack, etc. Would you perhaps prefer to reserve such item management for yourself and only allow them to autonomously pick up items? Or perhaps you'd prefer to only pick up items with your leader? If the former, I'd need to separate the picking up skill from the current item management skill, so this is post-0.5. The latter can already be accomplished by changing fskillsOther of playerHero.

Another thing: I just remembered that the ranged damage bonus (AddHurtRange) aspect only applies to the item in question, not to other items. The aspect comes into play only when the item is used as a missile. The logic is that when the missile hits, bonuses are calculated as if the missile actor hit the target actor in melee. The only tweak is that, instead of the melee damage bonus, the ranged damage bonus is taken into account. In the future, when missiles comprise of many parts, the bonuses of all the parts will naturally be taken into account, since all the parts are carried by the missile actor.

That's different than for AddHurtMelee and AddArmor*, which are summed over all items of the original actor, as can be seen in the ! screen. That's intentional, only the bonuses on the ammo and perhaps on the launcher should affect the ranged damage, which otherwise easily gets overpowered and also induces equipment micromanagement when switching from ranged to melee combat and back again. (That's also how, e.g., Angband does it.) I wonder how to prevent confusion both in the UI, the player guide and in the content code naming. Perhaps when launchers are added to the game this will settle down and become clearer, but I'm open to suggestions already.

So, items that add AddHurtRange are useless in equipment, they can as well be kept in the pack and thrown when appropriate.

This is also why I have huge AddHurtRange maluses on the melee weapons in LH --- this prevents their use as super-ammo (they have large damage dice and they are durable, unlike normal ammo). And, OTOH, this doesn't affect other items, so keeping them in equipment doesn't make other ammo weaker.
« Last Edit: May 28, 2015, 12:24:23 AM by Mikon »

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: LambdaHack and new content
« Reply #12 on: May 28, 2015, 04:16:16 AM »
Thank you again for the report. It's fixed now on branch master. I couldn't reproduce it, because I never use the 'e' command available when the game shows me the description of an item (the noun-verb command). Instead I use the standalone 'e' command and only then pick the item to equip, changing display modes as needed (this is the verb-noun command).

Great, I'll upgrade to the latest version soon I would think.

EDIT: I upgraded to latest version this morning and had the computer to play couple campaign games. Looking good to me. I'll play more in the evening when I'm home.

BTW, you probably noticed that your henchmen (non-leaders) sometimes move items from equipment to pack, etc. Would you perhaps prefer to reserve such item management for yourself and only allow them to autonomously pick up items? Or perhaps you'd prefer to only pick up items with your leader? If the former, I'd need to separate the picking up skill from the current item management skill, so this is post-0.5. The latter can already be accomplished by changing fskillsOther of playerHero.

I don't mind if henchmen are doing these tasks by themselves. In case they find something that I would rather have on leader, I can always later manually move it.

Another thing: I just remembered that the ranged damage bonus (AddHurtRange) aspect only applies to the item in question, not to other items. The aspect comes into play only when the item is used as a missile. The logic is that when the missile hits, bonuses are calculated as if the missile actor hit the target actor in melee. The only tweak is that, instead of the melee damage bonus, the ranged damage bonus is taken into account. In the future, when missiles comprise of many parts, the bonuses of all the parts will naturally be taken into account, since all the parts are carried by the missile actor.

That's different than for AddHurtMelee and AddArmor*, which are summed over all items of the original actor, as can be seen in the ! screen. That's intentional, only the bonuses on the ammo and perhaps on the launcher should affect the ranged damage, which otherwise easily gets overpowered and also induces equipment micromanagement when switching from ranged to melee combat and back again. (That's also how, e.g., Angband does it.) I wonder how to prevent confusion both in the UI, the player guide and in the content code naming. Perhaps when launchers are added to the game this will settle down and become clearer, but I'm open to suggestions already.

So, items that add AddHurtRange are useless in equipment, they can as well be kept in the pack and thrown when appropriate.

Right, good to know. I need to change some of my items (close combat manual comes to mind first) to reflect this. This distinction makes sense now that I know it.

This is also why I have huge AddHurtRange maluses on the melee weapons in LH --- this prevents their use as super-ammo (they have large damage dice and they are durable, unlike normal ammo). And, OTOH, this doesn't affect other items, so keeping them in equipment doesn't make other ammo weaker.

This one I haven't done yet, but should. Does weight of a thrown object affect to damage or distance any way? Or would it be better if I would assing maluses to very heavy weapons?
« Last Edit: May 28, 2015, 06:05:05 AM by tuturto »
Everyone you will ever meet knows something you don't.
 - Bill Nye

Man of Letters

  • Rogueliker
  • ***
  • Posts: 68
  • Karma: +0/-0
    • View Profile
    • Email
Re: LambdaHack and new content
« Reply #13 on: May 28, 2015, 08:34:16 AM »
Quote
I don't mind if henchmen are doing these tasks by themselves. In case they find something that I would rather have on leader, I can always later manually move it.

Sure, but when you switch the leader to another actor, the previous one can spontaneously decide to get rid of that item and/or equip other items. ;)
Another solution would be to let player mark items with an inscription {henchmen off} so that the henchmen AI knows it may not touch them. Post-5.0.

Quote
This one I haven't done yet, but should. Does weight of a thrown object affect to damage or distance any way? Or would it be better if I would assing maluses to very heavy weapons?

The weight only affects the distance of throwing. Additionally LH melee weapons have attributes like 'toVelocity 40' in their ifeature field that limit the throwing velocity further. But, e.g., a dagger realistically can be thrown quite far. OTOH, not being balanced for throwing, it can hit with the wrong side, so additionally I add 'AddHurtRanged (-60)', which makes it as weak as a dart, but travelling much slower and closer. That balanced well with the durability, I guess, so the darts are not made obsolete once you find a few daggers.

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: LambdaHack and new content
« Reply #14 on: May 28, 2015, 09:27:46 PM »
Quote
I don't mind if henchmen are doing these tasks by themselves. In case they find something that I would rather have on leader, I can always later manually move it.

Sure, but when you switch the leader to another actor, the previous one can spontaneously decide to get rid of that item and/or equip other items. ;)
Another solution would be to let player mark items with an inscription {henchmen off} so that the henchmen AI knows it may not touch them. Post-5.0.

True, that has actually even happened while I have been playing. Currently I don't find it too annoying. I try to avoid micromanagement and just worry about one character's equipment at a time.

Quote
This one I haven't done yet, but should. Does weight of a thrown object affect to damage or distance any way? Or would it be better if I would assing maluses to very heavy weapons?

The weight only affects the distance of throwing. Additionally LH melee weapons have attributes like 'toVelocity 40' in their ifeature field that limit the throwing velocity further. But, e.g., a dagger realistically can be thrown quite far. OTOH, not being balanced for throwing, it can hit with the wrong side, so additionally I add 'AddHurtRanged (-60)', which makes it as weak as a dart, but travelling much slower and closer. That balanced well with the durability, I guess, so the darts are not made obsolete once you find a few daggers.

Good to know, thanks.
Everyone you will ever meet knows something you don't.
 - Bill Nye