Teach monsters to use items / Monster inventories improve
issueid=4237 01-21-2016 07:41 PM
ixi ixi is offline
Junior Member
Number of reported issues by ixi: 51
Teach monsters to use items / Monster inventories improve
I feel like this could really make the game more interesting and that it worth effort and amount of coding...

The main idea is to teach monsters to use items which could be useful for them in combat. Then randomly give monsters these items once they're generated.

How this would improve the game:
  • This would surely make fights more interesting. Fighting a hobgoblin leader that uses a wand against you must be more exciting than fighting regular one.
  • This would make some monster drops (these unused items) more rewarding.
  • Prospects of huge pickpocketing change, instead of loot generation upon pickpocketing items that are already generated could be stolen.
  • Finally intelligent companions could become really valuable, (probably even so overpowered that a nerf would be required).
  • Finally it would just slightly increase total impression about this game.


If you don't like any concrete suggestions below - please drop a comment rather than downvoting, I'm not insisting on all suggestions, just throwing ideas.

Below I'm adding concrete list of items that could be useful for monsters.
  • All wearable items, all melee weapons and shields, unless this is already the case. Ensure all modifiers are applied once equipped, for example intrinsics and prefix / suffix effects. Let monsters unequip non-cursed items to equip another once with better modifier sum. I'd give monsters, say +50% buff to all attribute gains from items.
  • Missiles and missile weapons are now generated every shot. Instead stacks of missiles could be given to archers and monsters with item throwing abilities. By the way this would make missile stacking less a problem.
  • Potions for both drinking and throwing and probably even dipping.
  • Items providing resistances / immunities should make monsters immune to relevant attacks.
  • Items increasing luck should increase chances to hit, to do a critical and stunning / bleeding hits and their chance to evade attacks.
  • Potions of healing, extra healing, ultra healing, bezio, troll blood, healing herbs and crystals of health should restore HP once damaged below certain point. Potions of cure poison to cure poison once poisoned and non-cursed bandages to cure bleeding (yep, give them cursed bandages before fighting :D).
  • Potions of poison could be used by monsters to dip their weapons (even if they have no actual weapons) to give them temporary poisoning attacks.
  • Scrolls and crystals of power, potions of raw mana, scrolls of charging by spellcasters and summoners to restore their casting powers.
  • Equipped amulet of life saving should save monster from dying and restore full HP.
  • All appropriate wands, notably magic missiles, lightning, trap creation, monster creation, wonder, light (blind PC at melee), stunning, paralyzation, death, poison, webbing, fireballs, earthquakes, acid, cold, fire, destruction, ball lightning and far slaying; scrolls of familiar summoning, monster aggravation, danger, increase melee accuracy, increase melee damage, defense, protection (last 4 should increase monster stats); potions of invisibility, -attribute-, potential -attribute-, gain attributes, -boost attribute-; and crystals of fire could be used occasionally.
  • Potions of poison, blindness, deafness, confusion, sickness, visibility (only if PC is invisible) and raw chaos could be thrown by monsters into PC.
  • Scrolls and wands of teleportation to teleport away on low HP.


A couple of weaker effects:
  • Thieves picks, keys and wands of knocking to lock / unlock locked doors. Let monsters unlock nearby doors occasionally and lock all doors behind if panicking. Wands of door creation and wands of digging could be used by panicking monsters as well.
  • Torches and amulets of light to light up the darkness and increase their perception despite it's pretty weak effect. Wands, scrolls and crystals of light could be used once stepping into dark square. Scrolls and crystals of darkness once panicking or if PC in melee range and monster has see in darkness ability.
  • Rings of searching should make monsters immune to traps.
  • Holy symbols specifically to frighten necromancer slaves if PC has such.
  • Protect monsters carrying fireproof / waterproof blankets from respective damage.
  • Let ElDeR cHaOs GoD to use chaos artifacts at full power. There was an RFE, I might link it here...


Below is list of monsters which could be generated with items:
  • Generate items once monster is generated, not once it is killed. It should generate some item users among all intelligent monsters.
  • Generate all archers / throwers with stacks of ammo instead of generating ammo every shot.
  • Give all doppelganger the same items PC has but dispose them once doppelganger dies.
  • Give items that restore mana to 50% generated summoners / casters (kobold shaman, annis hag, green hag, jackalwere, lich, dark sage and so on).
  • Give weapons / armor / shields to 50% higher monsters (hobgoblin leader, orc scorcher, hill giant, troll, stone giant, fire giant, frost giant, ettin, cyclops, fomorian giant, royal guardian, greater daemon, muscular dwarf, dwarven guardian and so on).
  • Give potions of poison and throwing daggers to 50% assassins.
  • Give to 10% intelligent monsters some useful items.
  • Give several items / stacks or affixed items to all intelligent boss monsters, arena opponents, named artifact guards and very high level monsters (kings, queens, emperors).
  • Give priest plain / holy water (restockable) and let him forgive several failed pickpocketing attempts (he is good and shouldn't be aggravated right away).
  • Give healer various potions of healing (restockable) and let him forgive several failed pickpocketing attempts (he is good and shouldn't be aggravated right away).
  • Give appropriate items to Vile Spirits.
Issue Details
Issue Number 4237
Issue Type Feature
Project ADOM (Ancient Domains Of Mystery)
Category All
Status Suggested
Priority 7
Suggested Version ADOM r65 (v2.1.0)
Implemented Version (none)
Milestone (none)
Votes for this feature 3
Votes against this feature 3
Assigned Users (none)
Tags (none)




01-21-2016 09:34 PM
Junior Member
All presented ideas are great...
Sorry to say but it will probably never happen.

beacouse:

- name one roguelike where monster can actually use creatively various items on their advantage... it seems like really BIG programming task (yes its about time and BIG money)
- adom team AFAIK is now focused mainly on BUGS and very (I mean VERY simple) game modifications. Also they only work at their FREE time.
- adom is written enirely in C so complicated modifications are not so easy to be done here.

Maybe some mad programmer will implement some of presented above features using JADE in 2025 but honestly I really doubt it...

01-21-2016 11:36 PM
Senior Member
This would make some vault layouts brutal. When I have a vault with the little interior room and I just one-at-a-time them through the doorway, each new monster would pickup and use all my loot!

01-22-2016 05:51 AM
ixi ixi is offline
Junior Member
There shouldn't be much troble. Monster inventories are already there. Monsters already capable to equip items. AFAIK even in some old games like Fallout 2 are using drugs, medicine, weapons and armor if they have with no much trouble. This RFE is big - yes, not easy - yes, very complex or impossible to implement - definetly no.

Quote Originally Posted by Kyreles
This would make some vault layouts brutal. When I have a vault with the little interior room and I just one-at-a-time them through the doorway, each new monster would pickup and use all my loot!
Yes, kinda evil but I do like it :)

01-22-2016 06:23 AM
Senior Member
> This would surely make fights more interesting. Fighting a hobgoblin leader that uses a wand against you must be more exciting than fighting regular one.
If you want an enemy that attacks you with spells, why not just make a "hobgoblin wizard" monster?

>This would make some monster drops (these unused items) more rewarding.
It will make other monster drops less rewarding, since the monster has used up all the charges of his wands and drank all the potions.

Nightmare scenario: monsters use up all the scrolls, potions and wands for themselves, so you get nothing... This is especially bad for the melee PCs - since they take much longer to kill any sizable group, monsters in it would have plenty of time to switch out, use all their items and leave you with no loot. Things like potions of healing are already rare enough...

01-22-2016 07:29 AM
Ancient Member
Sorry to say but it will probably never happen.
I'm not voting for or against, because of this. It's waaaay too much to ask for. Seriously. Try programming this yourself if you don't believe it..

01-22-2016 10:00 AM
Senior Member
Nethack has some of this stuff with monsters equipping weapons, zapping combat wands, and IIRC they will even zap a wand of digging through the floor to escape if you get them on low HP.

All the same, this RFE is a HUGE undertaking, especially for ADOM. And it's not just the technical implementation (which is massive in itself). There's also a huge number of balance issues that will come about. In Nethack, it's okay for monsters to zap you with wands of lightning and death because items that give magic resistance and reflection are frequently available. If you suddenly dropped everything in this RFE into the game, it would become considerably more difficult.

Maybe a couple of snippets could be used. 'Monsters to use combat wands' alone would be a big deal.

I believe some ADOM monsters can already equip some items? I'm pretty sure the ACW equipped a randomly dropped wooden shield in my last run. Some of this behavior might be suitable for boss monsters, limiting the balance issues throughout most of the game.

01-22-2016 10:00 AM
Senior Member
I guess some of these features would be nice. Ammo generation one comes to my mind. I hate picking up stacks of 1 ammo enemy leaves behind, but then again some quickling with humanoid slaying ammo, could potentially be a really nasty combination vs PC.

Also generating few monsters with added ability to "use" item would be easier to do than they actually using items they find. Hobgoblin leader could have extra ability to cast Darkness, which could make him likely drop Wand of Darkness or Spellbook of Darkness. Having ability doesn't mean you need to program monster to use wand charges for it, just create illusion of monster using it. Also monster picking up loot from vault floor could be hesitant to use items they pick up, because they are not familiar with them as it would most likely appear unidentified for them. Monster with resistance to confusion could just have extra chance to drop Ring of Mental Stability or something similar. This alone would bring extra challenge and diversity to monster encounters.

I voted yes. Idea is nice, I don't mean all of them needs to / can be implemented, but something similar to this is a nice idea.

01-22-2016 10:05 AM
Junior Member
Nice idea, but it's just not worth the huge effort to get it working properly. I'll just mension few hurdles.

-Even if coding the monster inventories were easy, which it's not, balancing the game after that would be horrible.
-You'd have to go through every monster in the game and alter their statistics and inventory and balance them all dozens of times.
-Creating a whole new AI that can use these items in right spots would be huge job for a team this small.
-Item drops would be unbalanced: there would be huge increase in permanent items and huge decrease in items with limited uses (eg. scrolls, wands, potions)
-Vaults and tensions rooms would be more dangerous. Early game too, where kobold can zap you with a wand of fire from out of your sight.

I agree that monster inventory would be an excellent addition (pickpocketing creates random items which are not on the creature if killed normally, very strange..), but monsters shouldn't be able to use it. Even if Biskup won the lottery and would hire 50 new codewriters, I'm not sure if'd still like the feature. The balance is there now and we shouldn't shake it.

01-22-2016 03:34 PM
ixi ixi is offline
Junior Member
Well, I didn't meant that items should be generated with the same rates as now, it would need balancing for sure.

Secondly I didn't meant that monsters would waste all their turns using items. Some monster are just unintelligent but I'm not asking to remove monster drops from them. Some items wouldn't find a use just due to conditions - no reason to drink potion of healing if at full HP, no reason to use wand of bolt if PC isn't in direct line, no reason to read scroll of light unless there is darkness... But even if there is a condition it should be only only a chance to use item. Better tweakable per item / monster.

And the thing I didn't told explicitly, I didn't meant all these things to be implemented at all and surely didn't meant all this to be implemented at one step. For example let's start with the healing gear and implement it in the simplest possible way. Let's start with the potions of healing. Here is the sample in pseudocode how I see it:
Code:
potion = monster.inventory.getItemByType("potion of healing id")
if (potion != null and monster.hp < 50% and random < 50%) {
    potion.dispose();
    monster.hp += 30;
}
Obviously this would be a lot longer in ADOM and some routines like getting item by type from monster inventory might not exists yet... But doesn't look too complex, right? Of course for making this reusable it would be better to add use probabilities to monster and item tables rather than hardcoding values to tweak it easier, would be better to store trigger conditions and use effects in a separate function and store pointers for them in item table as well... Final implementation could look like this:
Code:
if (!monster.inventory.isEmpty()) {
    items = shuffle(monster.inventory.items);
    for (item in items) {
        if (random < monster.useItemProbability * item.useByMonsterProbability && item.canBeTriggered(monster)) {
            item.useByMonster(monster);
            break;
        }
    }
}
+ implementation of all canBeTriggered / useByMonster functions for all items and respective probabilities for items and monsters.

Quote Originally Posted by grobblewobble
I'm not voting for or against, because of this. It's waaaay too much to ask for. Seriously. Try programming this yourself if you don't believe it..
I'm still starting with my own roguelike but implementing vision for monsters was a lot harder than any monster AI changes I did so far... including limited item use healing potions and several weapons are there...

01-22-2016 06:38 PM
Senior Member
Yes, but now remember that ADOM is not object-oriented and also things like the modern marvels of foreach loops don't exist, and there's likely fifty other reasons that make that complicated. Maybe the drinkPotion() function always uses the global player variable, so it would have to be changed to add a parameter to take a target, so you have to update every current location that calls drinkPotion(). Then you'd have to add a second drinkPotion() function since there's no polymorphism and they take in different structs. Now you're writing 200 lines of code and changing 30 functions. And that's just 1 hurdle to deal with, not including testing.

That said, I like the idea of some things being able to be used by monsters. I don't know if I like the idea of monsters dropping their inventory, as typically that leads to collecting a lot of items that are too similar instead of the intended distribution. Also, having a monster equip an amulet of life saving sounds clever but would be super obnoxious if you ever wasted one in-game because of that. I'd be more inclined to support a simple 'monster inventory' with 'monster items' with a significantly limited item pool. Potions of healing, rings of resistances, wands of stunning/magic missile, potion of invis, and other items of that caliber. That said, to my earlier point about preserving diverse drops, I would rather these be special "monster-only" variants of the items, so they wouldn't be dropped upon death (and use the normal rules for drops instead).

01-22-2016 07:00 PM
ixi ixi is offline
Junior Member
Come on, harpo, no need to change existing function except monster AI. No need to modify existing drinkPotion() and function like this, it's better to add a new one for monster interaction to avoid any nasty bugs. That means actually only monster AI needs regression, drinkPotion() mustn't be broken...

Yes, instead of foreach loop there will be old-school "for (int i = 0; 0 < size; ++0)", instead of "items = monster.inventory" there might be "Item * item = getMonsterInventory(monsterId);", of course the will be bunch of mallocs and deletes but there concept stays the same, no matter if there're OOP or not. It's just more lines of code to write and maintain. And looks uglier. On the other hand in C you can use pointers to function which isn't possible for example in Java...

Edit: nope, I'm not suggestion The Creator how to write code, I'm just really sure it's not over-complicated even in ADOM.

01-23-2016 12:47 AM
Ancient Member
Quote Originally Posted by ixi
There shouldn't be much troble. Monster inventories are already there. Monsters already capable to equip items. AFAIK even in some old games like Fallout 2 are using drugs, medicine, weapons and armor if they have with no much trouble. This RFE is big - yes, not easy - yes, very complex or impossible to implement - definetly no.
No, monsters do not have real inventories in ADOM. The items that monsters drop do not exist until they are killed. TB has indicated that he has no plans to add monster inventories to ADOM as it would be a nightmare to program.

01-23-2016 08:24 AM
ixi ixi is offline
Junior Member
Quote Originally Posted by JellySlayer
No, monsters do not have real inventories in ADOM. The items that monsters drop do not exist until they are killed. TB has indicated that he has no plans to add monster inventories to ADOM as it would be a nightmare to program.
Nope, they're in ADOM. That's why monsters picking up and equiping items. You can test yourself anytime but I doubt you never saw it through regular gameplay.

01-23-2016 10:36 AM
Ancient Member
Quote Originally Posted by ixi
Nope, they're in ADOM. That's why monsters picking up and equiping items. You can test yourself anytime but I doubt you never saw it through regular gameplay.
They have pseudoinventory (mostly cause otherwise they could pick up artifacts, orbs and would not drop on kill). If you want to try:
launch mode with wand of wishing
wish for crown of fire and fire wands
drop crowns
wish for regular mob (like orc)
get him to pick up and equip crown of fire
zap him with wand of fire
collect crown from his burnt body.

Outside of DV/PV equipped items are not working. Now, imagine what complicated things you are proposing....

01-23-2016 07:06 PM
Ancient Member
I reported some of the most serious issues here. With that said, I believe the official stance is that the game should have been designed with monster inventories from day zero for them to be viable, and thus any serious implementation will be left for ADOM II.

+ Reply