Aller au contenu

Photo

Kamal's Commoner AI Demo/Proof of Concept


  • Veuillez vous connecter pour répondre
47 réponses à ce sujet

#26
kamal_

kamal_
  • Members
  • 5 240 messages

DannJ wrote...

kamal_ wrote...

Any improvements people make, please submit and I can add it and give you credit!


I've uploaded various VFX that replace the need to create and equip hand-held items:

http://www.neverwint...ds.com/mods/173

Drinking animations now have the choice of beer stein, wine bottle (chianti) or chalice.

It's a lot easier applying and removing model FX attached to the hands than it is spawning items in the inventory and equipping them.

Just saw this. It definitely fixes a problem of the lack of equippables like books. Would it be possible to get a small variety of books, don't want to make everyone reading the same book. :lol:

#27
rjshae

rjshae
  • Members
  • 4 485 messages
Slicker than snail snot!

#28
kamal_

kamal_
  • Members
  • 5 240 messages

rjshae wrote...

Slicker than snail snot!

That's a good thing... right? :lol:

I hope this means you've tried it.

#29
Dann-J

Dann-J
  • Members
  • 3 161 messages
There only appears to be one book model designed as an equipable item. It seems there were a lot of animation-related equipable items originally planned for the game, but the stein and spoon appear to be the only ones that made it through. That's probably why the rake model is upside down, and the chianti bottle has the origin in the wrong place (which I fixed in the VFX by offsetting it). Then again, even the spoon has the origin at the very bottom of the handle (something else I fixed in the VFX version).

I've tried using some of the placeable item models, but they all seem to have been created at a slightly exaggerated scale that makes them look unusually large in a character's hand. It's a pity you can't scale model VFX.

#30
rjshae

rjshae
  • Members
  • 4 485 messages

kamal_ wrote...

rjshae wrote...

Slicker than snail snot!

That's a good thing... right? :lol:

I hope this means you've tried it.


Beats a beholder's bare bum, that's for certain. B) I just had a look at the pic, but I will definitely want to try these out, particularly for the public spaces in my setting. Thanks.

I have a quick (and possibly stupid) question: do the Commoner AI scripts integrate with Tony_K's AI scripts? I'd like to figure out how to make a set of hostile humanoids behave like grenadiers (using alchemical grenades), so I'm hoping Tony's work will provide the means.

Modifié par rjshae, 21 juin 2012 - 08:15 .


#31
kamal_

kamal_
  • Members
  • 5 240 messages

rjshae wrote...

kamal_ wrote...

rjshae wrote...

Slicker than snail snot!

That's a good thing... right? :lol:

I hope this means you've tried it.


Beats a beholder's bare bum, that's for certain. B) I just had a look at the pic, but I will definitely want to try these out, particularly for the public spaces in my setting. Thanks.

I have a quick (and possibly stupid) question: do the Commoner AI scripts integrate with Tony_K's AI scripts? I'd like to figure out how to make a set of hostile humanoids behave like grenadiers (using alchemical grenades), so I'm hoping Tony's work will provide the means.

Commoner ai doesn't have anything to do with Tony_K since my ai is not comabt ai. The only regular script that my commoner ai uses is a new npc heartbeat, so tony_k's changes to the default scripts would affect all commoners, except for his changes to the heartbeat script, which would not be used.

You want Lugaid's combat formation demo for grenadiers. It will do exactly that, and that's what it's designed for.

#32
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
Actually, all the grenade-throwing is handled using a 'special tactics script' that gets called by a hook in the heartbeat. The Imperial grenadiers toss a grenade as they close with the enemy, but the goblin bannocks in tDU have a little hit-n-run routine they go through. All the throwing is faked through the script, I never could get the things to use a special ability off the character sheet, Tony K, I think manages that a bit better.

#33
rjshae

rjshae
  • Members
  • 4 485 messages

kamal_ wrote...

Commoner ai doesn't have anything to do with Tony_K since my ai is not comabt
ai. The only regular script that my commoner ai uses is a new npc
heartbeat, so tony_k's changes to the default scripts would affect all
commoners, except for his changes to the heartbeat script, which would
not be used.

You want Lugaid's combat formation demo for grenadiers. It will do exactly that, and that's what it's designed for.


Thanks Kamal_.

Lugaid of the Red Stripes wrote...

Actually, all the grenade-throwing is handled using a 'special tactics script' that gets called by a hook in the heartbeat. The Imperial grenadiers toss a grenade as they close with the enemy, but the goblin bannocks in tDU have a little hit-n-run routine they go through. All the throwing is faked through the script, I never could get the things to use a special ability off the character sheet, Tony K, I think manages that a bit better.


Yes, I was worried that I might have to do a custom AI for that. :blush:

Hmm... a thought occurs to me. Maybe I could create a hide with the same tag as the item to be tossed and add charges for special abilities of the appropriate type. The AI may treat it like a magic using item. I'll have to see if the combat AI checks that slot. Bzzt, not an option. Sigh. I ended up faking it with a custom dart that periodically delivers a random alchemical effect.

Thank you.

Modifié par rjshae, 23 juin 2012 - 02:39 .


#34
kamal_

kamal_
  • Members
  • 5 240 messages

DannJ wrote...

There only appears to be one book model designed as an equipable item. It seems there were a lot of animation-related equipable items originally planned for the game, but the stein and spoon appear to be the only ones that made it through. That's probably why the rake model is upside down, and the chianti bottle has the origin in the wrong place (which I fixed in the VFX by offsetting it). Then again, even the spoon has the origin at the very bottom of the handle (something else I fixed in the VFX version).

I've tried using some of the placeable item models, but they all seem to have been created at a slightly exaggerated scale that makes them look unusually large in a character's hand. It's a pity you can't scale model VFX.

Screenshot of the initial integration testing of the Handy VFX pack, you can ignore the debug messages, the number tracks where in the scripting it's coming from, not which vfx. Amusingly, I forgot to remove the equipping of the spoon in my first test of the cooking, so the npc's equipped one and had the vfx one, making it easy to see the offset.

500x250http://2.bp.blogspot.com/-Zkbk3hq3O0U/UAxTJoFcJgI/AAAAAAAABNc/iLcZh3e9cMI/s1600/NWN2_SS_072212_152142.jpg[/img]

It was pretty straightforward to get working.

Modifié par kamal_, 22 juillet 2012 - 11:45 .


#35
kamal_

kamal_
  • Members
  • 5 240 messages
Handy VFX integration complete, demo and readme updated. The readme now includes information on adding new vfx for activities if someone has vfx they'd want to use with this. The demo currently shows off the activities with Handy VFX, and the Woodsman activity to show the vfx removal in a non Handy activity.

Cooks use a spoon, readers read a book, drinkers, bartenders and barmaids select and use one of the drink container VFX. Activities with multiple animations are supported, so you can have your cook using a spoon, then "putting the spoon down" (removing the vfx) while they yawn, then pick up and continue using the spoon.

Modifié par kamal_, 23 juillet 2012 - 09:35 .


#36
kamal_

kamal_
  • Members
  • 5 240 messages
readme and demo updated:

I identified why TrainingOne and TrainingTwo don't play animations, also identified why Assassin doesn't work. Readme now explains what's needed for these, as they require additional work by the builder. Some extra clarity in a few things in the readme as well.

Wandersweep now equips the Handy VFX rake, since there's no broom. Yes it's upside down, see DannJ above. It's the Obsidian model, not DannJ's fault.
Npcanimate and Animatecustom now have default animations assigned (talk normal). You can edit the function to change them if you want.
Shovel and RunToPostAnd Dig now equip the "shovel" model of the quarterstaff. NWN2 shovels are incredibly ornate, but this is better than nothing.RunToPostAndDig still walks, so these two activities are functionally the same.

Not all races play the shovel animation correctly. This is a known game bug. The small races don't visibly equip, and the half orc wields it across the body. Added a note to this effect in the readme.

PracticeRanged and PracticeMelee still needs some work. Wanderrandomly still does strange things. Haven't looked further into these yet.

Witnessed the poor performance someone mentioned. I'll need to track that down, probably a loop that's not getting broken out of.

#37
rjshae

rjshae
  • Members
  • 4 485 messages

kamal_ wrote...
Not all races play the shovel animation correctly. ... and the half orc wields it across the body.


Poor sod probably thinks it's a greatsword.

#38
Dann-J

Dann-J
  • Members
  • 3 161 messages
Smaller races would need the Monkey Grip feat in order to equip two-handed items. You could try giving them the feat as part of the equipping process, and optionally removing it again when you remove the shovel. Or just ensure that all small-race commoners using the system have the feat to begin with.

Modifié par DannJ, 24 juillet 2012 - 03:28 .


#39
kamal_

kamal_
  • Members
  • 5 240 messages
Ok, fixed the small races not equipping the shovel. They are granted monkey grip as part of the first run through an activity that requires shovelling, and the feat is removed when they disarm at the beginning of their next activity. Doing it that way prevents them from having monkeygrip while doing other activities, such as the woodsman activity, so they correctly wield the handaxe for woodsman in both hands as they normally would. Readme updated to remove the reference to them not equipping the shovel. Demo updated, small race shovelling now visible.

#40
kamal_

kamal_
  • Members
  • 5 240 messages
Half orcs just don't understand the concept of shoveling. :lol: This is the animation bug I was referring to earlier for them.
500x250http://2.bp.blogspot.com/-nWszCEd3u7U/UBBtZ574xVI/AAAAAAAABN0/6r2qe-t6EJo/s1600/NWN2_SS_072512_173841.jpg[/img]

Time randomization is now turned on. Notice they're not all synchronized in their alcoholism. ;)
500x250http://4.bp.blogspot.com/-9g2vsZaGoE8/UBBtbbiAhDI/AAAAAAAABN8/sMe8TsT4uhM/s1600/NWN2_SS_072512_180342.jpg[/img]

Time and location randomization is controlled by the script sh_npc_randomizer. Time randomization is a default flat distribution (controlled by an int declared in the script, but two different bell curve options are included and commented out. Turning on the time randomization also seemed to significantly help or eliminate the lag some people found. There's still a loop somewhere I haven't found in activity selection, but since the selection is now time randomized, they don't all hit it at once.

RunToPostAndDig doesn't seem to equip properly, even though Shovel does. Haven't figured out why, or why they're not actually running.

I'm going to have to put in some setting of bump state. If the commoners get bumped too far from their waypoint, they stop playing the animation.

Modifié par kamal_, 25 juillet 2012 - 10:22 .


#41
Dann-J

Dann-J
  • Members
  • 3 161 messages
Half-orcs don't shovel. They bully others into doing it for them.

#42
PJ156

PJ156
  • Members
  • 2 982 messages
To me it looks like he is bowing while trying, and failing, to hide a shovel behind his back.

That, I think, defines nicely the nature of the half orc and also the average intelligence.

PJ

Modifié par PJ156, 26 juillet 2012 - 11:27 .


#43
kamal_

kamal_
  • Members
  • 5 240 messages
Ok. I redid the code for activity decision making, you should see better speed in general during the decision making process.

Also I identified exactly where the speed hiccup is, it happens when all the waypoints for an activity are full and then another npc picks the same activity. It doesn't look to be avoidable in terms of coding (unless I missed something, easily possible). So if you see this behavior in practice, setting some more activity waypoints for that activity should do it. It also seems to happen more or be worse when you set the time as opposed to the normal progression of time during normal gameplay. Of course in the demo we're setting time via conversation as part of the demo.

Need to fix up PracticeRanged, PracticeMelee, and Wanderrandomly. Once I get those working properly I'll probably put up the 1.0 release and an importble erf.

I will be making PracticeMelee randomly equip a dagger, shortsword, club, or light hammer if the npc doesn't have a weapon already. These seem like ok weapons for commoners to use. Ranged to equip a light crossbow, heavy crossbow, dart, sling (these are all covered by simple weapon proficiency)?

Modifié par kamal_, 28 juillet 2012 - 07:22 .


#44
kevL

kevL
  • Members
  • 4 056 messages
short sword not covered, nor light hammer

mace, morningstar, spear, sickle & quarterstaff are (in addition to the others)

#45
kamal_

kamal_
  • Members
  • 5 240 messages

kevL wrote...

short sword not covered, nor light hammer

mace, morningstar, spear, sickle & quarterstaff are (in addition to the others)

Yep, I caught that. melee options are now club, mace, spear, and dagger. Ranged options are light crossbow, heavy crossbow, dart, sling. These are all simple weapon proficiency weapons. They also play animations appropriate to the weapon (spear guys use the polearm animations, club uses 1 handed, etc). It's in and working, they face the direction of the waypoint and play the various attack animations. The weapons they equip for practice are defined in a single place, so builders could change. (and you'd need to update the the activity functions for the appropriate animations if you equip two handers or bows etc)

I need to fix WanderRandomly now.

#46
rjshae

rjshae
  • Members
  • 4 485 messages

DannJ wrote...
I've uploaded various VFX that replace the need to create and equip hand-held items:

http://www.neverwint...ds.com/mods/173


I wonder if something like this would work on the invisible man appearance? It could be useful for creating animated objects, per the spell.

Modifié par rjshae, 30 juillet 2012 - 08:43 .


#47
kamal_

kamal_
  • Members
  • 5 240 messages

rjshae wrote...

DannJ wrote...
I've uploaded various VFX that replace the need to create and equip hand-held items:

http://www.neverwint...ds.com/mods/173


I wonder if something like this would work on the invisible man appearance? It could be useful for creating animated objects, per the spell.


Just tried. The book vfx is visible in toolset when applied to the invisible man, but not ingame.

#48
rjshae

rjshae
  • Members
  • 4 485 messages

kamal_ wrote...
Just tried. The book vfx is visible in toolset when applied to the invisible man, but not ingame.


Argh! Oh well, thanks for trying. It would have been amusing to have some animated objects dancing about a wizard's abode.