Jump to content

AI Packages not working as intended


genovauk

Recommended Posts

I have just set up all my guards to guard from a certain time, eat and sleep. I originally had them to train on dummies but took it out to test the other packages, The problem I am having is that when I enter the worldspace the dayshift goes off to the barracks to eat, But they never come back out unless I enter the interior cell after they were suppose to come out, same goes for the night guards I have to enter the interior cell before they continue to do any of their packages. It's like they loose their AI when i'm not in the cell with them, I have tried different flags to try and make them complete there packages. But nothin works. The packages are now pretty much exactly the same as the ICMarket Guards, Day shift finds night shift before the night shift can go on to eat.

 

If anyone has run into this problem before and knows an answer to this problem could you please enlighten me or if anyone has any suggestions.

 

Oh and it's not a pathing problem, they follow the pathing just fine.

 

Thanks

Link to comment
Share on other sites

I have just set up all my guards to guard from a certain time, eat and sleep. I originally had them to train on dummies but took it out to test the other packages, The problem I am having is that when I enter the worldspace the dayshift goes off to the barracks to eat, But they never come back out unless I enter the interior cell after they were suppose to come out, same goes for the night guards I have to enter the interior cell before they continue to do any of their packages. It's like they loose their AI when i'm not in the cell with them, I have tried different flags to try and make them complete there packages. But nothin works. The packages are now pretty much exactly the same as the ICMarket Guards, Day shift finds night shift before the night shift can go on to eat.

 

If anyone has run into this problem before and knows an answer to this problem could you please enlighten me or if anyone has any suggestions.

 

Oh and it's not a pathing problem, they follow the pathing just fine.

 

Thanks

you can use the printC to follow what package is running at given situations. Maybe you already know this page but doesn't cost placing it here. Post again if you can't find an answer there.

 

The printC shall give to you and to us more specific informations about the issue.

 

In advance seems these time programmed packages should run all the time and not just when the player enters the cell. At least they should evaluate them when the player enters the adjacent worldspace. You seems to be doing the correct procedures already, just is lacking some little "Murphy's adept thing" to verify.

Link to comment
Share on other sites

I still can't figure it out, I start a brand new game enter the new world, And the night guards are stood guarding, Come 7am the day guards are suppose to wake up and find the corresponding night guard at which point the night guard goes in to eat, then sleep and then rlieve the day guard.

 

7am comes along and nothing, The day guards don't appear so I go into the barracks and hey presto the day guards just start to walk down the stairs to the barracks exit, They exit fine but no matter how long i wait inside the barracks the night guards never enter, So I step outside and the day guards then start the find package and go to their partner night guards at which point they have a small chat and the night guards then enter the barracks, But then all of the above starts all over again but this time round it's the night guards not doing anything until the player char enters the cell they are currently occupying at which point they will carry on with their packages.

 

I used the debug text thing and this confirms it, While the player is in the same cell they will do as their packages tell them to but as soon as the player leaves or they leave the cell the player is in they just stop as if they have no packages attatched to them. It is highly irritating and apart from the guards having no shedules and just have them stand where I put them in the editor I can't find any other reasons why this is happening, Also if it happens with the guards who's to say it's not going to happen with all the other npc's I have yet to put in and package up ?

Link to comment
Share on other sites

As far as I know, AI packages and scripts only run on loaded cells (the interior cell the player is in or a 5x5 cells around the player in exterior).

I suppose this is what makes the game feasible at all. I guess even a top PC might not handle the game if the thousands (?) of AI packages and scripts ran every single frame.

 

I am not really sure of how it works, but I guess the game engine simulates, during the load screen, what should have happened since the last time the cell was loaded.

 

I had serious problems with this and had to do some heavy scripting to detect these ‘anomalies’ and fix them as the player enters the room.

 

I found that, sometimes, even waiting for a couple of hours in a room also cause some weird AI behavior.

 

But I never had the time to try to understand this better and I may be wrong.

Link to comment
Share on other sites

Special attention to the timing and conditions between packages. Avoid time conflicting and make sure the GetDistance is suitable and the location correct in some packages. Some may need a near reference too.

 

With correct programming of your packages you shall not need to force evaluation.

 

By some of your sayings I think the getdistance is incorrect in some of them, or maybe even the cell ID, as could happen if you copied from existent ones.

Link to comment
Share on other sites

As far as I know, AI packages and scripts only run on loaded cells (the interior cell the player is in or a 5x5 cells around the player in exterior).

I suppose this is what makes the game feasible at all. I guess even a top PC might not handle the game if the thousands (?) of AI packages and scripts ran every single frame.

 

I am not really sure of how it works, but I guess the game engine simulates, during the load screen, what should have happened since the last time the cell was loaded.

 

I had serious problems with this and had to do some heavy scripting to detect these ‘anomalies’ and fix them as the player enters the room.

 

I found that, sometimes, even waiting for a couple of hours in a room also cause some weird AI behavior.

 

But I never had the time to try to understand this better and I may be wrong.

Generally, yes, this is correct, NPCs will only perform packages when they are in the loaded cell. Waiting periods of time can, on occasion cause can cause all NPCs to be moved to the locations they should be at, so can staying out of that cell for a few hours. As you mentioned, this is done to lower the resource drain that would be caused by hundreds of NPCs moving around constantly.

 

However, this doesn't mean NPCs can't choose packages and do them without you around, it just means that most of them don't have that ability enabled. For NPCs which must travel between areas as part of a quest or something, you can enable this ability so that they will move and do things without you watching them. Simply uncheck "no low level processing" and make the placed NPC a persistant reference. This won't work for anything created from a leveled list, and probably shouldn't be used on anything which will be getting killed. Enabling this for NPCs can increase the processor requirements for your mod slightly, so is best kept to a minimum.

 

As for working around it, you're best bet is keeping other NPC's packages as basic as possible, 22-6 sleep, 6-9 eat, 9-17 work, 17-22 eat/wander.

Link to comment
Share on other sites

I understand how it works now after observing the market day and night guards. The only problem I have is the night guards are suppose to be vampires and there are 10 of em as with the day guards so it doesn't look right when the vampire guards are out in the day light because the day guards are still in the barracks. I think I'll just use non vampires for the whold guard faction.

 

Also some of the shop keepers are vampires and while they shuold process their packages fine as they are mostly in their own interiors it's the wandering outside that may cause some issues but after reading these posts and playing with the ways packages work I should be able to work around that problem easily, I would be happy the way the guards are now if it wasn't for the vampire shift. I'll just have to take off vampirism on the 10 guards that have it.

Link to comment
Share on other sites

I understand how it works now after observing the market day and night guards. The only problem I have is the night guards are suppose to be vampires and there are 10 of em as with the day guards so it doesn't look right when the vampire guards are out in the day light because the day guards are still in the barracks. I think I'll just use non vampires for the whold guard faction.

 

Also some of the shop keepers are vampires and while they shuold process their packages fine as they are mostly in their own interiors it's the wandering outside that may cause some issues but after reading these posts and playing with the ways packages work I should be able to work around that problem easily, I would be happy the way the guards are now if it wasn't for the vampire shift. I'll just have to take off vampirism on the 10 guards that have it.

Wow, this a whole new piece of information you should have given in the first post :)

 

Since you are doing the things just fine please post your finds here in the thread, this may help a lot of people trying to do vampire AIs.

Link to comment
Share on other sites

Keep in mind that when using NPCs you can apply a different version of the vampire abiity to give them the vampire appearace but not the sundamage. Just make an ability with the spell effect "vampirism". The main reason for doing something like this is so that half your town's population doesn't go up in flames because of some packages, and it gives you a bit of a larger time window to work with since your only concern is now dealing with what looks right, rather than what will keep people from getting fried.

 

As far as vendors go, you're actually best off making them presistant references and enabling low level processing. The main reason for this is because typically vendors have to do quite a few things behind the scenes (locking and unlocking their shop) and enabling this higher procesing can ensure that the shop opens on time, and not 5 hours later. People may not notice when a guard isn't at their post, people will notice that a shop isn't getting opened on time.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...