Jump to content


Photo

Revamping party AI


  • Please log in to reply
14 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 15 June 2017 - 05:46 PM

You know how party characters act out their scripts if the AI is on and how they don't when it's off? Well, that has got to do with the way the party AI is set to work, which is not the best way. It just steals control over the characters from you instead of helping you. But you can change the setup, if you target them with effect 82 and assign a custom script - I can vouch for override-level scripts, anyhow. They will carry out those orders even when the AI is disabled. Just give them a second. And, properly for an override script, it will block any personal and special scripts they might have on the tiers below. I don't know at what level scripts are set that you can select in characters' profiles, but I believe that no NPC comes with anything in the override slot. Hell, I'll swear now that they have nothing there, or we would see some weird behavior!  :lol2: No script there normally means you can put what you like in there and phase it out later the same way, if you want.

 

Incidentally I was able to get my thief to stop looking for traps and illusions all the time with this. I just wrote:

 

IF

 

ActionListEmpty()

 

THEN

RESPONSE #1

 

NoAction()

 

END

 

Got him to calm down. Could probably get him to try and hide when not already hidden or something, but I prefer him off auto. And it doesn't impose anything over other actions or override your mouse clicks. Not like with AI on, when you have to click the party away every second, they are like rabid dogs. This ActionListEmpty() thing only comes in when there is nothing on the agenda - it is really friendly.



#2 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 16 June 2017 - 12:23 AM

I believe that no NPC comes with anything in the override slot.

 

I think you might wanna check again...


Retired from modding.


#3 temnix

temnix
  • Member
  • 983 posts

Posted 16 June 2017 - 05:39 AM

There is nothing to check. If they had a script there, it would execute continuously even with the AI button off. And that would not be hard to notice, would it?



#4 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5155 posts

Posted 16 June 2017 - 08:45 AM

There is nothing to check. If they had a script there, it would execute continuously even with the AI button off. And that would not be hard to notice, would it?

Yeah... and for example, how do you suppose the NPCs start dialog's with the player ? Or anything special...

And you can't check the checks, only the successful accomplished actions that are result of the successful checks, and that only with a debug tool like the LStest...

Aka, if for example Sarevok dies, and the character has a script assigned to the slot to makes a happy dance animation... the animation will never happen if you overwrite the Override script .. that's generally bad as it might not be just a happy dance animation that won't happen, but something more critical.

Say some Paladin NPC finding that you just eliminated their God.. and nothing.


Edited by The Imp, 16 June 2017 - 08:53 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#5 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 16 June 2017 - 02:20 PM

There is nothing to check. If they had a script there, it would execute continuously even with the AI button off. And that would not be hard to notice, would it?

 

I'm not sure what exactly you mean by continuously, which shouldn't normally happen unless you put in there something like IF True() THEN RESPONSE #100 DisplayStringHead(Myself,123) END, but joinable NPCs in BG games has their own override script that they keep in and out of party. Tutorial and multiplayer character are probably an exception.

If you observe different behavior, then either there're some BG1 characters without one as well (I'm judging by BG2 and SoD, where every single NPC has a script assigned), or it's something happening on you end.


Retired from modding.


#6 temnix

temnix
  • Member
  • 983 posts

Posted 17 June 2017 - 05:23 PM

Well, you're right. They have scripts that don't start with True(), so they only activate occasionally. All right then, this is what needs to be done:

 

1) For scripts under Override, whether custom scripts of the NPC or the the ones you can assign yourself, add Wait(2) to the end of action blocks. This way the NPC will pause before the next action and give you a chance to interfere. The problem now is that actions follow non-stop. You may approve of Edwin casting Stoneskin on himself, but then he next blasts the nearest enemy with MM, not at all what you want him to do. This is what takes control away from the player. With a Wait(), you'll be able to pause the game and assign orders without losing that time or having to catch party members before they do something stupid.

 

I don't really know why the designers like to stick everything in high script tiers: Override and Class. Race and General are almost always empty. Think about what dowgrading those scripts would accomplish: you could assign an empty script like the one above to override. What it does is guarantee that nothing will happen with the NPC and your own character so long as you are ordering them about. Or maybe the existing Override scripts could just be topped with the above.

 

2) If you want to insert functions like stopping the thief searching and be sure that nothing is disrupted... which is not going to matter for your own character, anyway: the protagonist has got nothing in the Override slot, so you can confidently put the above in there... but a solution for everyone: use the Area script tier. I've written about it before. It's just under Override, and you can put a custom script there with effect 82.



#7 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 17 June 2017 - 06:22 PM

They have scripts that don't start with True()

Even though it's in override slot? If it happens, there's either external interference or some blocker at the top of script. This is not how things normally work.

 

This is what takes control away from the player.

Also this is why I only use default AI script for party members, and none for pure spellcasters.

 

I don't really know why the designers like to stick everything in high script tiers: Override and Class. Race and General are almost always empty. Think about what dowgrading those scripts would accomplish: you could assign an empty script like the one above to override. What it does is guarantee that nothing will happen with the NPC and your own character so long as you are ordering them about. Or maybe the existing Override scripts could just be topped with the above.

I hope you're joking. If something was put into override slot, it was meant to have higher priority than other things.

Race and General are usually empty because there wasn't much scripting going on in vanilla games, especially BG1. If you look at SoD actors, they often have override slot dedicated to individual per-creature plot scripting, Class to the group per-faction general behavior, Race to general AI, and General to class-specific combat AI. Some even use Default.

 

the protagonist has got nothing in the Override slot.

He gets assigned one in SoD. Although it does nothing besides to open QA dialog window.


Edited by GeN1e, 17 June 2017 - 06:24 PM.

Retired from modding.


#8 Roxanne

Roxanne

    Modder

  • Member
  • 3564 posts

Posted 17 June 2017 - 10:59 PM

They have scripts that don't start with True()

Even though it's in override slot? If it happens, there's either external interference or some blocker at the top of script. This is not how things normally work.

 

This is what takes control away from the player.

Also this is why I only use default AI script for party members, and none for pure spellcasters.

 

I don't really know why the designers like to stick everything in high script tiers: Override and Class. Race and General are almost always empty. Think about what dowgrading those scripts would accomplish: you could assign an empty script like the one above to override. What it does is guarantee that nothing will happen with the NPC and your own character so long as you are ordering them about. Or maybe the existing Override scripts could just be topped with the above.

I hope you're joking. If something was put into override slot, it was meant to have higher priority than other things.

Race and General are usually empty because there wasn't much scripting going on in vanilla games, especially BG1. If you look at SoD actors, they often have override slot dedicated to individual per-creature plot scripting, Class to the group per-faction general behavior, Race to general AI, and General to class-specific combat AI. Some even use Default.

 

the protagonist has got nothing in the Override slot.

He gets assigned one in SoD. Although it does nothing besides to open QA dialog window.

 

@GeN1e

This is looking at the scripts and hierachy from the AI point of view only. It ignores the fact that override is the individual script for unique NPCs (e.g.the joinables) who have dedicated contents, dialogues or specific interactions. And of course the protagonist has no override script because what the override does for NPCs is done by the human player for his avatar.

*Stupid* monsters without individual needs are happy to act according to class or race, just like if they act by instinct. A chicken only needs an override script if his name is Melicamp.

Technically, if you do not care for game contents or story progress or compatibility, then override and baldur.bcs are the files you use to tweak the game to your liking.


Edited by Roxanne, 17 June 2017 - 11:09 PM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*

 


#9 temnix

temnix
  • Member
  • 983 posts

Posted 18 June 2017 - 01:39 AM

To Ardanis: you're forgetting that the script hierarchy is relative. The slots don't need to be about race, class and so on, the only thing that matters is what is over what. It's true that there wasn't a lot of scripting in the original BG - and how is it that the game was much more fun than Beamdog's additions with all of their heaped scripts? - but now that there is Near Infinity, easy to use and the current designers have access to it as well, in most cases scripts could be pushed downwards. The things that get readily stuck in Override could just as easily sit in Class. If you browse through the creatures, you will see that most of them have nothing in Default and General, many have nothing in Race. And those that have most of those slots filled, like Beamdog's creations tend to have, could squeeze up in there. I bet a lot of that AI for factions and combat behavior could sit in the same script. The designers just squat over the whole hierarchy, never anticipating that modders and individual players may want to add their own AI.

 

If you ask me, the Override level should always be left empty. Keep it free of furniture like the attick of a house for very special uses, such as when a modder or the designers themselves want some behavior with even higher priority than romances, NPC interactions and so on. "Individual" AI should be put in what is now called the Class level, and assorted group stuff below. I don't know what the uses of General and Default are. That's how the hierarchy should be organized to prevent crowding, instead of just sticking everything in Override.

 

About True(): that's all right, those NPC scripts start with more particular conditions. They control NPC conversations, who starts doing what where etc., so they have Globals and other checks in triggers. If they started with True(), NPC would always be doing those things. Like I said, at least Override scripts don't need the AI button clicked on to work.

 

You say you have the AI disabled? So do I, but that's because it's damn near impossible to play with it. I don't want the AI to go away, though. I would like it to be able to assist me. And the way towards that is not by complicating scripts and adding more conditions and checks, because they would still interfere with the player's intentions. I think the idea behind custom combat scripts, especially NPC scripts that we can't even read inside the game, was to let these characters fight out the battles while you only control your own Bhaalspawn. It was to trust the AI to be smart and win for you. Maybe this sort of thing worked okay in Fallout. Well, BG and the others are too complicated for that to suffice, situations and remedies are too many and too unique. But if we insert pauses in scripts in the form of Wait(2), then possibly we can intervene between actions and at least understand what the hell is going on. It would still probably not be good enough for those mysterious personal scripts, but with explicated scripts - Cleric Ranged, that sort of thing - using the AI may not be so hopeless.

 

To Roxanne: I don't know who you were talking to with your last line, but that's not at all what I had proposed.



#10 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Member
  • 286 posts

Posted 18 June 2017 - 02:22 PM

If you ask me, the Override level should always be left empty.

 

Long have I thought this, especially for temporary conditions applied by spells (or AREs, or quests, or anything).  Bioware didn't optimize script slots because they didnt have to, and now we have nearly 2 decades of mods dependent upon that inefficiency.  This is why no one bothers fixing plot holes, or introducing a better combat system, because someone's 10+ year-old mod might get broken.


Edited by Fiann of the Silver Hand, 18 June 2017 - 02:26 PM.


#11 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5155 posts

Posted 18 June 2017 - 02:50 PM

This is why no one bothers fixing plot holes, or introducing a better combat system, because someone's 10+ year-old mod might get broken.
Nope, that's not it, it's because the game is old enough to have 10 year old mods and their evolutions that are likely better than anything you can throw at it, within the confinements of the game engine. Aka, the games engine is really that tight with what it can do and what it can't.
And then there's the fact that as the older mods get older, their solutions become universal... aka if you try and make alteration to an existing system, then you make at least 50% of the old mods uncompatible with it. And that will drop your popularity ... as you can't fight the BWS.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#12 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Member
  • 286 posts

Posted 18 June 2017 - 03:21 PM

Aiming for popularity is why Katy Perry is "successful".



#13 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 18 June 2017 - 03:48 PM

I think you're taking the moddability for granted when it has really happened to be just a nice bonus.

If you need override scripts to handle custom spell effects or new mechanics, then you need to look elsewhere, because BG is not the right place for such things. The fact game's AI is also a script is bad enough already. You just don't use scripts to implement mechanics, you either code them into engine or you pick a better engine.

 

It may be seen as advantage by some - that everything can be scripted, - but BG is not a good example of how you make a moddable game.


Edited by GeN1e, 18 June 2017 - 03:53 PM.

Retired from modding.


#14 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5155 posts

Posted 18 June 2017 - 04:31 PM

Aiming for popularity is why Katy Perry is "successful".
So it has nothing to do with the few million albums she has sold ? By "singing" in them ...

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#15 temnix

temnix
  • Member
  • 983 posts

Posted 19 June 2017 - 03:06 AM

I think you're taking the moddability for granted when it has really happened to be just a nice bonus.

If you need override scripts to handle custom spell effects or new mechanics, then you need to look elsewhere, because BG is not the right place for such things. The fact game's AI is also a script is bad enough already. You just don't use scripts to implement mechanics, you either code them into engine or you pick a better engine.

 

It may be seen as advantage by some - that everything can be scripted, - but BG is not a good example of how you make a moddable game.

 

Whether BG has the most appropriate form to be modded is really neither here nor there. Of course it wasn't meant to be altered. I believe games are not meant to be poked around in any more than books or movies. They are authors' works, and the more successful they are - artistically, not commercially, Imp - the more coherent and inseparable their elements and logics endure over time. They do not require any additions. But that's on the authors' side. To us these games are something else. We didn't make these games, we grew up playing them, and we present our own creative work in their genre. Someone, whoever it was originally, developed the basic tools, others took them and improved them, and now modding is our earned right. Why stay with and within these games? Why not take a different engine? Because a different engine means a different game, and we have fallen in love with this one. And as far as making computer adventures goes, I know there is, unfortunately, no alternative. More powerful tools, sure. But there is no isometric game out there that has such beautiful visuals, music, so many interesting concepts of places and characters, one that is also relatively unassuming in its outlook, features no very specific setting and readily accepts new adventures. All other RPGs are either first-person, which has its advantages but mostly at the expense of detail (e.g. Elder Scrolls, Vampire: The Masquerade - Bloodlines), or have highly particular settings (Shadowrun or the new Torment: Tides of Numenara), or use 3D models instead of unique backgrounds (Neverwinter Nights), or they are just small-time independent projects with stupid anime or pixellated pretense for graphics.

 

To my mind, we are all huddled inside this creaking and much too lived-in arc of old-school creativity on a flood of mass-produced fakes. More plainly, I think we are here because there is just nothing that compares in visual and audial beauty, harmony and originality (of concepts). Gameplay balance, custom classes, clever scripts - this we could insert ourselves, given a powerful engine. But we don't want to either play or create for games that are dull and ordinary and ugly. Most of us are probably in our 30s and 40s, and we have lived to see beautiful and inspired games of all genres, not just role-playing, in the 1990s and 2000s. But now we are caught in a modern production values trap: small companies cannot afford and large companies do not dare to invest and risk serious money over looks and sounds and concepts that would be both original and skilled, realistic. Weird cartoons - sure. Just watch the Disney Channel and try not to throw up. Presumptuous AAA slickness so expensive to make, it has to be handled in kid gloves? Also available. But there is a distinct lack of affordable and skilled creativity on the market now. It is true that people like Mark Morgan were exceptional even back in the day, but plenty of games had less outstanding yet still interesting composers. Now the old guard is really getting old and not inspired by what goes on - and who can blame them? And the next generation of artists and designers has no real skill and a timid imagination. They have been brought up in reverence for accomplishments they do not even dream of matching. As Imp says - make something new and you might ruin something from 10+ years back.

 

All I can say about that is, to hell with it. If we, in this stretch of our lives, each for our own reasons, involve ourselves in fantasy adventures for this engine, then let's quit being so abashed about it. We do have one resource to fall back on that was no available in the glory years - a fan base of people who accept and expect the game to be modified. We have to live with the fact of not owning our house, so to speak, and this results in a painful cognitive dissonance. But by the same token we know that we owe Beamdog no special reverence. It's nice that they add new functions, but they are not doing it for us or with us. So while we can't shake up and clean up something like the scripts hierarchy - Beamdog owns the product, after all, and it may not be worth it - we should not hesitate to make and advertise sweeping changes. Let players learn to take the responsibility for what happens to their installations and playing experience.