Jump to content
The Dark Mod Forums

Call to Arms


Destined

Recommended Posts

Hi guys,

 

I would like to have an unarmed AI that flees (as thy usually do) to a flee point and upon reaching the flee point arms itself. After that I want it to patrol instead of returning to its former sitting place. The latter can be done by using a "alert_idle_only" waypoint and the flee point is also no problem. With a trigger around the flee point, the whole thing can be started. However, for the "arming an AI" itself I am stumped. Would it suffice to def-attach a weapon (i.e. does a def-attached weapon change the behaviour from flee to fight)? If so, what would be the syntax to do that? I think def-attach is not possible via the S/R-system and my scripting skills are still very basic, which is why I would need a hint there and .

This could later also be used for sleeping AI, as I find it a bit unrealistic that the AI go to sleep with the weapon on their belt...

 

Thanks in advance,

Destined

Link to comment
Share on other sites

I would probably do it like this:

1) AI runs to flee point

2) flee point has a trigger_once_entityname, which notices the fleeing AI.

3) the trigger runs a script that deletes the fleeing AI

4) the script spawns in a new, armed version of the AI.

5) the new, armed AI goes on patrol.

 

I dunno what extra would all this work give to gameplay, though.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

It reminds a bit of Hitman: Blood Money, where civilians picked up weapons by killed guards. It might be quiet nice if a civilian in TDM either arms themself or pickup weapons knocked out or killed guards have dropped. Also the idea of a guard that drops his weapon when going to sleep seems reasonable to me, both for immersion and gameplay. This would add some extra differences between sleeping and awaken ai in TDM, and an accidently woken up ai would be a different type of threat to the player. If the ai has to pick up his weapon first, the player gets the chance to flee, instead of having to reload for example. ;)

 

It's worth trying it out imho.

 

The easiest way to achieve this effect would be to alter the scriptobject of the ai (I know, I always use the word easy, forgive me :blush: ). There are a few things that needs to be processed here. The civilian must be turned into a non-civilian, which might not be as easy doable. I have a rough idea on how to get this working, so if you want me to I can try to set this up.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

I would probably do it like this:

1) AI runs to flee point

2) flee point has a trigger_once_entityname, which notices the fleeing AI.

3) the trigger runs a script that deletes the fleeing AI

4) the script spawns in a new, armed version of the AI.

5) the new, armed AI goes on patrol.

 

I also thought about simply exchanging the AI, but I don't know how to transfer the alarm state from the fleeing AI to the newly created one. This was the reason I thought maybe def-attaching a weapon would suffice as this appeared to be easier.

 

I dunno what extra would all this work give to gameplay, though.

I am aware that there are not too many instances, where this scenario is actually applicable. In my WIP, the respective AI will most likely not be alarmed or KOed in 90% of cases. But still, I find it more immersive, if some civilians would not just flee in fear if they can find a weapon, but rather only flee, because and as long as they are unarmed. You can think of it as another set of mind for the AI. There are some that will always flee, regardless of having arms available, and some who will fight, when given the opportunity. Also, this could be used in another scenario, where the player can scout the whole complex relatively undisturbed, but at some point (e.g. through a tiggered alarm) the AI become armed and dangerous. It is another way to add some more consequences to the player's behaviour or change the difficulty of the whole level at some point.

 

 

It reminds a bit of Hitman: Blood Money, where civilians picked up weapons by killed guards. It might be quiet nice if a civilian in TDM either arms themself or pickup weapons knocked out or killed guards have dropped. Also the idea of a guard that drops his weapon when going to sleep seems reasonable to me, both for immersion and gameplay. This would add some extra differences between sleeping and awaken ai in TDM, and an accidently woken up ai would be a different type of threat to the player. If the ai has to pick up his weapon first, the player gets the chance to flee, instead of having to reload for example. ;)

 

It's worth trying it out imho.

 

The easiest way to achieve this effect would be to alter the scriptobject of the ai (I know, I always use the word easy, forgive me :blush: ). There are a few things that needs to be processed here. The civilian must be turned into a non-civilian, which might not be as easy doable. I have a rough idea on how to get this working, so if you want me to I can try to set this up.

The extra time a sleeping AI needs between getting up and arming itself was also something I had in mind here.

Of course, you can try to set it up if you like. However, if it is too much work, Sotha might be right, that it is actually not worth the effort. I just had this idea for a specific AI in my WIP and got carried away. I can also have a look at the scriptobject of the AI. I am not sure, if it will be of any use, but hopefully I will at least get some idea about the AI behaviour and how to set up something like this.

For a complete behavioural change, I would suggest the following, but this would really be a lot of work (while writing this, I got carried away again :blush: ): Check if the AI is willing to fight (unarmed guards will be, of course, but other civilians might not be; could maybe be set via a new spawnarg). If the AI is willing to fight and unarmed, it will behave like a regular unarmed AI. If an AI of this type sees a weapon (this can already be handled, as AI can be alarmed by weapons on the ground), the AI picks it up (aren't AI already able to pick up e.g. lamps? Otherwise an additional animation would be needed) and changes to armed and non-civilian.

Link to comment
Share on other sites

For my immersion, when AI goes to sleep, it would not help if the AI removed his weapon, but does not remove his armor, headgear, and shoes.

 

Therefore, perhaps a logical and feasable (but not easy) way to do this would be to make an AI wardrobe/ privacy screen. The AI goes in there, player does not see in it, the AI plays a general swap gear anim (like hitman games). Then the armored, armed AI is swapped for unarmored, armless AI.

 

You could use this "clothing booth" the other way around, too. Unarmed unarmored civilian flees inside it, swappety-swap, out comes an armored AI, armed to the teeth.

 

With scripting you can do a lot. You do not even need to copy the alerted unarmed AI alert state. Just teleport in an armed AI whi already has the sword in hand.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

The part with the armor is a good point.

 

However, I did some testing and found out that the ai behaviour depends on whether it has a weapon or not. So the ai "knows" whether he or she is armed and will act accordingly. I thing this will make things way more easier. I've also found an appropiate animation. So overall it seems doable. :)

 

Maybe this sleeping thing isn't something that we rally need, but unarmed ai arming themselves when in danger seems both logical in terms of gameplay and immersion. I mean, if someone is going to attack you and there is a weapon lying in front of you you would probably grab it.

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

However, I did some testing and found out that the ai behaviour depends on whether it has a weapon or not. So the ai "knows" whether he or she is armed and will act accordingly. I thing this will make things way more easier. I've also found an appropiate animation. So overall it seems doable. :)

I wonder whether the same would work in reverse, like in TDS where you could steal spellcasters' wands from their belts while they were still unalerted.

 

"Taste my dagg-- oh ****, where did that go?"

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

I agree with both of you. For the sleeping AI, a skin change would be appropriate, but this is really not worth the effort.

 

 

However, I did some testing and found out that the ai behaviour depends on whether it has a weapon or not. So the ai "knows" whether he or she is armed and will act accordingly.

So, if I understand that correctly, for my WIP a def-attach would suffice?

 

However, I did some testing and found out that the ai behaviour depends on whether it has a weapon or not. So the ai "knows" whether he or she is armed and will act accordingly. I thing this will make things way more easier. I've also found an appropiate animation. So overall it seems doable. :)

 

[...], but unarmed ai arming themselves when in danger seems both logical in terms of gameplay and immersion. I mean, if someone is going to attack you and there is a weapon lying in front of you you would probably grab it.

I also think, this behaviour would be sensible. Still, it should be depending on the "personality" of the AI. If I am completely inexperienced with weapons, I would rather flee than try to fight an opponent that surely has a lot more experience than I have. So the regular maid in a mansion would most likely not take up arms, but a nobleman with fencing training might. If AI can pick up weapons, I think it would also be nice, if you could disarm your opponent. Something like a disarming maneuver during fighting, that gives you time to run. Or what VanishedOne just wrote, while I was typing. If the player cannot add the stolen weapons to his inventory, the AI would still have access (assuming, that it can find it). This, however, would definitely be a load of work.

Link to comment
Share on other sites

 


So, if I understand that correctly, for my WIP a def-attach would suffice?

Not only, you also have to tell the engine that the ai is no civilian anymore and is able to draw a weapon. But it works vice versa, remove the weapon and the ai will flee.

 


I think it would also be nice, if you could disarm your opponent.

Maybe by shooting the ai in the right hand :)

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Hm.. Obst, if you manage to get the AI to identify weapons lying on the ground, pick them up and wield them, that would enable various other kind of behaviors.

 

Pick up candle the candle the player toppled from the floor, light it, and put it in the original position.

 

Or

 

When agitated and searching, pick up nearby candle and use it while searching. When relaxed, put candle back.

 

Animations can always def_attach items on AI, but how to delete the corresponding item from the floor?

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I think it is possible to attach an object in the game to the hand. If I remember correctly, the eating animation has two options: take food lying around or def_attach an apple. But I will have to look this up later this evening, I currently don't have access to the files.

 

Edit: found it in the Wiki (frame commands):

 


pickup Find the entity with the given name, then attach it as the named attachment at the given position. See this article for more information.

 

Are AI able to pick up light sources, that they dropped, when they got agitated? I mostly avoid light carrying guards, which is why I am not sure... If they are, the system might be a good basis for this behaviour, if not, this may also be implemented with this system.

Edited by Destined
Link to comment
Share on other sites

Maybe by shooting the ai in the right hand :)

There is also a "putdown" frame command. If we could call on this frame command, when the AI gets a damage stim on the weapon hand, it would drop the weapon. This would also enable disarming in combat, if the player gets to hit the hand with his sword (which should be quite difficult and thus can not be exploited too easily).

Link to comment
Share on other sites

Pick up candle the candle the player toppled from the floor, light it, and put it in the original position.

 

Or

 

When agitated and searching, pick up nearby candle and use it while searching. When relaxed, put candle back.

http://forums.thedarkmod.com/topic/14394-apples-and-peaches-obsttortes-mapping-and-scripting-thread/?p=310607

 

Hm.. Obst, if you manage to get the AI to identify weapons lying on the ground, pick them up and wield them, that would enable various other kind of behaviors.

Weapons are using a visual stim, which the ai uses to recognize them. This is normally used to make the ai suspicious if they stumble over a weapon of an ai which you might have taken down and hidden, but left the weapon behind.

 

There is also a "putdown" frame command. If we could call on this frame command, when the AI gets a damage stim on the weapon hand, it would drop the weapon. This would also enable disarming in combat, if the player gets to hit the hand with his sword (which should be quite difficult and thus can not be exploited too easily).

In this case it might also be worthwhile making this controllable via a spawnarg, which would have two advantages:

  1. It wouldn't affect existing FM's, which weren't created with this back in mind
  2. You could differ between guard types, so that elite guards for example cannot be disarmed opposed to default guards.

I'll have to make further investigations on how this could be implemented. I will report back once I come up with anything. :)

  • Like 3

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

In this case it might also be worthwhile making this controllable via a spawnarg, which would have two advantages:

  1. It wouldn't affect existing FM's, which weren't created with this back in mind
  2. You could differ between guard types, so that elite guards for example cannot be disarmed opposed to default guards.

I'll have to make further investigations on how this could be implemented. I will report back once I come up with anything. :)

Again, I agree. The main clue if an AI is disarmable or not could be if the hand is in gloves/armoured gloves or not.

Link to comment
Share on other sites

Maybe by shooting the ai in the right hand :)

Little problem here. There seem to be no way to find out where the ai was hit. :( Any suggestions are appreciated.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Maybe disarming could be linked to pain instead...? AI have a "pain_threshold" spawnarg, described as 'How much damage monster has to receive in one blow for it to play a pain animation', though a quick glance suggests that it tends to be "1": apparently even Revenants feel pain. So it might be thought undesirable to start making changes to those settings. Hmmm.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

Hm.. Obst, if you manage to get the AI to identify weapons lying on the ground, pick them up and wield them, that would enable various other kind of behaviors.

 

Pick up candle the candle the player toppled from the floor, light it, and put it in the original position.

 

Or

 

When agitated and searching, pick up nearby candle and use it while searching. When relaxed, put candle back.

 

 

I could swear someone already had this behaviour working.

 

edit: http://forums.thedarkmod.com/topic/14394-apples-and-peaches-obsttortes-mapping-and-scripting-thread/?p=310607

Link to comment
Share on other sites

Maybe disarming could be linked to pain instead...? AI have a "pain_threshold" spawnarg, described as 'How much damage monster has to receive in one blow for it to play a pain animation', though a quick glance suggests that it tends to be "1": apparently even Revenants feel pain. So it might be thought undesirable to start making changes to those settings. Hmmm.

I believe, this would be too powerful. Especially if the threshold is usually at "1". If I am not mistaken, Revenants have a pain threshold, but no pain animation. So they feel pain, they just don't show it ;)

Little problem here. There seem to be no way to find out where the ai was hit. :( Any suggestions are appreciated.

This is strange. We have several spawnargs that suggest the existence of a hit zone system (although they might be a relict from Doom). Examples are damage_mult_*, damage_scale_*, and damage_zone_* spawnargs. Especially, the damage_zone should give us something. I do not know, if these are used by the code, but they are defined, at least.

 

Edit: Maybe the damage calculation could give us a hint, how the damage_zone is determined. Also, the KO determines, if the AI is hit on the head (KO-box) or somewhere else.

Edited by Destined
Link to comment
Share on other sites

There are seperate damage zones, true. The problem is that I can't access these informations via script, as the code doesn't provide an interface for that purpose. So it either would need to be added or a workaround (a.k.a. hack) would be needed.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

This reminds me of a discussion a while back, when I was asking whether an entity could detect how it was hit, e.g. for tapestries that could be slashed with the sword but not react the same way to the blackjack or broadheads (since we don't have Thief's SlashStim, BashStim and PokeStim).

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

I couldn't believe it, but you are right. We have a variety of damage types, but these are distinguished by the source (although there is also a "low" damage type).

 

It is a shame, that the damage zone cannot be determined by script. Still, maybe the rest can be done; e.g. that an unarmed AI may pick up a weapon.

Link to comment
Share on other sites

That should be doable.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...